git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lars Hjemli" <hjemli@gmail.com>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH 2/5] Add platform-independent .git "symlink"
Date: Mon, 18 Feb 2008 14:18:32 +0100	[thread overview]
Message-ID: <8c5c35580802180518x5c392bddya21c48ea4db9a7cd@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.1.00.0802181217580.30505@racer.site>

On Feb 18, 2008 1:34 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Mon, 18 Feb 2008, Lars Hjemli wrote:
>
> > diff --git a/environment.c b/environment.c
> > index 3527f16..8058e7b 100644
> > --- a/environment.c
> > +++ b/environment.c
> > @@ -49,6 +49,8 @@ static void setup_git_env(void)
> >  {
> >       git_dir = getenv(GIT_DIR_ENVIRONMENT);
> >       if (!git_dir)
> > +             git_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);
> > +     if (!git_dir)
> >               git_dir = DEFAULT_GIT_DIR_ENVIRONMENT;
>
> I still maintain that the code (maybe not the diff) is easier to read like
> this:
>
>         if (!git_dir) {
>                 git_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);
>                 if (!git_dir)
>                         git_dir = DEFAULT_GIT_DIR_ENVIRONMENT;
>         }

IMHO such constructs are butt ugly, but if there's consensus for your
way, I'll abide...


> [* snip *]
>
> So maybe we can just scratch all that, and I agree that an invalid .git
> file means "no repository" (as opposed to "no valid repository").
>
> In that case, you might want to test for that, too...

I think I do, did you find a loophole in the testing?


>
> Speaking about tests:
>
> > +test_expect_success 'setup' '
> > +       REAL="$(pwd)/.real" &&
> > +       mv .git "$REAL" &&
> > +       echo "gitdir: $REAL" >.git
> > +'
>
> Let's not do this.  It would clutter the t/ directory unnecessarily.

What do you mean? The test just moves t/trash/.git to t/trash/.real...

--
larsh

  reply	other threads:[~2008-02-18 13:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-18 10:44 [PATCH 0/5 v2] Introduce the .gitfile Lars Hjemli
2008-02-18 10:44 ` [PATCH 1/5] Simplify setup of $GIT_DIR in git-sh-setup.sh Lars Hjemli
2008-02-18 10:44   ` [PATCH 2/5] Add platform-independent .git "symlink" Lars Hjemli
2008-02-18 10:44     ` [PATCH 3/5] Teach resolve_gitlink_ref() about the .git file Lars Hjemli
2008-02-18 10:44       ` [PATCH 4/5] git-submodule: prepare for the .git-file Lars Hjemli
2008-02-18 10:44         ` [PATCH 5/5] Teach GIT-VERSION-GEN about the .git file Lars Hjemli
2008-02-18 12:34     ` [PATCH 2/5] Add platform-independent .git "symlink" Johannes Schindelin
2008-02-18 13:18       ` Lars Hjemli [this message]
2008-02-18 13:34         ` Jakub Narebski
2008-02-18 13:35         ` Johannes Schindelin
2008-02-18 14:04           ` Lars Hjemli
2008-02-18 14:44           ` Lars Hjemli
2008-02-18 14:54             ` Johannes Schindelin
2008-02-18 12:17 ` [PATCH 0/5 v2] Introduce the .gitfile Johannes Schindelin
2008-02-18 12:56   ` Lars Hjemli
2008-02-18 13:31     ` Johannes Schindelin
2008-02-18 14:01       ` Lars Hjemli
2008-02-18 14:12         ` 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=8c5c35580802180518x5c392bddya21c48ea4db9a7cd@mail.gmail.com \
    --to=hjemli@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).