[PATCH] Make commit help text more accurate for --verbose

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

 



Commit message help text says lines starting with '#' will be ignored.
The diff lines added by --verbose are also ignored, although they don't
start with '#'s. Extend help text to describe behavior on diff lines
when relevant.

Signed-off-by: Ramana Kumar <ramana.kumar@xxxxxxxxx>
---
 builtin/commit.c |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 66fdd22..b49fd7a 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -658,17 +658,28 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		fprintf(fp,
 			"\n"
 			"# Please enter the commit message for your changes.");
-		if (cleanup_mode == CLEANUP_ALL)
+		if (cleanup_mode == CLEANUP_ALL && !verbose)
 			fprintf(fp,
 				" Lines starting\n"
 				"# with '#' will be ignored, and an empty"
 				" message aborts the commit.\n");
-		else /* CLEANUP_SPACE, that is. */
-			fprintf(fp,
-				" Lines starting\n"
-				"# with '#' will be kept; you may remove them"
-				" yourself if you want to.\n"
-				"# An empty message aborts the commit.\n");
+    else {
+      if (cleanup_mode == CLEANUP_ALL)
+        fprintf(fp,
+          " Lines starting\n"
+          "# with '#' will be ignored, as will"
+          " the diff and anything below it.\n");
+      else { /* CLEANUP_SPACE, that is. */
+        fprintf(fp,
+          " Lines starting\n"
+          "# with '#' will be kept; you may remove them"
+          " yourself if you want to.\n");
+        if (verbose)
+          fprintf(fp,
+            "# The diff and anything below it will be ignored.\n");
+      }
+      fprintf(fp, "# An empty message aborts the commit.\n");
+    }
 		if (only_include_assumed)
 			fprintf(fp, "# %s\n", only_include_assumed);
 
-- 
1.7.2.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]