summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95af4d8)
raw | patch | inline | side by side (parent: 95af4d8)
author | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 30 Jul 2007 00:29:52 +0000 (20:29 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 30 Jul 2007 03:44:51 +0000 (23:44 -0400) |
If the user looks at an untracked file in our diff pane we used
to offer "Stage Hunk For Commit" in the context menu when they
right-clicked in that pane. The problem is we don't actually
have any diff hunks in untracked files, so there is nothing to
really select for staging. So we now grey out the menu item,
so the user cannot invoke it and think its broken when it does
not perform any useful action.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
to offer "Stage Hunk For Commit" in the context menu when they
right-clicked in that pane. The problem is we don't actually
have any diff hunks in untracked files, so there is nothing to
really select for staging. So we now grey out the menu item,
so the user cannot invoke it and think its broken when it does
not perform any useful action.
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 4e3b58cfd396abcf6c2f607c7226c2bba3d39568..01807561553b564bf1cd5330ef9ca35efdc05e19 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
set ::cursorY $y
if {$::ui_index eq $::current_diff_side} {
$ctxm entryconf $::ui_diff_applyhunk \
+ -state normal \
-label {Unstage Hunk From Commit}
+ } elseif {{_O} eq [lindex $::file_states($::current_diff_path) 0]} {
+ $ctxm entryconf $::ui_diff_applyhunk \
+ -state disabled \
+ -label {Stage Hunk For Commit}
} else {
$ctxm entryconf $::ui_diff_applyhunk \
+ -state normal \
-label {Stage Hunk For Commit}
}
tk_popup $ctxm $X $Y