[PATCH v2] revert: only suggest to commit if not passing -n

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



while doing revert or cherry-pick, if the automatic merge fails
and the user specifically suggested he didn't want to commit,
then don't suggest to do that as part of the conflict resolution.

Signed-off-by: Carlo Marcelo Arenas Belon <carenas@xxxxxxxxxxxxxx>
---
 builtin/revert.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/builtin/revert.c b/builtin/revert.c
index 8b9d829..b7cb69b 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -250,14 +250,18 @@ static char *help_msg(void)
 		return msg;
 
 	strbuf_addstr(&helpbuf, "  After resolving the conflicts,\n"
-		"mark the corrected paths with 'git add <paths>' or 'git rm <paths>'\n"
-		"and commit the result");
+		"mark the corrected paths with 'git add <paths>' or 'git rm <paths>'");
+	if (!no_commit) {
+		strbuf_addstr(&helpbuf, "\nand commit the result");
 
-	if (action == CHERRY_PICK) {
-		strbuf_addf(&helpbuf, " with: \n"
-			"\n"
-			"        git commit -c %s\n",
-			    sha1_to_hex(commit->object.sha1));
+		if (action == CHERRY_PICK) {
+			strbuf_addf(&helpbuf, " with: \n"
+				"\n"
+				"        git commit -c %s\n",
+				    sha1_to_hex(commit->object.sha1));
+		}
+		else
+			strbuf_addch(&helpbuf, '.');
 	}
 	else
 		strbuf_addch(&helpbuf, '.');
-- 
1.7.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]