From: Pat Thoyts <patthoyts@users.sourceforge.net>
To: Bert Wesarg <bert.wesarg@googlemail.com>
Cc: "Shawn O. Pearce" <spearce@spearce.org>, git@vger.kernel.org
Subject: Re: [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags
Date: Mon, 06 Dec 2010 21:48:46 +0000 [thread overview]
Message-ID: <87aakiy3lt.fsf@fox.patthoyts.tk> (raw)
In-Reply-To: <50fc511f363e8b13b9b1a27db71136d262c95f0d.1291155371.git.bert.wesarg@googlemail.com> (Bert Wesarg's message of "Tue, 30 Nov 2010 23:21:31 +0100")
Bert Wesarg <bert.wesarg@googlemail.com> writes:
>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 {
This seems fine. We do get a warning about an 'unhandled 2 way diff
marker' when it bumps into the second 'diff --git a/foo b/foo' section
but I'm not sure anything can be safely done about that.
--
Pat Thoyts http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
next prev parent reply other threads:[~2010-12-06 21:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2010-12-06 22:17 ` Bert Wesarg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87aakiy3lt.fsf@fox.patthoyts.tk \
--to=patthoyts@users.sourceforge.net \
--cc=bert.wesarg@googlemail.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.