From: Shroom Moo Date: Wed, 06 May 2026 20:27:48 GMT Subject: [PATCH v6 0/3] git-gui: robustify startup and fix environment handling Message-ID: In-Reply-To: This series addresses the startup crash introduced by Git commit "2d92ab32fd ("rev-parse: make --show-toplevel without a worktree an error", 2019-11-19)", which causes `git gui` to die with a Tcl error when a worktree is missing (e.g. inside a .git directory without a working tree, or in a bare repository). Additionally, it resolves two historically inconsistent behaviours: - The "Visualize ... History" menu items were enabled in bare repositories but triggered Tcl errors due to the missing worktree. - `GIT_WORK_TREE` and `GIT_DIR` environment variables were not respected early enough, so `GIT_WORK_TREE=/some/path git gui` often ignored the explicit worktree and brought up the repository picker, and an exported empty `GIT_WORK_TREE` confused commands like `git branch --show-current` in bare repositories. Shroom Moo (3): git-gui: restructure repository startup git-gui: disable gitk visualization when no worktree available git-gui: handle GIT_DIR and GIT_WORK_TREE early git-gui/git-gui.sh | 170 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 128 insertions(+), 42 deletions(-) -- 2.52.0.windows.1