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

Re: Problem with git-gui and relative directories

From
David Kastrup <dak@gnu.org>
Date
Aug 25, 2007, 07:26 UTC
Message-ID
<85veb4dqhv.fsf@lola.goethe.zz>
In-Reply-To
<20070825031834.GW27913@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 16 quoted lines
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
> ---
>  git-gui.sh |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/git-gui.sh b/git-gui.sh
> index 743b7d4..fa30ccc 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -703,7 +703,15 @@ if {![file isdirectory $_gitdir]} {
>  	error_popup "Git directory not found:\n\n$_gitdir"
>  	exit 1
>  }
> -if {![is_enabled bare]} {
> +if {$_prefix ne {}} {
> +	regsub -all {[^/]+/} $_prefix ../ cdup

I don't like this approach. It assumes too much about the file system and cleanliness of paths. It does all of the following:

/somedir/ -> /../ /somedir -> /somedir //server/somedir -> //../somedir /somedir//someother -> /..//someother

and so on. It can't deal with directory symlinks properly. And the approach does not scale to Windows and other systems with diverging path syntaxes at all.

Isn't it possible to move to the workdir root for the purpose of interpreting workdir root relative filenames?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 3 of 4 in “Problem with git-gui and relative directories”
  1. David KastrupAug 24, 2007
  2. Shawn O. PearceAug 25, 2007
  3. David KastrupAug 25, 2007
  4. Shawn O. PearceAug 25, 2007

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.