Re: Problem with git-gui and relative directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Shawn O. Pearce" <spearce@xxxxxxxxxxx> writes:

> Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>
> ---
>  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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux