summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 685caf9)
raw | patch | inline | side by side (parent: 685caf9)
author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 9 May 2007 01:58:25 +0000 (21:58 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 9 May 2007 01:58:25 +0000 (21:58 -0400) |
I think it was Andy Parkins who pointed out that git gui blame HEAD f
does not work if f is in a subdirectory and we are currently running
git-gui within that subdirectory. This is happening because we did
not take the user's prefix into account when we computed the file
path in the repository.
We now assume the prefix as returned by rev-parse --show-prefix is
valid and we use that during the command line blame subcommand when
we apply the parameters.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
does not work if f is in a subdirectory and we are currently running
git-gui within that subdirectory. This is happening because we did
not take the user's prefix into account when we computed the file
path in the repository.
We now assume the prefix as returned by rev-parse --show-prefix is
valid and we use that during the command line blame subcommand when
we apply the parameters.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index 568c814c60d4e8e9f73224c22a723eb2311594f4..8f33f81c58c54aef6bb8f272bf9ae47c08d42a62 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
##
## repository setup
-if { [catch {set _gitdir $env(GIT_DIR)}]
- && [catch {set _gitdir [git rev-parse --git-dir]} err]} {
+if {[catch {
+ set _gitdir $env(GIT_DIR)
+ set _prefix {}
+ }]
+ && [catch {
+ set _gitdir [git rev-parse --git-dir]
+ set _prefix [git rev-parse --show-prefix]
+ } err]} {
catch {wm withdraw .}
error_popup "Cannot find the git directory:\n\n$err"
exit 1
exit 1
}
set current_branch [lindex $argv 0]
- blame::new $current_branch [lindex $argv 1]
+ blame::new $current_branch $_prefix[lindex $argv 1]
return
}
citool -