From: Johannes Sixt Date: Fri, 15 May 2026 08:28:18 GMT Subject: Re: [PATCH v7 2/3] git-gui: disable gitk visualization when no worktree available Message-ID: In-Reply-To: Am 09.05.26 um 15:37 schrieb Shroom Moo: > When git-gui is started in a bare repository with the 'bare' option > enabled (e.g., for blame/browser), there is no working tree. The > "Visualize Current Branch's History" and "Visualize All Branch > History" menu items remain enabled, but clicking them triggers a Tcl > error because do_gitk tries to change directory to an empty > _gitworktree. I cannot reproduce this claim. The failure is not a Tcl error, but an error in some `git` invocation that cannot handle an empty GIT_WORK_TREE. And that happens only beginning with the *second* invocation of one of the "Visualize" calls, because then an empty GIT_WORK_TREE is exported into the environment. > > Fix this by disabling the two visualization menu items when the > repository is bare and the 'bare' option is active. Also update > current_branch_write to keep the state consistent when the branch > changes, and add a defensive check in do_gitk to avoid the error > should the menu state somehow become out of sync. This change is not correct. Gitk can operate without a working tree. The menu entries should not be disabled, ever. The bug is somewhere else. See also my suggested replacement patch in my reply to 3/3. -- Hannes