Re: [PATCH] index: be careful when handling long names
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Jan 13, 2008, 23:33 UTC
- Message-ID
- <20080113233323.GB19970@steel.home>
- In-Reply-To
- <7v4pdhpbmw.fsf@gitster.siamese.dyndns.org>
Junio C Hamano, Mon, Jan 14, 2008 00:08:07 +0100:
Show 17 quoted lines
> Alex Riesen <raa.lkml@gmail.com> writes: > > > Junio C Hamano, Sun, Jan 13, 2008 23:36:34 +0100: > >> +test_expect_success 'very long name in the index handled sanely' ' > >> + > >> + a=a && # 1 > >> + a=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 16 > >> + a=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 256 > >> + a=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 4096 > > > > I'd expect it to fail on some systems (everywindowsthing up to w2k, > > maybe some commercial unices). > > My understanding is that Everywindowsthing do not come with any > (POSIX compliant) shell that we support by default, so if you > are talking about a limit of shell variable value, I do not > think it is an issue to begin with. It is just the matter of
Oh, right. The file system wont even see it, it is passed directly to update-index.
> picking a sensible shell (I understand both Cygwin and msys > ports use a shell that supports more than 4k bytes in value > given to a variable).
can't check right now, but I believe it is so
> I would agree that it might overflow the argument limit when > this is given to "echo", though. We cannot do much about it, > but you may have cleverer ideas.
I thought about conditionally disabling the test, like it was done when the tabs in filenames had to be tested. Wont be needed for this particular case.