git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/3] git-gui: properly check for a bare repo
Date: Wed, 18 Feb 2009 22:47:02 +0100	[thread overview]
Message-ID: <cb7bb73a0902181347k6ae479b4v84e2ea8a9f6639dc@mail.gmail.com> (raw)
In-Reply-To: <20090218171639.GE22848@spearce.org>

On Wed, Feb 18, 2009 at 6:16 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> wrote:
>> When bare repository handling is not enabled, check for a bare
>> repository looking at the core.bare config option rather than refusing
>> to operate with a git directory ending with .git.
>>
>> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
>> ---
>> I know I should have probably used something like
>> git rev-parse --is-bare-repository instead, but I didn't feel like
>> adding another git call. Is the config approach robust enough?
>>
>>  git-gui/git-gui.sh |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
>> index e018e07..658a728 100755
>> --- a/git-gui/git-gui.sh
>> +++ b/git-gui/git-gui.sh
>> @@ -1071,7 +1071,7 @@ if {$_prefix ne {}} {
>>       }
>>       unset cdup
>>  } elseif {![is_enabled bare]} {
>> -     if {[lindex [file split $_gitdir] end] ne {.git}} {
>> +     if {[is_config_true core.bare]} {
>
> This doesn't work as you expect.  Its a chicken-and-egg problem.
> We haven't read the config yet because we aren't sure that the
> $_gitdir really is a git directory.  Consequently, core.bare is
> always false.

Isn't the config loaded on line 1053?

Better ways to work around the issue?

-- 
Giuseppe "Oblomov" Bilotta

  reply	other threads:[~2009-02-18 21:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09  2:00 [PATCH 0/3] git-gui: generic and robust worktree/gitdir support Giuseppe Bilotta
2009-02-09  2:00 ` [PATCH 1/3] git-gui: properly check for a bare repo Giuseppe Bilotta
2009-02-18 17:16   ` Shawn O. Pearce
2009-02-18 21:47     ` Giuseppe Bilotta [this message]
2009-02-18 21:53       ` Shawn O. Pearce
2009-02-09  2:00 ` [PATCH 2/3] git-gui: use the actual worktree Giuseppe Bilotta
2009-02-18 17:22   ` Shawn O. Pearce
2009-02-09  2:00 ` [PATCH 3/3] git-gui: define correct GIT_DIR for gitk Giuseppe Bilotta
2009-02-18 17:22   ` Shawn O. Pearce

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=cb7bb73a0902181347k6ae479b4v84e2ea8a9f6639dc@mail.gmail.com \
    --to=giuseppe.bilotta@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    /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).