From: Shawn Bohrer Date: Sun, 27 Jan 2008 21:15:39 GMT Subject: Re: [PATCH] Fix off by one error in prep_exclude. Message-ID: <20080127211539.GA10993@lintop> In-Reply-To: On Sun, Jan 27, 2008 at 08:44:57PM +0000, Johannes Schindelin wrote: > Hi, > > On Sun, 27 Jan 2008, Shawn Bohrer wrote: > > > base + current already includes the trailing slash so adding > > one removes the first character of the next directory. > > > > Signed-off-by: Shawn Bohrer > > --- > > > > This fixes the oops part of the issue Johannes found, > > have I? Sorry I should have been more explicit Johannes Sixt reported the issue, you were included simply because you had been involved in the thread. > > but doesn't address the fact that we probably should remove files that > > aren't a part of the repository at in the first place. > > I am sorry, but I cannot begin to see what this commit tries to > accomplish. Yes, sure, there is an off-by-one error, and your commit > message says how that was fixed. But I miss a description what usage it > would affect, i.e. when this bug triggers. As far as I can see there are two protential cases that could trigger this bug, but there may be more. This first was the arguably invalid case the Johannes Sixt reported. git clean -n / The other case that could trigger this bug and potentially others is if someone makes their root dircetory a git repository and then uses "/" as an absolute path. For example: cd / git init git clean -n / You may argue that both of these cases are invalid and that is fine by me, but since I noticed this bug I thought I would send a patch. If you wouldlike I can add these two use cases to the commit message. -- Shawn