Re: [PATCH v2] Add support for GIT_CEILING_DIRS
- Date: Thu, 15 May 2008 09:26:55 -0700
- From: David Reiss <dreiss@xxxxxxxxxxxx>
- Subject: Re: [PATCH v2] Add support for GIT_CEILING_DIRS
The problem with this implementation is that it does not distinguish
between GIT_CEILING_DIRS being unset and GIT_CEILING_DIRS="/". For
example...
cd /
sudo git init
cd /home
git rev-parse --show-prefix
That series of commands works with either version of my patch, but fails
with "fatal: Not a git repository" if I apply this change. I am
certainly open to changing this code, but I think we will always
need two separate values of ceil_offset to represent "unset" and "/".
It's just a question of whether they should be -1 and 0 or 0 and 1.
--David
Johannes Schindelin wrote:
> Hi,
>
> On Thu, 15 May 2008, Johannes Sixt wrote:
>
>> + do { } while (offset > ceil_offset && cwd[--offset] != '/');
>
> You probably meant to remove the "do { }", and have an own line
>
> ; /* do nothing */
>
> but for the rest, I agree that it is easier on the eye (particularly the
> off-by-one issue, which is always a problem for this developer to get
> right; avoiding it is therefore the better option).
>
> Ciao,
> Dscho
>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html