summaryrefslogtreecommitdiff
path: root/git-gui/git-gui.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-24 19:16:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-24 19:16:26 (GMT)
commitb30ccd757354ea09b41e4359b0a5ab429d12f02e (patch)
tree171cf9a99a9fe390a98a2d6a500e2ff37b9f19eb /git-gui/git-gui.sh
parent288123f01cb1b835edbf6e2e188159c2ff858aca (diff)
parent87cd09f43e56de5235d09aef3ff5d840419fef49 (diff)
downloadgit-b30ccd757354ea09b41e4359b0a5ab429d12f02e.zip
git-b30ccd757354ea09b41e4359b0a5ab429d12f02e.tar.gz
git-b30ccd757354ea09b41e4359b0a5ab429d12f02e.tar.bz2
Merge branch 'maint' of git://git.spearce.org/git-gui into maint
* 'maint' of git://git.spearce.org/git-gui: git-gui: work from the .git dir git-gui: Fix applying a line when all following lines are deletions git-gui: Correct file_states when unstaging partly staged entry git-gui: Fix gitk for branch whose name matches local file git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync git-gui: handle really long error messages in updateindex. git-gui: Add hotkeys for "Unstage from commit" and "Revert changes" git-gui: Makefile: consolidate .FORCE-* targets
Diffstat (limited to 'git-gui/git-gui.sh')
-rwxr-xr-xgit-gui/git-gui.sh25
1 files changed, 22 insertions, 3 deletions
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 718277a..1fb3cbf 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1074,6 +1074,8 @@ if {[catch {
set _prefix {}
}]
&& [catch {
+ # beware that from the .git dir this sets _gitdir to .
+ # and _prefix to the empty string
set _gitdir [git rev-parse --git-dir]
set _prefix [git rev-parse --show-prefix]
} err]} {
@@ -1082,6 +1084,14 @@ if {[catch {
choose_repository::pick
set picked 1
}
+
+# we expand the _gitdir when it's just a single dot (i.e. when we're being
+# run from the .git dir itself) lest the routines to find the worktree
+# get confused
+if {$_gitdir eq "."} {
+ set _gitdir [pwd]
+}
+
if {![file isdirectory $_gitdir] && [is_Cygwin]} {
catch {set _gitdir [exec cygpath --windows $_gitdir]}
}
@@ -1613,6 +1623,9 @@ proc merge_state {path new_state {head_info {}} {index_info {}}} {
} elseif {$s0 ne {_} && [string index $state 0] eq {_}
&& $head_info eq {}} {
set head_info $index_info
+ } elseif {$s0 eq {_} && [string index $state 0] ne {_}} {
+ set index_info $head_info
+ set head_info {}
}
set file_states($path) [list $s0$s1 $icon \
@@ -1941,7 +1954,7 @@ proc do_gitk {revs} {
cd [file dirname [gitdir]]
set env(GIT_DIR) [file tail [gitdir]]
- eval exec $cmd $revs &
+ eval exec $cmd $revs "--" "--" &
if {$old_GIT_DIR eq {}} {
unset env(GIT_DIR)
@@ -2543,12 +2556,14 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add command -label [mc "Unstage From Commit"] \
- -command do_unstage_selection
+ -command do_unstage_selection \
+ -accelerator $M1T-U
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
.mbar.commit add command -label [mc "Revert Changes"] \
- -command do_revert_selection
+ -command do_revert_selection \
+ -accelerator $M1T-J
lappend disable_on_lock \
[list .mbar.commit entryconf [.mbar.commit index last] -state]
@@ -3296,6 +3311,10 @@ unset gws
bind $ui_comm <$M1B-Key-Return> {do_commit;break}
bind $ui_comm <$M1B-Key-t> {do_add_selection;break}
bind $ui_comm <$M1B-Key-T> {do_add_selection;break}
+bind $ui_comm <$M1B-Key-u> {do_unstage_selection;break}
+bind $ui_comm <$M1B-Key-U> {do_unstage_selection;break}
+bind $ui_comm <$M1B-Key-j> {do_revert_selection;break}
+bind $ui_comm <$M1B-Key-J> {do_revert_selection;break}
bind $ui_comm <$M1B-Key-i> {do_add_all;break}
bind $ui_comm <$M1B-Key-I> {do_add_all;break}
bind $ui_comm <$M1B-Key-x> {tk_textCut %W;break}