From 9e4b7ab652561e1807702fe5288e04b8873fc437 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 15 Aug 2009 02:27:39 -0700 Subject: git status: not "commit --dry-run" anymore This removes tentative "git stat" and make it take over "git status". There are some tests that expect "git status" to exit with non-zero status when there is something staged. Some tests expect "git status path..." to show the status for a partial commit. For these, replace "git status" with "git commit --dry-run". For the ones that do not attempt a dry-run of a partial commit that check the output from the command, check the output from "git status" as well, as they should be identical. Signed-off-by: Junio C Hamano --- t/t7060-wtstatus.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 't/t7060-wtstatus.sh') diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh index 1044aa6549..7b5db8066f 100755 --- a/t/t7060-wtstatus.sh +++ b/t/t7060-wtstatus.sh @@ -50,9 +50,11 @@ test_expect_success 'M/D conflict does not segfault' ' git rm foo && git commit -m delete && test_must_fail git merge master && - test_must_fail git status > ../actual - ) && - test_cmp expect actual + test_must_fail git commit --dry-run >../actual && + test_cmp ../expect ../actual && + git status >../actual && + test_cmp ../expect ../actual + ) ' test_done -- cgit v1.2.3 From dd20f8af1ae54773569b78b1b71d1ea663705d2c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 12 Dec 2009 00:18:12 -0800 Subject: commit/status: "git add " is not necessarily how to resolve When the desired resolution is to remove the path, "git rm " is the command the user needs to use. Just like in "Changed but not updated" section, suggest to use "git add/rm" as appropriate. Signed-off-by: Junio C Hamano --- t/t7060-wtstatus.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t7060-wtstatus.sh') diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh index 7b5db8066f..0919ec46f6 100755 --- a/t/t7060-wtstatus.sh +++ b/t/t7060-wtstatus.sh @@ -32,7 +32,7 @@ cat >expect <..." to unstage) -# (use "git add ..." to mark resolution) +# (use "git add/rm ..." as appropriate to mark resolution) # # deleted by us: foo # -- cgit v1.2.3 From 3c5884536563518ce6cd4dc782b0ebb670bf3b6d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 11 Dec 2009 23:53:41 -0800 Subject: status/commit: do not suggest "reset HEAD " while merging Suggesting "'reset HEAD ' to unstage" is dead wrong if we are about to record a merge commit. For either an unmerged path (i.e. with unresolved conflicts), or an updated path, it would result in discarding what the other branch did. Note that we do not do anything special in a case where we are amending a merge. The user is making an evil merge starting from an already committed merge, and running "reset HEAD " is the right way to get rid of the local edit that has been added to the index. Once "reset --unresolve " becomes available, we might want to suggest it for a merged path that has unresolve information, but until then, just remove the incorrect advice. We might also want to suggest "checkout --conflict " to revert the file in the work tree to the state of failed automerge for an unmerged path, but we never did that, and this commit does not change that. Signed-off-by: Junio C Hamano --- t/t7060-wtstatus.sh | 1 - 1 file changed, 1 deletion(-) (limited to 't/t7060-wtstatus.sh') diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh index 0919ec46f6..fcac472598 100755 --- a/t/t7060-wtstatus.sh +++ b/t/t7060-wtstatus.sh @@ -31,7 +31,6 @@ test_expect_success 'Report new path with conflict' ' cat >expect <..." to unstage) # (use "git add/rm ..." as appropriate to mark resolution) # # deleted by us: foo -- cgit v1.2.3