On 04.01.17 01:48, Jeff King wrote: > On Tue, Jan 03, 2017 at 11:09:18AM -0800, Brandon Williams wrote: > >> Only change with v4 is in [1/5] renaming the #define MAXSYMLINKS back to >> MAXDEPTH due to a naming conflict brought up by Lars Schneider. > > Hmm. Isn't MAXSYMLINKS basically what you want here, though? It what's > what all other similar functions will be using. > > The only problem was that we were redefining the macro. So maybe: > > #ifndef MAXSYMLINKS > #define MAXSYMLINKS 5 > #endif > > would be a good solution? Why 5 ? (looking at the 20..30 below) And why 5 on one system and e.g. on my Mac OS #define MAXSYMLINKS 32
Would the same value value for all Git installations on all platforms make sense? #define GITMAXSYMLINKS 20 > > It looks like the "usual" value is more like 20 or 30 on most systems, > though. We should probably also set errno to ELOOP when we hit the > limit, which is what other symlink-resolving functions would do. > > I'm surprised we didn't hit this on Linux, which has MAXSYMLINKS, too. > We should be picking it up from <sys/param.h>. > > -Peff >