From 1566cdd4aea973592ef1871197bc3d6b74b42d7e Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 4 Oct 2021 21:00:47 +0200 Subject: Documentation/git-status: remove impossible porcelain status DR and DC Commit 176ea74793 ("wt-status.c: handle worktree renames", 2017-12-27) made a porcelain status like .R or .C possible. They occur only when the source file is added to the index and the destination file is added with --intent-to-add. They also documented DR, but that status is impossible. The index change D means that the source file does not exist in the index. The worktree change R/C states that the file has been renamed/copied since the index, but that's impossible if it did not exist there. Reported-by: Elijah Newren Signed-off-by: Johannes Altmanninger Signed-off-by: Junio C Hamano --- Documentation/git-status.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt index 83f38e3198..20f496094a 100644 --- a/Documentation/git-status.txt +++ b/Documentation/git-status.txt @@ -225,8 +225,8 @@ C [ MD] copied in index [MARC] index and work tree matches [ MARC] M work tree changed since index [ MARC] D deleted in work tree -[ D] R renamed in work tree -[ D] C copied in work tree + R renamed in work tree + C copied in work tree ------------------------------------------------- D D unmerged, both deleted A U unmerged, added by us -- cgit v1.2.3 From 55e7f52b407dffc8aead377bff2ca3356dfde3e6 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 4 Oct 2021 21:00:48 +0200 Subject: Documentation/diff-format: state in which cases porcelain status is T Porcelain status letter T is documented as "type of the file", which is technically correct but not enough information for users that are not so familiar with this term from systems programming. In particular, given that the only supported file types are "regular file", "symbolic link" and "submodule", the term "file type" is surely opaque to the many(?) users who are not aware that symbolic links can be tracked - I thought that a "chmod +x" could cause the T status (wrong, it's M). Explicitly document the three file types so users know if/how they want to handle this. Signed-off-by: Johannes Altmanninger Signed-off-by: Junio C Hamano --- Documentation/diff-format.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt index fbbd410a84..7a9c3b6ff4 100644 --- a/Documentation/diff-format.txt +++ b/Documentation/diff-format.txt @@ -59,7 +59,7 @@ Possible status letters are: - D: deletion of a file - M: modification of the contents or mode of a file - R: renaming of a file -- T: change in the type of the file +- T: change in the type of the file (regular file, symbolic link or submodule) - U: file is unmerged (you must complete the merge before it can be committed) - X: "unknown" change type (most probably a bug, please report it) -- cgit v1.2.3 From 56c4d7f6a9ece432cd657ecfa5d3061b47ea0622 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 4 Oct 2021 21:00:49 +0200 Subject: Documentation/git-status: document porcelain status T (typechange) As reported in [1], T is missing from the description of porcelain status letters in git-status(1) (whereas T *is* documented in git-diff-files(1) and friends). Document T right after M (modified) because the two are very similar. [1] https://github.com/fish-shell/fish-shell/issues/8311 Signed-off-by: Johannes Altmanninger Signed-off-by: Junio C Hamano --- Documentation/git-status.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt index 20f496094a..255dc6af9b 100644 --- a/Documentation/git-status.txt +++ b/Documentation/git-status.txt @@ -207,6 +207,7 @@ show tracked paths: * ' ' = unmodified * 'M' = modified +* 'T' = file type changed (regular file, symbolic link or submodule) * 'A' = added * 'D' = deleted * 'R' = renamed @@ -217,14 +218,16 @@ show tracked paths: X Y Meaning ------------------------------------------------- [AMD] not updated -M [ MD] updated in index -A [ MD] added to index +M [ MTD] updated in index +T [ MTD] type changed in index +A [ MTD] added to index D deleted from index -R [ MD] renamed in index -C [ MD] copied in index -[MARC] index and work tree matches -[ MARC] M work tree changed since index -[ MARC] D deleted in work tree +R [ MTD] renamed in index +C [ MTD] copied in index +[MTARC] index and work tree matches +[ MTARC] M work tree changed since index +[ MTARC] T type changed in work tree since index +[ MTARC] D deleted in work tree R renamed in work tree C copied in work tree ------------------------------------------------- -- cgit v1.2.3 From d2a534c515e5a0e0e38f077edf28b0eb4c1f011f Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 4 Oct 2021 21:00:50 +0200 Subject: Documentation/git-status: mention how to detect copies The man page documents that git-status can find copies, but does not mention how. Whereas git-diff has command line options -C, there is no such option for git-status - it will only detect copies when the "status.renames" config option is "copies" or "copy". Document that in git-status.txt because this has confused me and others[1]. [1]: https://www.reddit.com/r/git/comments/ppc2l9/how_to_get_a_file_with_copied_status/ Signed-off-by: Johannes Altmanninger Signed-off-by: Junio C Hamano --- Documentation/git-status.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt index 255dc6af9b..8f959afa0f 100644 --- a/Documentation/git-status.txt +++ b/Documentation/git-status.txt @@ -211,7 +211,7 @@ show tracked paths: * 'A' = added * 'D' = deleted * 'R' = renamed -* 'C' = copied +* 'C' = copied (if config option status.renames is set to "copies") * 'U' = updated but unmerged .... -- cgit v1.2.3