]> Kevux Git Server - rit/commit
git-gui: add gui and pick as explicit subcommands
authorMark Levedahl <mlevedahl@gmail.com>
Sun, 31 May 2026 23:02:25 +0000 (19:02 -0400)
committerJohannes Sixt <j6t@kdbg.org>
Tue, 2 Jun 2026 17:13:14 +0000 (19:13 +0200)
commite61190e2faf7ee677424c622881899a10e41612c
tree6dd36d0cdd55b8ab3d1cd86cce08d883ae7e36ca
parent3fbef193c7e49e8edb5a4421c465df67de944da6
git-gui: add gui and pick as explicit subcommands

git-gui accepts subcommands blame | browser | citool, and assumes the
subcommand is 'gui' if none is actually given, But, git-gui also has a
repository picker (choose_repository::pick) that can create a new
repository + worktree, or choose an existing one, switch to that, and
the run the gui. The user has no direct control over invoking the
picker, instead the picker is triggered by failure in the repository /
worktree discovery process: this includes being started in a directory
not controlled by git, which is probably the intended use case.

The picker can appear when the user has no intention of creating a new
worktree, and the user cannot use the picker to create a new worktree
inside another.

So, add two explicit subcommands:
    gui  - Run the gui if repository/worktree discovery succeeds, or die
           with an error message, but never run the picker.
    pick - First run the picker, regardless, then start the gui in
           the chosen worktree.

Nothing in this changes the prior behavior, the alternates above must be
explicitly selected to see any change.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
git-gui.sh