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 ../ cdupI 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