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

[PATCH v2 2/4] Add format.coverauto boolean

From
FTFrank Terbeck <ft@bewatermyfriend.org>
Date
May 4, 2009, 09:59 UTC
Message-ID
<1241431142-8444-3-git-send-email-ft@bewatermyfriend.org>
In-Reply-To
<7v8wlxx18c.fsf@gitster.siamese.dyndns.org>

If set to true, format-patch behaves like it had been started using the --cover-letter option.

An exception is if it is called using the --stdout option, which disables format.coverauto, because users of --stdout (like git-rebase.sh) usually are not interested in cover letters at all.

If you do want it anyway, you can use:
  % git format-patch --stdout --cover-letter
Signed-off-by: Frank Terbeck <ft@bewatermyfriend.org>
---
 builtin-log.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 157c8cf..52c0d47 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -483,6 +483,10 @@ static int git_format_config(const char *var, const char *value, void *cb)
 	if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
 		return 0;
 	}
+	if (!strcmp(var, "format.coverauto")) {
+		cover_letter = git_config_bool(var, value);;
+		return 0;
+	}
 	if (!strcmp(var, "format.coverletter")) {
 		cover_letter_len = git_config_int(var, value);
 		return 0;
@@ -789,9 +793,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 	 * possibly a valid SHA1.
 	 */
 	for (i = 1, j = 1; i < argc; i++) {
-		if (!strcmp(argv[i], "--stdout"))
+		if (!strcmp(argv[i], "--stdout")) {
 			use_stdout = 1;
-		else if (!strcmp(argv[i], "-n") ||
+			cover_letter = 0;
+		} else if (!strcmp(argv[i], "-n") ||
 				!strcmp(argv[i], "--numbered"))
 			numbered = 1;
 		else if (!strcmp(argv[i], "-N") ||
-- 
1.6.2.2.446.gfbdc0
Previous: Frank TerbeckNext: Stephen Boyd
Message 11 of 21 in “more automation for cover letter generation”
  1. 0/6 more automation for cover letter generationFrank Terbeck, Apr 18, 2009
  2. 1/6 format-patch: add cover{letter,onepatch} optionsFrank Terbeck, Apr 18, 2009
  3. 2/6 Add documentation for format-patch's --cover-one-patchFrank Terbeck, Apr 18, 2009
  4. 3/6 Document format.coverletter and format.coveronepatchFrank Terbeck, Apr 18, 2009
  5. 4/6 format-patch: introduce overwritecoverletter optionFrank Terbeck, Apr 18, 2009
  6. 5/6 Add documentation for --cover-overwriteFrank Terbeck, Apr 18, 2009
  7. 6/6 Document format.overwritecoverletterFrank Terbeck, Apr 18, 2009
  8. Junio C HamanoApr 18, 2009
  9. 0/4 more automation for cover letter generationFrank Terbeck, May 4, 2009
  10. 1/4 Add format.coverletter optionFrank Terbeck, May 4, 2009
  11. 2/4 Add format.coverauto booleanFrank Terbeck, May 4, 2009
  12. Stephen BoydMay 4, 2009
  13. Frank TerbeckMay 4, 2009
  14. Junio C HamanoMay 4, 2009
  15. Frank TerbeckMay 5, 2009
  16. Junio C HamanoMay 5, 2009
  17. Frank TerbeckMay 5, 2009
  18. Frank TerbeckMay 5, 2009
  19. 3/4 Add tests for coverauto, coverletter and --cover-letterFrank Terbeck, May 4, 2009
  20. 4/4 Documentation for format.coverletter and --cover-letterFrank Terbeck, May 4, 2009
  21. Jeff KingApr 21, 2009

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.