git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCHv2 2/2] git-gui: handle bare repos correctly
Date: Fri, 20 Feb 2009 01:34:30 +0100	[thread overview]
Message-ID: <cb7bb73a0902191634n30f97c24t4d1840f5660c3eb3@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0902190322470.10279@pacific.mpi-cbg.de>

On Thu, Feb 19, 2009 at 3:25 AM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
>>
>> +proc is_bare {} {
>> +     global _isbare
>> +     global _gitdir
>> +     global _gitworktree
>> +
>> +     if {$_isbare eq {}} {
>> +             if {[is_config_true core.bare]
>> +                     || ($_gitworktree eq {}
>> +                             && [lindex [file split $_gitdir] end] ne {.git})} {
>> +                     set _isbare 1
>> +             } else {
>> +                     set _isbare 0
>> +             }
>> +     }
>> +     return $_isbare
>> +}
>
> git rev-parse --is-bare-repository anyone?

As mentioned elsewhere, git-gui is supposed to be backwards compatible
with git 1.5.0; --is-bare-repository was introduced in 1.5.2. What I
can do is try that and fall back to this other implementation
otherwise.

>> @@ -1913,7 +1931,7 @@ proc do_gitk {revs} {
>>               }
>>
>>               set pwd [pwd]
>> -             if { $_gitworktree ne {} } {
>> +             if { ![is_bare] } {
>
> Why is this change needed at all?

Because the worktree being undefined in non-bare repositories is an
error and should raise consequently.

>> @@ -2317,10 +2335,12 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
>>  #
>>  menu .mbar.repository
>>
>> -.mbar.repository add command \
>> -     -label [mc "Explore Working Copy"] \
>> -     -command {do_explore}
>> -.mbar.repository add separator
>> +if {![is_bare]} {
>> +     .mbar.repository add command \
>> +             -label [mc "Explore Working Copy"] \
>> +             -command {do_explore}
>> +     .mbar.repository add separator
>> +}
>
> How did you make sure that there are no more places?

I looked at the code and tested it.

> (I, for one, would expect the standard mode of staging to fail in a bare
> repository.)

That's the reason why the only thing you can do in bare repositories
is git gui blame.

-- 
Giuseppe "Oblomov" Bilotta

  reply	other threads:[~2009-02-20  0:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19  1:15 [PATCHv2 0/2] git-gui: generic and robust worktree/gitdir support Giuseppe Bilotta
2009-02-19  1:15 ` [PATCHv2 1/2] git-gui: handle non-standard worktree locations Giuseppe Bilotta
2009-02-19  2:22   ` Johannes Schindelin
2009-02-20  0:21     ` Giuseppe Bilotta
2009-02-20  0:44       ` Johannes Schindelin
2009-02-20  1:20         ` Giuseppe Bilotta
2009-02-19  1:15 ` [PATCHv2 2/2] git-gui: handle bare repos correctly Giuseppe Bilotta
2009-02-19  2:25   ` Johannes Schindelin
2009-02-20  0:34     ` Giuseppe Bilotta [this message]
2009-02-20  1:32       ` [PATCHv2bis " Giuseppe Bilotta

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=cb7bb73a0902191634n30f97c24t4d1840f5660c3eb3@mail.gmail.com \
    --to=giuseppe.bilotta@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --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).