Re: Problem with git-gui and relative directories
From: David Kastrup <hidden>
Date: 2016-06-15 22:43:30
"Shawn O. Pearce" [off-list ref] writes:
quoted hunk
Signed-off-by: Shawn O. Pearce <redacted> --- 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