{"thread":{"id":"28799","subject":"[PATCH] document 'T' status from git-status","startedAt":"2011-10-30T00:06:44Z","lastAt":"2011-10-31T14:04:21Z","messageCount":5,"participants":["Mark Dominus","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"178516","messageId":"1319933204-21587-1-git-send-email-mjd@plover.com","threadId":"28799","inReplyTo":null,"subject":"[PATCH] document 'T' status from git-status","fromName":"Mark Dominus","fromEmail":"mjd@plover.com","sentAt":"2011-10-30T00:06:44Z","receivedAt":"2011-10-30T00:06:44Z","isPatch":true,"sender":{"key":"mjd@plover.com","avatar":"https://gravatar.com/avatar/a874d23a21a54fc9c5e9d91614219a150bd89c90c1cb0ef970e689f5b88c098b?d=mp&s=160"},"body":"From: Mark Dominus <mjd@icgroup.com>\n\nSigned-off-by: Mark Dominus <mjd@plover.com>\n---\n Documentation/git-status.txt |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex 3d51717..e7fc5c3 100644\n--- a/Documentation/git-status.txt\n+++ b/Documentation/git-status.txt\n@@ -122,6 +122,8 @@ codes can be interpreted as follows:\n * 'R' = renamed\n * 'C' = copied\n * 'U' = updated but unmerged\n+* 'T' = file type changed\n+  (typically from plain file to symlink, or vice versa)\n \n Ignored files are not listed, unless `--ignored` option is in effect,\n in which case `XY` are `!!`.\n@@ -134,9 +136,11 @@ in which case `XY` are `!!`.\n     D         [ M]   deleted from index\n     R        [ MD]   renamed in index\n     C        [ MD]   copied in index\n+    T        [ MD]   file type changed in index\n     [MARC]           index and work tree matches\n     [ MARC]     M    work tree changed since index\n     [ MARC]     D    deleted in work tree\n+    [ MARC]     T    file type changed in work tree\n     -------------------------------------------------\n     D           D    unmerged, both deleted\n     A           U    unmerged, added by us\n-- \n1.7.7.dirty\n"},{"id":"178520","messageId":"7vmxcjro5t.fsf@alter.siamese.dyndns.org","threadId":"28799","inReplyTo":"1319933204-21587-1-git-send-email-mjd@plover.com","subject":"Re: [PATCH] document 'T' status from git-status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-30T06:25:50Z","receivedAt":"2011-10-30T06:25:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Dominus <mjd@plover.com> writes:\n\n> From: Mark Dominus <mjd@icgroup.com>\n>\n> Signed-off-by: Mark Dominus <mjd@plover.com>\n> ---\n>  Documentation/git-status.txt |    4 ++++\n>  1 files changed, 4 insertions(+), 0 deletions(-)\n>\n> diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\n> index 3d51717..e7fc5c3 100644\n> --- a/Documentation/git-status.txt\n> +++ b/Documentation/git-status.txt\n> @@ -122,6 +122,8 @@ codes can be interpreted as follows:\n>  * 'R' = renamed\n>  * 'C' = copied\n>  * 'U' = updated but unmerged\n> +* 'T' = file type changed\n> +  (typically from plain file to symlink, or vice versa)\n>  \n>  Ignored files are not listed, unless `--ignored` option is in effect,\n>  in which case `XY` are `!!`.\n> @@ -134,9 +136,11 @@ in which case `XY` are `!!`.\n>      D         [ M]   deleted from index\n>      R        [ MD]   renamed in index\n>      C        [ MD]   copied in index\n> +    T        [ MD]   file type changed in index\n>      [MARC]           index and work tree matches\n>      [ MARC]     M    work tree changed since index\n>      [ MARC]     D    deleted in work tree\n> +    [ MARC]     T    file type changed in work tree\n\nThe current organization of this table may need to be rethought, but if we\nwere to keep it, then this change is far from sufficient. For example, you\ndo not explain what XY = TT means.\n\n\tSide note. The reason why we do not have two independent tables,\n\tone of which shows \"if X is M then it means updated in index, if X\n\tis A then...\" and the other shows \"if Y is ' ' then index and\n\tworking tree matches, if Y is 'M' then ...\", is because this table\n\tis meant to show _possible_ combinations. For example, the row\n\twith X = D shows that only two possible value for Y are ' ' and M\n\tand A or D are not possible values for Y in that case.\n\nIt may be easier to explain if you treated that 'T' is merely a variant of\n'M' (this comment applies to the first hunk of your patch that starts at\nline 122), i.e.\n\n Documentation/git-status.txt |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex 3d51717..bc2552e 100644\n--- a/Documentation/git-status.txt\n+++ b/Documentation/git-status.txt\n@@ -126,6 +126,10 @@ codes can be interpreted as follows:\n Ignored files are not listed, unless `--ignored` option is in effect,\n in which case `XY` are `!!`.\n \n+Note that a change in filetype (i.e. a regular file to symbolic link or\n+vice versa) is a special case of \"modified\" and shown as 'T' instead of\n+'M'; in the table below an 'M' could be a 'T'.\n+\n     X          Y     Meaning\n     -------------------------------------------------\n               [MD]   not updated\n"},{"id":"178534","messageId":"4EADB4DB.5020004@icgroup.com","threadId":"28799","inReplyTo":"7vmxcjro5t.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] document 'T' status from git-status","fromName":"Mark Dominus","fromEmail":"mjd@icgroup.com","sentAt":"2011-10-30T20:34:35Z","receivedAt":"2011-10-30T20:34:35Z","isPatch":true,"sender":{"key":"mjd@icgroup.com","avatar":null},"body":"On 10/30/2011 02:25 AM, Junio C Hamano wrote:\n> Mark Dominus<mjd@plover.com>  writes:\n>\n>\n>> +* 'T' = file type changed\n>> +  (typically from plain file to symlink, or vice versa)\n>>\n>>   Ignored files are not listed, unless `--ignored` option is in effect,\n>>   in which case `XY` are `!!`.\n>> @@ -134,9 +136,11 @@ in which case `XY` are `!!`.\n>>       D         [ M]   deleted from index\n>>       R        [ MD]   renamed in index\n>>       C        [ MD]   copied in index\n>> +    T        [ MD]   file type changed in index\n>>       [MARC]           index and work tree matches\n>>       [ MARC]     M    work tree changed since index\n>>       [ MARC]     D    deleted in work tree\n>> +    [ MARC]     T    file type changed in work tree\n> The current organization of this table may need to be rethought, but if we\n> were to keep it, then this change is far from sufficient. For example, you\n> do not explain what XY = TT means.\nThanks for your response.\n\nI did not try to document that because in my experimenting I was not \nable to produce that situation.  T occurs when the filetype (as reported \nby the IS_FMT macro) is different between the two files.  On systems I \nhave available, there are essentially five filetypes:  plain file, \nsymlink, directory, block and character devices.  Directories are \nhandled separately and are not reported by git-status.  Device files \ncannot be added to the index at all.  That leaves only two possible \nfiletypes, so of the three files (the committed version, the cached \nversion, and the working tree version) two must be the same.\n\nI am aware that on some systems other filetypes may exist.  For example, \nHPUX has an 'H' filetype that is a variant of a directory.  But git \nwould treat this as a directory.  Since I was not aware of any situation \nin which TT could arise, I did not try to document it.\n\nWill you be applying the alternative patch you suggested, or would you \nprefer that I try to produce one along those lines?\n"},{"id":"178549","messageId":"7vpqhdrdys.fsf@alter.siamese.dyndns.org","threadId":"28799","inReplyTo":"4EADB4DB.5020004@icgroup.com","subject":"Re: [PATCH] document 'T' status from git-status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-31T04:18:19Z","receivedAt":"2011-10-31T04:18:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Dominus <mjd@icgroup.com> writes:\n\n>> The current organization of this table may need to be rethought, but if we\n>> were to keep it, then this change is far from sufficient. For example, you\n>> do not explain what XY = TT means.\n> Thanks for your response.\n>\n> I did not try to document that because in my experimenting I was not\n> able to produce that situation.\n\nIt is trivial if you realize that X is the change between the HEAD and the\nindex, and Y is the change between the index and the working tree. Most\nimportantly, no direct comparison between the HEAD and the working tree\ngets in the picture.\n\n    $ mv COPYING RENAMING\n    $ ln -s RENAMING COPYING\n    $ git add COPYING\n    $ mv RENAMING COPYING\n    $ git status -suno\n    TT COPYING\n\n> Will you be applying the alternative patch you suggested, or would you\n> prefer that I try to produce one along those lines?\n\nI dunno.\n\nAn obvious alternative is to add T next to all occurrences of M in the\ntable where we say \"M is possible\", but unless it is accompanied by an\nexplanation \"T is just a special case of M\", I suspect the resulting\ndescription would be harder to understand than currently is, and as long\nas the reader understands \"T is just a special case of M\", then there\nisn't much point adding T everywhere M appears in the table anyway, so...\n"},{"id":"178562","messageId":"4EAEAAE5.30209@icgroup.com","threadId":"28799","inReplyTo":"7vpqhdrdys.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] document 'T' status from git-status","fromName":"Mark Dominus","fromEmail":"mjd@icgroup.com","sentAt":"2011-10-31T14:04:21Z","receivedAt":"2011-10-31T14:04:21Z","isPatch":true,"sender":{"key":"mjd@icgroup.com","avatar":null},"body":"\n> It is trivial if\n\nYes, it was very stupid of me to miss that.\n\n> I dunno.\n>\n> An obvious alternative is to add T next to all occurrences of M in the\n> table where we say \"M is possible\", but unless it is accompanied by an\n> explanation \"T is just a special case of M\", I suspect the resulting\n> description would be harder to understand than currently is, and as long\n> as the reader understands \"T is just a special case of M\", then there\n> isn't much point adding T everywhere M appears in the table anyway, so...\n\nIf you are suggesting that the patch you gave is preferable to actually \nincluding T in the table, then I agree. Your patch is also better than \nwhat I sent because it includes the unusual word \"filetype\", which the \nuser is likely to search for after seeing it in the git-status output.\n"}]}