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

Re: [REGRESSION] gitk can't be run from non-worktree folders

From
Cch <cr@onlinehome.de>
Date
Apr 2, 2020, 13:40 UTC
Message-ID
<3c1a3e23-cf52-48cc-e9b6-f80642ca67ac@onlinehome.de>
In-Reply-To
<CAPig+cTixT9JYDPn-umKdQLtTm5byA1wwmvVY1ryuh+hv2=6MQ@mail.gmail.com>

I haven't actually bisected it but the change possibly also broke git-gui-browser on bare repositories.

The follow patch seems to fix the issue. As I stated in my original bug report I'm using Git for Windows so maybe it does not apply cleanly on upstream Git.

-- >8 --

--- git-gui.tcl 2020-03-23 12:22:36.000000000 +0100 +++ git-gui-fixed.tcl 2020-04-01 17:35:26.092223600 +0200

@@ -1286,7 +1286,7 @@
  	if { [is_Cygwin] } {
  		catch {set _gitworktree [exec cygpath --windows [git rev-parse --show-toplevel]]}
  	} else {
-		set _gitworktree [git rev-parse --show-toplevel]
+		catch {set _gitworktree [git rev-parse --show-toplevel]}
  	}
  } else {
  	# try to set work tree from environment, core.worktree or use

-- >8 --

On 23.01.2020 17:36, Eric Sunshine wrote:

> It's a new regression introduced by 2d92ab32fd (rev-parse: make
> --show-toplevel without a worktree an error, 2019-11-19), as far as I
> can tell. I have many times used gitk on bare repositories as an
> interactive replacement for git-log, so this is a unfortunate bit of
> fallout from that change. That's not to say that 2d92ab32fd should be
> reverted, though... perhaps gitk itself needs a bit of a fix.
> 
Previous: Pratyush YadavNext: Junio C Hamano
Message 14 of 15 in “[REGRESSION] gitk can't be run from non-worktree folders”
  1. chJan 23, 2020
  2. SZEDER GáborJan 23, 2020
  3. Eric SunshineJan 23, 2020
  4. SZEDER GáborJan 23, 2020
  5. SZEDER GáborJan 23, 2020
  6. Junio C HamanoJan 23, 2020
  7. gitk: to run in a bare repository (was: gitk can't be run from non-worktree folders)Junio C Hamano, Jan 23, 2020
  8. Eric SunshineJan 23, 2020
  9. Jeff KingJan 23, 2020
  10. chMar 30, 2020
  11. Eric SunshineOct 11, 2020
  12. chOct 13, 2020
  13. Pratyush YadavOct 13, 2020
  14. chApr 2, 2020
  15. Junio C HamanoApr 2, 2020

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.