Re: [PATCH v2 09/11] git-gui: allow specifying path '.' to the browser
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- May 23, 2026, 14:23 UTC
- Message-ID
- <ae3cdc22-2f88-4222-bab7-403408373a53@kdbg.org>
- In-Reply-To
- <20260520202411.108764-10-mlevedahl@gmail.com>
Am 20.05.26 um 22:24 schrieb Mark Levedahl:
Show 7 quoted lines
> Invoking "git-gui browser rev ." should show the file browser for the > commitish rev, starting at the current directory. When the current > directory is the working tree root, this errors out in normalize_relpath > because the '.' is removed, yielding an empty list as argument to [file > join ...]. The browser function demands "./" in this case, so make it > so. (./ works on Windows as well because g4w accepts posix file > naming).
I wonder why we need "./" instead of plain ".". The latter works just fine in my tests (on Linux).
Show 23 quoted lines
>
> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
> ---
> git-gui.sh | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/git-gui.sh b/git-gui.sh
> index a72d8a59ec..d373457901 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -3007,7 +3007,11 @@ proc normalize_relpath {path} {
> }
> lappend elements $item
> }
> - return [eval file join $elements]
> + if {$elements ne {}} {
> + return [eval file join $elements]
> + } else {
> + return {./}
> + }
> }
>
> # -- Not a normal commit type invocation? Do that instead!-- Hannes