{"thread":{"id":"25874","subject":"[PATCH/RFC] git-gui: disable (un)staging for files with typechange flags","startedAt":"2010-11-30T22:21:31Z","lastAt":"2010-12-06T22:17:40Z","messageCount":5,"participants":["Bert Wesarg","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"156902","messageId":"50fc511f363e8b13b9b1a27db71136d262c95f0d.1291155371.git.bert.wesarg@googlemail.com","threadId":"25874","inReplyTo":null,"subject":"[PATCH/RFC] git-gui: disable (un)staging for files with typechange flags","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-11-30T22:21:31Z","receivedAt":"2010-11-30T22:21:31Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"This covers also the case for newly added files in the index. Like this:\n\n    echo bar >foo\n    git add foo\n    rm foo\n    ln -s bar foo\n\nThis will result in an state of AT. And for cases where the type change is\nstaged, and the new type was modified after the staging. Like this (cont.):\n\n    git add foo\n    git commit -mfoo\n    rm foo\n    echo bar >foo\n    git add foo\n    echo baz >foo\n\nWill result in an state of TM for foo.\n\nSigned-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n---\n git-gui.sh |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 38362fa..1bebcf1 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -1993,7 +1993,9 @@ foreach i {\n \t\t{MD {mc \"Staged for commit, missing\"}}\n \n \t\t{_T {mc \"File type changed, not staged\"}}\n+\t\t{AT {mc \"File type changed, old type staged for commit\"}}\n \t\t{T_ {mc \"File type changed, staged\"}}\n+\t\t{TM {mc \"Staged file type change, modification not staged\"}}\n \n \t\t{_O {mc \"Untracked, not staged\"}}\n \t\t{A_ {mc \"Staged for commit\"}}\n@@ -3533,8 +3535,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {\n \t\t\t|| $current_diff_path eq {}\n \t\t\t|| {__} eq $state\n \t\t\t|| {_O} eq $state\n-\t\t\t|| {_T} eq $state\n-\t\t\t|| {T_} eq $state\n+\t\t\t|| [string match {?T} $state]\n+\t\t\t|| [string match {T?} $state]\n \t\t\t|| [has_textconv $current_diff_path]} {\n \t\t\tset s disabled\n \t\t} else {\n-- \n1.7.3.2.1200.ge4bf6\n"},{"id":"157208","messageId":"AANLkTimz-XZQzTygKxQDJ+E6ZJm1+8aZNuKfZ6-AwQh3@mail.gmail.com","threadId":"25874","inReplyTo":"50fc511f363e8b13b9b1a27db71136d262c95f0d.1291155371.git.bert.wesarg@googlemail.com","subject":"Re: [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-12-03T13:34:40Z","receivedAt":"2010-12-03T13:34:40Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"[ Adding Gustaf Hendeby, the author of the first patch to support type changes ]\n\nOn Tue, Nov 30, 2010 at 23:21, Bert Wesarg <bert.wesarg@googlemail.com> wrote:\n> This covers also the case for newly added files in the index. Like this:\n>\n>    echo bar >foo\n>    git add foo\n>    rm foo\n>    ln -s bar foo\n>\n> This will result in an state of AT. And for cases where the type change is\n> staged, and the new type was modified after the staging. Like this (cont.):\n>\n>    git add foo\n>    git commit -mfoo\n>    rm foo\n>    echo bar >foo\n>    git add foo\n>    echo baz >foo\n>\n> Will result in an state of TM for foo.\n>\n> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n> ---\n>  git-gui.sh |    6 ++++--\n>  1 files changed, 4 insertions(+), 2 deletions(-)\n>\n> diff --git a/git-gui.sh b/git-gui.sh\n> index 38362fa..1bebcf1 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -1993,7 +1993,9 @@ foreach i {\n>                {MD {mc \"Staged for commit, missing\"}}\n>\n>                {_T {mc \"File type changed, not staged\"}}\n> +               {AT {mc \"File type changed, old type staged for commit\"}}\n>                {T_ {mc \"File type changed, staged\"}}\n> +               {TM {mc \"Staged file type change, modification not staged\"}}\n>\n>                {_O {mc \"Untracked, not staged\"}}\n>                {A_ {mc \"Staged for commit\"}}\n> @@ -3533,8 +3535,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {\n>                        || $current_diff_path eq {}\n>                        || {__} eq $state\n>                        || {_O} eq $state\n> -                       || {_T} eq $state\n> -                       || {T_} eq $state\n> +                       || [string match {?T} $state]\n> +                       || [string match {T?} $state]\n>                        || [has_textconv $current_diff_path]} {\n>                        set s disabled\n>                } else {\n> --\n> 1.7.3.2.1200.ge4bf6\n>\n>\n"},{"id":"157435","messageId":"AANLkTik9ZSSQ5pXs6wpU6dXGmVTJ=LTY6CQn79Pup9o1@mail.gmail.com","threadId":"25874","inReplyTo":"AANLkTimz-XZQzTygKxQDJ+E6ZJm1+8aZNuKfZ6-AwQh3@mail.gmail.com","subject":"Re: [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-12-06T21:28:12Z","receivedAt":"2010-12-06T21:28:12Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Fri, Dec 3, 2010 at 14:34, Bert Wesarg <bert.wesarg@googlemail.com> wrote:\n> [ Adding Gustaf Hendeby, the author of the first patch to support type changes ]\n>\n> On Tue, Nov 30, 2010 at 23:21, Bert Wesarg <bert.wesarg@googlemail.com> wrote:\n>> This covers also the case for newly added files in the index. Like this:\n>>\n>>    echo bar >foo\n>>    git add foo\n>>    rm foo\n>>    ln -s bar foo\n>>\n>> This will result in an state of AT. And for cases where the type change is\n>> staged, and the new type was modified after the staging. Like this (cont.):\n>>\n>>    git add foo\n>>    git commit -mfoo\n>>    rm foo\n>>    echo bar >foo\n>>    git add foo\n>>    echo baz >foo\n>>\n>> Will result in an state of TM for foo.\n\nThis patch is incomplete. There are more places where the new AT and\nTM states needs to be handled. Please wait for a re-roll.\n\nBert\n"},{"id":"157438","messageId":"87aakiy3lt.fsf@fox.patthoyts.tk","threadId":"25874","inReplyTo":"50fc511f363e8b13b9b1a27db71136d262c95f0d.1291155371.git.bert.wesarg@googlemail.com","subject":"Re: [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2010-12-06T21:48:46Z","receivedAt":"2010-12-06T21:48:46Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Bert Wesarg <bert.wesarg@googlemail.com> writes:\n\n>This covers also the case for newly added files in the index. Like this:\n>\n>    echo bar >foo\n>    git add foo\n>    rm foo\n>    ln -s bar foo\n>\n>This will result in an state of AT. And for cases where the type change is\n>staged, and the new type was modified after the staging. Like this (cont.):\n>\n>    git add foo\n>    git commit -mfoo\n>    rm foo\n>    echo bar >foo\n>    git add foo\n>    echo baz >foo\n>\n>Will result in an state of TM for foo.\n>\n>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>---\n> git-gui.sh |    6 ++++--\n> 1 files changed, 4 insertions(+), 2 deletions(-)\n>\n>diff --git a/git-gui.sh b/git-gui.sh\n>index 38362fa..1bebcf1 100755\n>--- a/git-gui.sh\n>+++ b/git-gui.sh\n>@@ -1993,7 +1993,9 @@ foreach i {\n> \t\t{MD {mc \"Staged for commit, missing\"}}\n> \n> \t\t{_T {mc \"File type changed, not staged\"}}\n>+\t\t{AT {mc \"File type changed, old type staged for commit\"}}\n> \t\t{T_ {mc \"File type changed, staged\"}}\n>+\t\t{TM {mc \"Staged file type change, modification not staged\"}}\n> \n> \t\t{_O {mc \"Untracked, not staged\"}}\n> \t\t{A_ {mc \"Staged for commit\"}}\n>@@ -3533,8 +3535,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {\n> \t\t\t|| $current_diff_path eq {}\n> \t\t\t|| {__} eq $state\n> \t\t\t|| {_O} eq $state\n>-\t\t\t|| {_T} eq $state\n>-\t\t\t|| {T_} eq $state\n>+\t\t\t|| [string match {?T} $state]\n>+\t\t\t|| [string match {T?} $state]\n> \t\t\t|| [has_textconv $current_diff_path]} {\n> \t\t\tset s disabled\n> \t\t} else {\n\nThis seems fine. We do get a warning about an 'unhandled 2 way diff\nmarker' when it bumps into the second 'diff --git a/foo b/foo' section\nbut I'm not sure anything can be safely done about that.\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"},{"id":"157440","messageId":"AANLkTikTY-KsB6zgf0MZJDDr8dCMB1VUQh4pvrvgSLud@mail.gmail.com","threadId":"25874","inReplyTo":"87aakiy3lt.fsf@fox.patthoyts.tk","subject":"Re: [PATCH/RFC] git-gui: disable (un)staging for files with typechange flags","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-12-06T22:17:40Z","receivedAt":"2010-12-06T22:17:40Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Mon, Dec 6, 2010 at 22:48, Pat Thoyts\n<patthoyts@users.sourceforge.net> wrote:\n> Bert Wesarg <bert.wesarg@googlemail.com> writes:\n>\n>>This covers also the case for newly added files in the index. Like this:\n>>\n>>    echo bar >foo\n>>    git add foo\n>>    rm foo\n>>    ln -s bar foo\n>>\n>>This will result in an state of AT. And for cases where the type change is\n>>staged, and the new type was modified after the staging. Like this (cont.):\n>>\n>>    git add foo\n>>    git commit -mfoo\n>>    rm foo\n>>    echo bar >foo\n>>    git add foo\n>>    echo baz >foo\n>>\n>>Will result in an state of TM for foo.\n>>\n>>Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>>---\n>> git-gui.sh |    6 ++++--\n>> 1 files changed, 4 insertions(+), 2 deletions(-)\n>>\n>>diff --git a/git-gui.sh b/git-gui.sh\n>>index 38362fa..1bebcf1 100755\n>>--- a/git-gui.sh\n>>+++ b/git-gui.sh\n>>@@ -1993,7 +1993,9 @@ foreach i {\n>>               {MD {mc \"Staged for commit, missing\"}}\n>>\n>>               {_T {mc \"File type changed, not staged\"}}\n>>+              {AT {mc \"File type changed, old type staged for commit\"}}\n>>               {T_ {mc \"File type changed, staged\"}}\n>>+              {TM {mc \"Staged file type change, modification not staged\"}}\n>>\n>>               {_O {mc \"Untracked, not staged\"}}\n>>               {A_ {mc \"Staged for commit\"}}\n>>@@ -3533,8 +3535,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {\n>>                       || $current_diff_path eq {}\n>>                       || {__} eq $state\n>>                       || {_O} eq $state\n>>-                      || {_T} eq $state\n>>-                      || {T_} eq $state\n>>+                      || [string match {?T} $state]\n>>+                      || [string match {T?} $state]\n>>                       || [has_textconv $current_diff_path]} {\n>>                       set s disabled\n>>               } else {\n>\n> This seems fine. We do get a warning about an 'unhandled 2 way diff\n> marker' when it bumps into the second 'diff --git a/foo b/foo' section\n> but I'm not sure anything can be safely done about that.\n\nWe had this before, and you have proposed a fix for that (\"git-gui:\nhandle symlink replaced by file\"). But as I wrote I have a better and\nnicer solution to that specific problem.\n\nBert\n\n> --\n> Pat Thoyts                            http://www.patthoyts.tk/\n> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n>\n>\n"}]}