git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv2 2/2] git-gui: handle bare repos correctly

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 19, 2009, 02:25 UTC
Message-ID
<alpine.DEB.1.00.0902190322470.10279@pacific.mpi-cbg.de>
In-Reply-To
<1235006145-16760-3-git-send-email-giuseppe.bilotta@gmail.com>
Hi,
On Thu, 19 Feb 2009, Giuseppe Bilotta wrote:
Show 32 quoted lines
> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index 12c7ff3..a4c0d4b 100755
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh
> @@ -122,6 +122,7 @@ unset oguimsg
>  set _appname {Git Gui}
>  set _gitdir {}
>  set _gitworktree {}
> +set _isbare {}
>  set _gitexec {}
>  set _reponame {}
>  set _iscygwin {}
> @@ -254,6 +255,23 @@ proc get_config {name} {
>  	}
>  }
>  
> +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?
Show 6 quoted lines
> @@ -1913,7 +1931,7 @@ proc do_gitk {revs} {
>  		}
>  
>  		set pwd [pwd]
> -		if { $_gitworktree ne {} } {
> +		if { ![is_bare] } {
Why is this change needed at all?
Show 14 quoted lines
> @@ -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, for one, would expect the standard mode of staging to fail in a bare repository.)

Ciao, Dscho

Previous: Giuseppe BilottaNext: Giuseppe Bilotta
Message 8 of 10 in “[PATCHv2 0/2] git-gui: generic and robust worktree/gitdir support”
  1. Giuseppe BilottaFeb 19, 2009
  2. 1/2 git-gui: handle non-standard worktree locationsGiuseppe Bilotta, Feb 19, 2009
  3. Johannes SchindelinFeb 19, 2009
  4. Giuseppe BilottaFeb 20, 2009
  5. Johannes SchindelinFeb 20, 2009
  6. Giuseppe BilottaFeb 20, 2009
  7. 2/2 git-gui: handle bare repos correctlyGiuseppe Bilotta, Feb 19, 2009
  8. Johannes SchindelinFeb 19, 2009
  9. Giuseppe BilottaFeb 20, 2009
  10. 2/2 git-gui: handle bare repos correctlyGiuseppe Bilotta, Feb 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.