Re: [PATCH] describe: rewrite name_rev() iteratively

2014-04-08 Thread Jeff King
On Mon, Apr 07, 2014 at 01:47:14AM +0300, Dragos Foianu wrote: > The "git describe --contains" command uses the name_rev() function which > is currently a recursive function. This causes a Stack Overflow when the > history is large enough. > > Rewrite name_rev iteratively using a stack on the hea

Re: [PATCH] describe: rewrite name_rev() iteratively

2014-04-08 Thread Eric Sunshine
[cc: Sylvestre Ledru ] On Sun, Apr 6, 2014 at 6:47 PM, Dragos Foianu wrote: > The "git describe --contains" command uses the name_rev() function which > is currently a recursive function. This causes a Stack Overflow when the > history is large enough. No need to capitalize "stack overflow". It

[PATCH] describe: rewrite name_rev() iteratively

2014-04-06 Thread Dragos Foianu
The "git describe --contains" command uses the name_rev() function which is currently a recursive function. This causes a Stack Overflow when the history is large enough. Rewrite name_rev iteratively using a stack on the heap. This slightly reduces performance due to the extra operations on the he