git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/3] mailinfo documentation: accurately describe non -k case

From
Thomas Rast <trast@student.ethz.ch>
Date
Jan 11, 2012, 20:13 UTC
Message-ID
<e915a551c9bbf12f4d8fd929e9ed24f3223790ee.1326312730.git.trast@student.ethz.ch>

Since its very first description of -k, the documentation for git-mailinfo claimed that (in the case without -k) after cleaning up bracketed strings [blah], it would insert [PATCH].

It doesn't; on the contrary, one of the important jobs of mailinfo is to remove those strings.

Since we're already there, rewrite the paragraph to give a complete enumeration of all the transformations. Specifically, it was missing the whitespace normalization (run of isspace(c) -> ' ') and the removal of leading ':'.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 Documentation/git-mailinfo.txt |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt
index 51dc325..97e7a8e 100644
--- a/Documentation/git-mailinfo.txt
+++ b/Documentation/git-mailinfo.txt
@@ -25,13 +25,24 @@ command directly.  See linkgit:git-am[1] instead.
 OPTIONS
 -------
 -k::
-	Usually the program 'cleans up' the Subject: header line
-	to extract the title line for the commit log message,
-	among which (1) remove 'Re:' or 're:', (2) leading
-	whitespaces, (3) '[' up to ']', typically '[PATCH]', and
-	then prepends "[PATCH] ".  This flag forbids this
-	munging, and is most useful when used to read back
-	'git format-patch -k' output.
+	Usually the program removes email cruft from the Subject:
+	header line to extract the title line for the commit log
+	message.  This option prevents this munging, and is most
+	useful when used to read back 'git format-patch -k' output.
++
+Specifically, the following are removed until none of them remain:
++
+--
+*	Leading and trailing whitespace.
+
+*	Leading `Re:`, `re:`, and `:`.
+
+*	Leading bracketed strings (between `[` and `]`, usually
+	`[PATCH]`).
+--
++
+Finally, runs of whitespace are normalized to a single ASCII space
+character.
 
 -b::
 	When -k is not in effect, all leading strings bracketed with '['
-- 
1.7.9.rc0.168.g3847c
Next: Thomas Rast
Message 1 of 9 in “mailinfo documentation: accurately describe non -k case”
  1. 1/3 mailinfo documentation: accurately describe non -k caseThomas Rast, Jan 11, 2012
  2. 2/3 am: learn passing -b to mailinfoThomas Rast, Jan 11, 2012
  3. Junio C HamanoJan 12, 2012
  4. Thomas RastJan 12, 2012
  5. 1/2 am: learn passing -b to mailinfoThomas Rast, Jan 16, 2012
  6. 2/2 mailinfo: with -b, keep space after [foo]Thomas Rast, Jan 16, 2012
  7. Junio C HamanoJan 19, 2012
  8. Thomas RastJan 20, 2012
  9. 3/3 mailinfo: with -b, keep space after [foo]Thomas Rast, Jan 11, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.