git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Reiss <dreiss@facebook.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Johannes Sixt <j.sixt@viscovery.net>, git@vger.kernel.org
Subject: Re: [PATCH v2] Add support for GIT_CEILING_DIRS
Date: Thu, 15 May 2008 09:26:55 -0700	[thread overview]
Message-ID: <482C644F.9090903@facebook.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0805151004400.30431@racer>

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
> 

  reply	other threads:[~2008-05-15 16:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15  1:35 [PATCH v2] Add support for GIT_CEILING_DIRS David Reiss
2008-05-15  7:06 ` Johannes Sixt
2008-05-15  7:11   ` David Reiss
2008-05-15  8:38     ` Johannes Sixt
2008-05-15  9:06       ` Johannes Schindelin
2008-05-15 16:26         ` David Reiss [this message]
2008-05-15 17:45           ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=482C644F.9090903@facebook.com \
    --to=dreiss@facebook.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).