{"thread":{"id":"56634","subject":"[PATCH 1/2] Documentation/diff-format: state in which cases porcelain status is T","startedAt":"2021-10-02T21:31:17Z","lastAt":"2021-10-06T06:05:01Z","messageCount":16,"participants":["Johannes Altmanninger","Elijah Newren","Junio C Hamano","Bagas Sanjaya"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"437791","messageId":"20211002213046.725892-1-aclopte@gmail.com","threadId":"56634","inReplyTo":null,"subject":"[PATCH 1/2] Documentation/diff-format: state in which cases porcelain status is T","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-02T21:30:45Z","receivedAt":"2021-10-02T21:31:17Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"Porcelain status letter T is documented as \"type of the file\", which\nis technically correct but not enough information for users that are\nnot so familiar with this term from systems programming. In particular,\ngiven that the only supported file types are regular files and symbolic\nlinks, the term \"file type\" is surely opaque to the many(?) users who\nare not aware that symbolic links can be tracked - I thought that a\n\"chmod +x\" would result in a T status (wrong, it's M).\n\nExplicitly document the three file types (including submodules).\nThis makes life easier for tool authors, but has potential to go\nout of date if a new type is ever added. We could avoid this with a\ntargeted test, or by using a reStructuredText directive to include the\nlist of file types from a single source.  Probably not worth it. The\nnext patch will copy this snippet to git-status.txt though.\n\nSigned-off-by: Johannes Altmanninger <aclopte@gmail.com>\n---\n\n(The implementation calls the third type \"gitlink\" but for users that's\nalways a submodule, AFAICT)\n\n Documentation/diff-format.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\nindex fbbd410a84..7a9c3b6ff4 100644\n--- a/Documentation/diff-format.txt\n+++ b/Documentation/diff-format.txt\n@@ -59,7 +59,7 @@ Possible status letters are:\n - D: deletion of a file\n - M: modification of the contents or mode of a file\n - R: renaming of a file\n-- T: change in the type of the file\n+- T: change in the type of the file (regular file, symbolic link or submodule)\n - U: file is unmerged (you must complete the merge before it can\n   be committed)\n - X: \"unknown\" change type (most probably a bug, please report it)\n-- \n2.33.0.rc2.dirty\n\n"},{"id":"437792","messageId":"20211002213046.725892-2-aclopte@gmail.com","threadId":"56634","inReplyTo":"20211002213046.725892-1-aclopte@gmail.com","subject":"[PATCH 2/2] Documentation/git-status: document porcelain status T (typechange)","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-02T21:30:46Z","receivedAt":"2021-10-02T21:31:17Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"As reported in [1], T is missing from the description of porcelain\nstatus letters in git-status(1) (whereas T is documented in\ngit-diff-files(1) and friends). Document T right after M (modified)\nbecause the two are very similar.\n\nA porcelain status containing C (copied) is impossible because \"git\nstatus\" does not detect copies, only renames. I was going to delete\nmentions of C from git-status.txt because it keeps confusing users [2]\nbut a discussion from 2014 suggests that \"git status\" should re-learn\nto detect copies, which was disabled in 2005 for (obsolete) performance\nreasons [3].\n\n[1] https://github.com/fish-shell/fish-shell/issues/8311\n[2] https://www.reddit.com/r/git/comments/ppc2l9/how_to_get_a_file_with_copied_status/\n[3] https://marc.info/?l=git&m=141755095826447&w=2\n\nSigned-off-by: Johannes Altmanninger <aclopte@gmail.com>\n---\n Documentation/git-status.txt | 17 ++++++++++-------\n 1 file changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex 83f38e3198..40f308c6a6 100644\n--- a/Documentation/git-status.txt\n+++ b/Documentation/git-status.txt\n@@ -207,6 +207,7 @@ show tracked paths:\n \n * ' ' = unmodified\n * 'M' = modified\n+* 'T' = file type changed (regular file, symbolic link or submodule)\n * 'A' = added\n * 'D' = deleted\n * 'R' = renamed\n@@ -217,14 +218,16 @@ show tracked paths:\n X          Y     Meaning\n -------------------------------------------------\n \t [AMD]   not updated\n-M        [ MD]   updated in index\n-A        [ MD]   added to index\n+M        [ MTD]  updated in index\n+T        [ MTD]  type changed in index\n+A        [ MTD]  added to index\n D                deleted from index\n-R        [ MD]   renamed in index\n-C        [ MD]   copied 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+R        [ MTD]  renamed in index\n+C        [ MTD]  copied in index\n+[MTARC]          index and work tree matches\n+[ MTARC]    M    work tree changed since index\n+[ MTARC]    T    type changed in work tree since index\n+[ MTARC]    D    deleted in work tree\n [ D]        R    renamed in work tree\n [ D]        C    copied in work tree\n -------------------------------------------------\n-- \n2.33.0.rc2.dirty\n\n"},{"id":"437793","messageId":"20211002213314.kvc27qsbi7q42n6s@gmail.com","threadId":"56634","inReplyTo":"20211002213046.725892-2-aclopte@gmail.com","subject":"Re: [PATCH 2/2] Documentation/git-status: document porcelain status T (typechange)","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-02T21:33:14Z","receivedAt":"2021-10-02T21:33:20Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"In case anyone is curious and lazy, here is a script that generates all\npossible status letters containing T:\n\n#!/bin/sh\n\nset -e\n\n_T() {\n\ttouch file-1.T\n\tgit add file-1.T\n\tgit commit -q -m add\n\trm file-1.T\n\tln -s /dev/null file-1.T\n}\n\nMT() {\n\ttouch file-1MT\n\tgit add file-1MT\n\tgit commit -q -m add\n\techo modify > file-1MT\n\tgit add file-1MT\n\tln -sf /dev/null file-1MT\n}\n\nTM() {\n\tln -sf /dev/null file-1TM\n\tgit add file-1TM\n\tgit commit -q -m add\n\trm file-1TM\n\ttouch file-1TM\n\tgit add file-1TM\n\techo modify > file-1TM\n}\n\nTT() {\n\ttouch file-1TT\n\tgit add file-1TT\n\tgit commit -q -m add\n\tln -sf /dev/null file-1TT\n\tgit add file-1TT\n\trm file-1TT\n\ttouch file-1TT\n}\n\nTD() {\n\ttouch file-1TD\n\tgit add file-1TD\n\tgit commit -q -m add\n\tln -sf /dev/null file-1TD\n\tgit add file-1TD\n\trm file-1TD\n}\n\nAT() {\n\ttouch file-1AT\n\tgit add file-1AT\n\tgit commit -q -m add\n\tln -sf /dev/null file-1AT\n}\n\nRT() {\n\ttouch file-2RT\n\tgit add file-2RT\n\tgit commit -q -m add\n\tgit mv file-2RT new-file-2RT\n\tln -sf /dev/null new-file-2RT\n}\n\nT_() {\n\ttouch file-1T.\n\tgit add file-1T.\n\tgit commit -q -m add\n\tln -sf /dev/null file-1T.\n\tgit add file-1T.\n}\n\ncd \"$(mktemp -d)\"\ngit init -q\ngit commit -q --allow-empty -m initial\\ commit\n\nfor state in _T MT TM TT TD AT RT T_\ndo\n\tgit reset -q --hard :/initial.commit\n\t\"$state\"\n\tgit status --porcelain=2\ndone\n"},{"id":"437795","messageId":"CABPp-BFqJi0q0844NKfU8K5HRpAJ7yP2OkyBUiFQSAw-ZjNoyw@mail.gmail.com","threadId":"56634","inReplyTo":"20211002213046.725892-2-aclopte@gmail.com","subject":"Re: [PATCH 2/2] Documentation/git-status: document porcelain status T (typechange)","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2021-10-02T23:29:52Z","receivedAt":"2021-10-02T23:30:08Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sat, Oct 2, 2021 at 2:38 PM Johannes Altmanninger <aclopte@gmail.com> wrote:\n>\n> As reported in [1], T is missing from the description of porcelain\n> status letters in git-status(1) (whereas T is documented in\n> git-diff-files(1) and friends). Document T right after M (modified)\n> because the two are very similar.\n\nGood; thanks for sending this in.\n\n> A porcelain status containing C (copied) is impossible because \"git\n> status\" does not detect copies, only renames.\n\nThis is no true (since ~2018); here's an example:\n\n    $ cp -a README.md README-copy\n    $ echo garbage >>README.md\n    $ git add README-copy README.md\n    $ git -c status.renames=copy status --porcelain\n    C  README.md -> README-copy\n    M  README.md\n\nYou can also use diff.renames instead of status.renames, since the\nlatter defaults to the former.  Note that you do need to both modify\nand stage README.md in the example above to see the copy status.\n\n> I was going to delete\n> mentions of C from git-status.txt because it keeps confusing users [2]\n> but a discussion from 2014 suggests that \"git status\" should re-learn\n> to detect copies, which was disabled in 2005 for (obsolete) performance\n> reasons [3].\n\nThat thread you refer to suggests it was turned off because copy\ndetection meant the equivalent of find-copies-harder, and that thread\nalso provided numbers showing find-copies-harder would still be very\npainful performance-wise.  Perhaps the \"obsolete performance reasons\"\nwas meant to imply that basic copy detection is cheaper since it does\nsomething different today than what status's copy detection did back\nthen, but summarizing this as \"obsolete performance reasons\" feels\nmisleading to me.\n\n> [1] https://github.com/fish-shell/fish-shell/issues/8311\n> [2] https://www.reddit.com/r/git/comments/ppc2l9/how_to_get_a_file_with_copied_status/\n> [3] https://marc.info/?l=git&m=141755095826447&w=2\n\nLinks to lore.kernel.org would be much preferred to marc.info links;\nhere that would be\nhttps://lore.kernel.org/git/20141202200910.GB23461@peff.net/.\n\nThe lore.kernel.org links provide an interface to easily search for\nother mailing list messages, and use the Message-ID in the URL which\nmakes it easier for people to find the message in other locations,\netc.\n\n> Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>\n> ---\n>  Documentation/git-status.txt | 17 ++++++++++-------\n>  1 file changed, 10 insertions(+), 7 deletions(-)\n>\n> diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\n> index 83f38e3198..40f308c6a6 100644\n> --- a/Documentation/git-status.txt\n> +++ b/Documentation/git-status.txt\n> @@ -207,6 +207,7 @@ show tracked paths:\n>\n>  * ' ' = unmodified\n>  * 'M' = modified\n> +* 'T' = file type changed (regular file, symbolic link or submodule)\n>  * 'A' = added\n>  * 'D' = deleted\n>  * 'R' = renamed\n> @@ -217,14 +218,16 @@ show tracked paths:\n>  X          Y     Meaning\n>  -------------------------------------------------\n>          [AMD]   not updated\n> -M        [ MD]   updated in index\n> -A        [ MD]   added to index\n> +M        [ MTD]  updated in index\n> +T        [ MTD]  type changed in index\n> +A        [ MTD]  added to index\n>  D                deleted from index\n> -R        [ MD]   renamed in index\n> -C        [ MD]   copied 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> +R        [ MTD]  renamed in index\n> +C        [ MTD]  copied in index\n> +[MTARC]          index and work tree matches\n> +[ MTARC]    M    work tree changed since index\n> +[ MTARC]    T    type changed in work tree since index\n> +[ MTARC]    D    deleted in work tree\n\nLooks good up to here.\n\n>  [ D]        R    renamed in work tree\n>  [ D]        C    copied in work tree\n\nThis wasn't something you added; it appears these two came from commit\n176ea74793 (\"wt-status.c: handle worktree renames\", 2017-12-27).\nHowever, I don't think the 'D' part of these examples is possible.  If\na file is deleted in the index relative to HEAD (what the 'D' means),\nthen comparing the index to the worktree means the file didn't even\nexist in the index.  Thus no delete pair for that file will be passed\nto diffcore-rename, and without a delete pair for some file, there is\nnothing for the add pairs to be combined with to create a rename or\ncopy pair.  So these lines are misleading and should only have a space\nin the first column rather than either a space or 'D'.\n\nThat said, of course, since this wasn't caused by your patch, you are\nunder no obligation to fix.  It would go nicely with your series,\nthough.  Would you like to add another patch to your series to fix\nthat, or would you rather that I contributed such a patch separately?\n\nThanks for the contribution!\n"},{"id":"437796","messageId":"CABPp-BFyNamEVkEZsEhY9w3yCHg4uU-hkuHjvzj-BoGtvDBFZg@mail.gmail.com","threadId":"56634","inReplyTo":"20211002213046.725892-1-aclopte@gmail.com","subject":"Re: [PATCH 1/2] Documentation/diff-format: state in which cases porcelain status is T","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2021-10-02T23:35:43Z","receivedAt":"2021-10-02T23:36:05Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sat, Oct 2, 2021 at 2:38 PM Johannes Altmanninger <aclopte@gmail.com> wrote:\n>\n> Porcelain status letter T is documented as \"type of the file\", which\n> is technically correct but not enough information for users that are\n> not so familiar with this term from systems programming. In particular,\n> given that the only supported file types are regular files and symbolic\n> links,\n\nand submodules (though users aren't likely to think of that as a \"file\" type)\n\n> the term \"file type\" is surely opaque to the many(?) users who\n> are not aware that symbolic links can be tracked - I thought that a\n> \"chmod +x\" would result in a T status (wrong, it's M).\n\nHeh, I've probably made that mistake before...and I was actually\nthinking of exactly that case while reading this commit message.  Just\ngoes to show that I'm prone to repeat my mistakes.  Anyway, I'm glad\nyou discussed the executable bit case in the commit message.\n\n> Explicitly document the three file types (including submodules).\n> This makes life easier for tool authors, but has potential to go\n> out of date if a new type is ever added. We could avoid this with a\n> targeted test, or by using a reStructuredText directive to include the\n> list of file types from a single source.  Probably not worth it. The\n> next patch will copy this snippet to git-status.txt though.\n>\n> Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>\n> ---\n>\n> (The implementation calls the third type \"gitlink\" but for users that's\n> always a submodule, AFAICT)\n>\n>  Documentation/diff-format.txt | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\n> index fbbd410a84..7a9c3b6ff4 100644\n> --- a/Documentation/diff-format.txt\n> +++ b/Documentation/diff-format.txt\n> @@ -59,7 +59,7 @@ Possible status letters are:\n>  - D: deletion of a file\n>  - M: modification of the contents or mode of a file\n>  - R: renaming of a file\n> -- T: change in the type of the file\n> +- T: change in the type of the file (regular file, symbolic link or submodule)\n>  - U: file is unmerged (you must complete the merge before it can\n>    be committed)\n>  - X: \"unknown\" change type (most probably a bug, please report it)\n> --\n> 2.33.0.rc2.dirty\n\nThanks, this change looks good to me, modulo the tiny comment on the\ncommit message about submodules being another file type.\n"},{"id":"437933","messageId":"20211004185741.rktidu2ptn4v5kll@gmail.com","threadId":"56634","inReplyTo":"CABPp-BFqJi0q0844NKfU8K5HRpAJ7yP2OkyBUiFQSAw-ZjNoyw@mail.gmail.com","subject":"Re: [PATCH 2/2] Documentation/git-status: document porcelain status T (typechange)","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-04T18:57:41Z","receivedAt":"2021-10-04T18:57:47Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"Thanks for the review, I'll send v2 which addresses comments and makes some\nminor hanges to the commit messages.\n\nOn Sat, Oct 02, 2021 at 04:29:52PM -0700, Elijah Newren wrote:\n> > A porcelain status containing C (copied) is impossible because \"git\n> > status\" does not detect copies, only renames.\n> \n> This is no true (since ~2018); here's an example:\n\nAh my bad. Turns out skimming git-status(1) was not enough.  I added patch\n4/4 to make that easier (or at least document that it *is* possible).\n\n> \n>     $ cp -a README.md README-copy\n>     $ echo garbage >>README.md\n>     $ git add README-copy README.md\n>     $ git -c status.renames=copy status --porcelain\n>     C  README.md -> README-copy\n>     M  README.md\n> \n> You can also use diff.renames instead of status.renames, since the\n> latter defaults to the former.  Note that you do need to both modify\n> and stage README.md in the example above to see the copy status.\n\nWow yeah, this is quite a special case.\n\n> \n> > I was going to delete\n> > mentions of C from git-status.txt because it keeps confusing users [2]\n> > but a discussion from 2014 suggests that \"git status\" should re-learn\n> > to detect copies, which was disabled in 2005 for (obsolete) performance\n> > reasons [3].\n> \n> That thread you refer to suggests it was turned off because copy\n> detection meant the equivalent of find-copies-harder, and that thread\n> also provided numbers showing find-copies-harder would still be very\n> painful performance-wise.  Perhaps the \"obsolete performance reasons\"\n> was meant to imply that basic copy detection is cheaper since it does\n> something different today than what status's copy detection did back\n> then, but summarizing this as \"obsolete performance reasons\" feels\n> misleading to me.\n\nRight, I should have acknowledged the change to copy detection.\n\n> \n> Links to lore.kernel.org would be much preferred to marc.info links;\n> here that would be\n> https://lore.kernel.org/git/20141202200910.GB23461@peff.net/.\n> \n> The lore.kernel.org links provide an interface to easily search for\n> other mailing list messages, and use the Message-ID in the URL which\n> makes it easier for people to find the message in other locations,\n> etc.\n\ngot it\n\n> \n> >  [ D]        R    renamed in work tree\n> >  [ D]        C    copied in work tree\n> \n> This wasn't something you added; it appears these two came from commit\n> 176ea74793 (\"wt-status.c: handle worktree renames\", 2017-12-27).\n> However, I don't think the 'D' part of these examples is possible.  If\n> a file is deleted in the index relative to HEAD (what the 'D' means),\n> then comparing the index to the worktree means the file didn't even\n> exist in the index.  Thus no delete pair for that file will be passed\n> to diffcore-rename, and without a delete pair for some file, there is\n> nothing for the add pairs to be combined with to create a rename or\n> copy pair.  So these lines are misleading and should only have a space\n> in the first column rather than either a space or 'D'.\n> \n> That said, of course, since this wasn't caused by your patch, you are\n> under no obligation to fix.  It would go nicely with your series,\n> though.  Would you like to add another patch to your series to fix\n> that, or would you rather that I contributed such a patch separately?\n\nOk I've added patch 1/4\n"},{"id":"437934","messageId":"20211004190050.921109-1-aclopte@gmail.com","threadId":"56634","inReplyTo":"CABPp-BFqJi0q0844NKfU8K5HRpAJ7yP2OkyBUiFQSAw-ZjNoyw@mail.gmail.com","subject":"[PATCH v2 1/4] Documentation/git-status: remove impossible porcelain status DR and DC","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-04T19:00:47Z","receivedAt":"2021-10-04T19:01:22Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"Commit 176ea74793 (\"wt-status.c: handle worktree renames\", 2017-12-27)\nmade a porcelain status like .R or .C possible. They occur only when\nthe source file is added to the index and the destination file is\nadded with --intent-to-add.\n\nThey also documented DR, but that status is impossible.  The index\nchange D means that the source file does not exist in the index.\nThe worktree change R/C states that the file has been renamed/copied\nsince the index, but that's impossible if it did not exist there.\n\nReported-by: Elijah Newren <newren@gmail.com>\nSigned-off-by: Johannes Altmanninger <aclopte@gmail.com>\n---\n Documentation/git-status.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\n(the diff looks off by one column but that's just because we use tabs for indentation)\n\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex 83f38e3198..20f496094a 100644\n--- a/Documentation/git-status.txt\n+++ b/Documentation/git-status.txt\n@@ -225,8 +225,8 @@ C        [ MD]   copied 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-[ D]        R    renamed in work tree\n-[ D]        C    copied in work tree\n+\t    R    renamed in work tree\n+\t    C    copied in work tree\n -------------------------------------------------\n D           D    unmerged, both deleted\n A           U    unmerged, added by us\n-- \n2.33.0.rc2.dirty\n\n"},{"id":"437935","messageId":"20211004190050.921109-2-aclopte@gmail.com","threadId":"56634","inReplyTo":"20211004190050.921109-1-aclopte@gmail.com","subject":"[PATCH v2 2/4] Documentation/diff-format: state in which cases porcelain status is T","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-04T19:00:48Z","receivedAt":"2021-10-04T19:01:32Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"Porcelain status letter T is documented as \"type of the file\", which\nis technically correct but not enough information for users that are\nnot so familiar with this term from systems programming. In particular,\ngiven that the only supported file types are \"regular file\", \"symbolic\nlink\" and \"submodule\", the term \"file type\" is surely opaque to the\nmany(?) users who are not aware that symbolic links can be tracked -\nI thought that a \"chmod +x\" could cause the T status (wrong, it's M).\n\nExplicitly document the three file types so users know if/how they\nwant to handle this.\n\nSigned-off-by: Johannes Altmanninger <aclopte@gmail.com>\n---\n Documentation/diff-format.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\nindex fbbd410a84..7a9c3b6ff4 100644\n--- a/Documentation/diff-format.txt\n+++ b/Documentation/diff-format.txt\n@@ -59,7 +59,7 @@ Possible status letters are:\n - D: deletion of a file\n - M: modification of the contents or mode of a file\n - R: renaming of a file\n-- T: change in the type of the file\n+- T: change in the type of the file (regular file, symbolic link or submodule)\n - U: file is unmerged (you must complete the merge before it can\n   be committed)\n - X: \"unknown\" change type (most probably a bug, please report it)\n-- \n2.33.0.rc2.dirty\n\n"},{"id":"437936","messageId":"20211004190050.921109-3-aclopte@gmail.com","threadId":"56634","inReplyTo":"20211004190050.921109-1-aclopte@gmail.com","subject":"[PATCH v2 3/4] Documentation/git-status: document porcelain status T (typechange)","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-04T19:00:49Z","receivedAt":"2021-10-04T19:01:34Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"As reported in [1], T is missing from the description of porcelain\nstatus letters in git-status(1) (whereas T *is* documented in\ngit-diff-files(1) and friends). Document T right after M (modified)\nbecause the two are very similar.\n\n[1] https://github.com/fish-shell/fish-shell/issues/8311\n\nSigned-off-by: Johannes Altmanninger <aclopte@gmail.com>\n---\n Documentation/git-status.txt | 17 ++++++++++-------\n 1 file changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex 20f496094a..255dc6af9b 100644\n--- a/Documentation/git-status.txt\n+++ b/Documentation/git-status.txt\n@@ -207,6 +207,7 @@ show tracked paths:\n \n * ' ' = unmodified\n * 'M' = modified\n+* 'T' = file type changed (regular file, symbolic link or submodule)\n * 'A' = added\n * 'D' = deleted\n * 'R' = renamed\n@@ -217,14 +218,16 @@ show tracked paths:\n X          Y     Meaning\n -------------------------------------------------\n \t [AMD]   not updated\n-M        [ MD]   updated in index\n-A        [ MD]   added to index\n+M        [ MTD]  updated in index\n+T        [ MTD]  type changed in index\n+A        [ MTD]  added to index\n D                deleted from index\n-R        [ MD]   renamed in index\n-C        [ MD]   copied 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+R        [ MTD]  renamed in index\n+C        [ MTD]  copied in index\n+[MTARC]          index and work tree matches\n+[ MTARC]    M    work tree changed since index\n+[ MTARC]    T    type changed in work tree since index\n+[ MTARC]    D    deleted in work tree\n \t    R    renamed in work tree\n \t    C    copied in work tree\n -------------------------------------------------\n-- \n2.33.0.rc2.dirty\n\n"},{"id":"437937","messageId":"20211004190050.921109-4-aclopte@gmail.com","threadId":"56634","inReplyTo":"20211004190050.921109-1-aclopte@gmail.com","subject":"[PATCH v2 4/4] Documentation/git-status: mention how to detect copies","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-04T19:00:50Z","receivedAt":"2021-10-04T19:01:38Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"The man page documents that git-status can find copies, but does not\nmention how. Whereas git-diff has command line options -C, there is\nno such option for git-status - it will only detect copies when the\n\"status.renames\" config option is \"copies\" or \"copy\". Document that\nin git-status.txt because this has confused me and others[1].\n\n[1]: https://www.reddit.com/r/git/comments/ppc2l9/how_to_get_a_file_with_copied_status/\n\nSigned-off-by: Johannes Altmanninger <aclopte@gmail.com>\n---\n Documentation/git-status.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex 255dc6af9b..8f959afa0f 100644\n--- a/Documentation/git-status.txt\n+++ b/Documentation/git-status.txt\n@@ -211,7 +211,7 @@ show tracked paths:\n * 'A' = added\n * 'D' = deleted\n * 'R' = renamed\n-* 'C' = copied\n+* 'C' = copied (if config option status.renames is set to \"copies\")\n * 'U' = updated but unmerged\n \n ....\n-- \n2.33.0.rc2.dirty\n\n"},{"id":"437940","messageId":"xmqq8rz8wobi.fsf@gitster.g","threadId":"56634","inReplyTo":"20211004190050.921109-1-aclopte@gmail.com","subject":"Re: [PATCH v2 1/4] Documentation/git-status: remove impossible porcelain status DR and DC","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-10-04T20:02:41Z","receivedAt":"2021-10-04T20:02:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Altmanninger <aclopte@gmail.com> writes:\n\n> diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\n> index 83f38e3198..20f496094a 100644\n> --- a/Documentation/git-status.txt\n> +++ b/Documentation/git-status.txt\n> @@ -225,8 +225,8 @@ C        [ MD]   copied 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> -[ D]        R    renamed in work tree\n> -[ D]        C    copied in work tree\n> +\t    R    renamed in work tree\n> +\t    C    copied in work tree\n\nI do not see lines with horizontal tabs used in exiting entries to\nskip to columns.  Perhaps these two lines should follow suit.\n\n>  -------------------------------------------------\n>  D           D    unmerged, both deleted\n>  A           U    unmerged, added by us\n"},{"id":"437942","messageId":"xmqq4k9wwnvh.fsf@gitster.g","threadId":"56634","inReplyTo":"xmqq8rz8wobi.fsf@gitster.g","subject":"Re: [PATCH v2 1/4] Documentation/git-status: remove impossible porcelain status DR and DC","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-10-04T20:12:18Z","receivedAt":"2021-10-04T20:12:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Johannes Altmanninger <aclopte@gmail.com> writes:\n>\n>> diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\n>> index 83f38e3198..20f496094a 100644\n>> --- a/Documentation/git-status.txt\n>> +++ b/Documentation/git-status.txt\n>> @@ -225,8 +225,8 @@ C        [ MD]   copied 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>> -[ D]        R    renamed in work tree\n>> -[ D]        C    copied in work tree\n>> +\t    R    renamed in work tree\n>> +\t    C    copied in work tree\n>\n> I do not see lines with horizontal tabs used in exiting entries to\n> skip to columns.  Perhaps these two lines should follow suit.\n\nNah, there is one before the pre-context of this hunk.  I guess it\nis OK, and certainly would not need a reroll for it.\n\nThanks.\n"},{"id":"437965","messageId":"31f46980-7e40-46c0-87b7-f5ea7034af2b@gmail.com","threadId":"56634","inReplyTo":"20211004190050.921109-4-aclopte@gmail.com","subject":"Re: [PATCH v2 4/4] Documentation/git-status: mention how to detect copies","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-10-05T09:48:00Z","receivedAt":"2021-10-05T09:48:06Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On 05/10/21 02.00, Johannes Altmanninger wrote:\n> @@ -211,7 +211,7 @@ show tracked paths:\n>   * 'A' = added\n>   * 'D' = deleted\n>   * 'R' = renamed\n> -* 'C' = copied\n> +* 'C' = copied (if config option status.renames is set to \"copies\")\n>   * 'U' = updated but unmerged\n>   \n>   ....\n> \n\nThe config name and value can be formatted to monospace \n(\"`status.renames`\" and \"`copies`\" respectively).\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"437998","messageId":"20211005194224.qcblxih5rlehzo4d@gmail.com","threadId":"56634","inReplyTo":"31f46980-7e40-46c0-87b7-f5ea7034af2b@gmail.com","subject":"Re: [PATCH v2 4/4] Documentation/git-status: mention how to detect copies","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-10-05T19:42:24Z","receivedAt":"2021-10-05T19:42:30Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"On Tue, Oct 05, 2021 at 04:48:00PM +0700, Bagas Sanjaya wrote:\n> On 05/10/21 02.00, Johannes Altmanninger wrote:\n> > -* 'C' = copied\n> > +* 'C' = copied (if config option status.renames is set to \"copies\")\n> \n> The config name and value can be formatted to monospace (\"`status.renames`\"\n> and \"`copies`\" respectively).\n\nI wasn't sure whether to add backticks to status.renames because we are\nalready inconsistent in this file (search for \"config option\").\nAnyway I agree that backticks look better here (makes it bold in the man page).\n\nMaybe we should automate this? We can write a test that makes sure that we\nalways use backticks around config keys, at least for new changes.\n\n---\n\nI didn't add backticks to \"copies\" to be consistent with this part before the context\n\n\tIgnore changes to submodules when looking for changes. <when> can be\n\teither \"none\", \"untracked\", \"dirty\" or \"all\", which is the default.\n"},{"id":"438022","messageId":"88adcdf1-7b10-c834-84ad-52fe273c0ced@gmail.com","threadId":"56634","inReplyTo":"20211005194224.qcblxih5rlehzo4d@gmail.com","subject":"Re: [PATCH v2 4/4] Documentation/git-status: mention how to detect copies","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-10-06T05:05:02Z","receivedAt":"2021-10-06T05:05:09Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On 06/10/21 02.42, Johannes Altmanninger wrote:\n> I wasn't sure whether to add backticks to status.renames because we are\n> already inconsistent in this file (search for \"config option\").\n> Anyway I agree that backticks look better here (makes it bold in the man page).\n> \n> Maybe we should automate this? We can write a test that makes sure that we\n> always use backticks around config keys, at least for new changes.\n> \n> ---\n> \n> I didn't add backticks to \"copies\" to be consistent with this part before the context\n> \n> \tIgnore changes to submodules when looking for changes. <when> can be\n> \teither \"none\", \"untracked\", \"dirty\" or \"all\", which is the default.\n> \n\nI think for consistency, we can go with automated style changes that use \nbackticks to monospace:\n     - file name and paths\n     - daemons/services\n     - configuration names and values\n     - file content (use ```...``` block unless inline)\n     - command-line\n     - keyboard keys (dunno?)\n     - any other inline text that needs to be written exactly\n\nI have seen many times articles that say `Run \"foo bar\" (no quotes)` \nwhen they mean `Run `foo bar``.\n\nFor the exception you mentioned above it can be monospaced as part of \nautomated change above.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"438024","messageId":"CABPp-BHRw811_9M3hOEKUDVJkcY_BTYViH3ctsu6CDz9h-cCPQ@mail.gmail.com","threadId":"56634","inReplyTo":"88adcdf1-7b10-c834-84ad-52fe273c0ced@gmail.com","subject":"Re: [PATCH v2 4/4] Documentation/git-status: mention how to detect copies","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2021-10-06T06:04:46Z","receivedAt":"2021-10-06T06:05:01Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Tue, Oct 5, 2021 at 10:05 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n>\n> On 06/10/21 02.42, Johannes Altmanninger wrote:\n> > I wasn't sure whether to add backticks to status.renames because we are\n> > already inconsistent in this file (search for \"config option\").\n> > Anyway I agree that backticks look better here (makes it bold in the man page).\n> >\n> > Maybe we should automate this? We can write a test that makes sure that we\n> > always use backticks around config keys, at least for new changes.\n> >\n> > ---\n> >\n> > I didn't add backticks to \"copies\" to be consistent with this part before the context\n> >\n> >       Ignore changes to submodules when looking for changes. <when> can be\n> >       either \"none\", \"untracked\", \"dirty\" or \"all\", which is the default.\n> >\n>\n> I think for consistency, we can go with automated style changes that use\n> backticks to monospace:\n>      - file name and paths\n>      - daemons/services\n>      - configuration names and values\n>      - file content (use ```...``` block unless inline)\n>      - command-line\n>      - keyboard keys (dunno?)\n>      - any other inline text that needs to be written exactly\n>\n> I have seen many times articles that say `Run \"foo bar\" (no quotes)`\n> when they mean `Run `foo bar``.\n>\n> For the exception you mentioned above it can be monospaced as part of\n> automated change above.\n\nDoing some cleanup passes on the documentation files would probably be\na good thing, but it'd probably belong in a different series.  Better\nto keep this one focused on the fixes being proposed.\n"}]}