git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags
@ 2010-11-30 22:21 Bert Wesarg
  2010-12-03 13:34 ` Bert Wesarg
  2010-12-06 21:48 ` Pat Thoyts
  0 siblings, 2 replies; 5+ messages in thread
From: Bert Wesarg @ 2010-11-30 22:21 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Shawn O. Pearce, git, Bert Wesarg

This covers also the case for newly added files in the index. Like this:

    echo bar >foo
    git add foo
    rm foo
    ln -s bar foo

This will result in an state of AT. And for cases where the type change is
staged, and the new type was modified after the staging. Like this (cont.):

    git add foo
    git commit -mfoo
    rm foo
    echo bar >foo
    git add foo
    echo baz >foo

Will result in an state of TM for foo.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 git-gui.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index 38362fa..1bebcf1 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1993,7 +1993,9 @@ foreach i {
 		{MD {mc "Staged for commit, missing"}}
 
 		{_T {mc "File type changed, not staged"}}
+		{AT {mc "File type changed, old type staged for commit"}}
 		{T_ {mc "File type changed, staged"}}
+		{TM {mc "Staged file type change, modification not staged"}}
 
 		{_O {mc "Untracked, not staged"}}
 		{A_ {mc "Staged for commit"}}
@@ -3533,8 +3535,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {
 			|| $current_diff_path eq {}
 			|| {__} eq $state
 			|| {_O} eq $state
-			|| {_T} eq $state
-			|| {T_} eq $state
+			|| [string match {?T} $state]
+			|| [string match {T?} $state]
 			|| [has_textconv $current_diff_path]} {
 			set s disabled
 		} else {
-- 
1.7.3.2.1200.ge4bf6

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-06 22:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-30 22:21 [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags Bert Wesarg
2010-12-03 13:34 ` Bert Wesarg
2010-12-06 21:28   ` Bert Wesarg
2010-12-06 21:48 ` Pat Thoyts
2010-12-06 22:17   ` Bert Wesarg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).