git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Riesen" <raa.lkml@gmail.com>
To: "Adam Roben" <aroben@apple.com>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH] Handle format.subjectprefix for every command which accepts --pretty
Date: Wed, 4 Jul 2007 12:42:10 +0200	[thread overview]
Message-ID: <81b0412b0707040342m22d3979cte99601bc1117f065@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 282 bytes --]

Because the --pretty can be given as --pretty=email which historically produced
mails with patches. IOW, exactly what git-format-patch does.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 builtin-log.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

[-- Attachment #2: 0002-Handle-format.subjectprefix-for-every-command-which.txt --]
[-- Type: text/plain, Size: 2286 bytes --]

From 3c8b524c775a96eb0e9b638e3c0b194d8743594a Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa@limbo.localdomain>
Date: Wed, 4 Jul 2007 12:37:27 +0200
Subject: [PATCH] Handle format.subjectprefix for every command which accepts --pretty

Because the --pretty can be given as --pretty=email which historically produced
mails with patches. IOW, exactly what git-format-patch does.
---
 builtin-log.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index 5dc2c1c..13bae31 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -16,6 +16,7 @@
 #include "refs.h"
 
 static int default_show_root = 1;
+static const char *fmt_patch_subject_prefix = "PATCH";
 
 /* this is in builtin-diff.c */
 void add_head(struct rev_info *revs);
@@ -55,6 +56,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
 	rev->commit_format = CMIT_FMT_DEFAULT;
 	rev->verbose_header = 1;
 	rev->show_root_diff = default_show_root;
+	rev->subject_prefix = fmt_patch_subject_prefix;
 	argc = setup_revisions(argc, argv, rev, "HEAD");
 	if (rev->diffopt.pickaxe || rev->diffopt.filter)
 		rev->always_show_header = 0;
@@ -94,6 +96,12 @@ static int cmd_log_walk(struct rev_info *rev)
 
 static int git_log_config(const char *var, const char *value)
 {
+	if (!strcmp(var, "format.subjectprefix")) {
+		if (!value)
+			die("format.subjectprefix without value");
+		fmt_patch_subject_prefix = xstrdup(value);
+		return 0;
+	}
 	if (!strcmp(var, "log.showroot")) {
 		default_show_root = git_config_bool(var, value);
 		return 0;
@@ -265,7 +273,6 @@ static int istitlechar(char c)
 
 static char *extra_headers = NULL;
 static int extra_headers_size = 0;
-static const char *fmt_patch_subject_prefix = "PATCH";
 static const char *fmt_patch_suffix = ".patch";
 
 static int git_format_config(const char *var, const char *value)
@@ -291,12 +298,6 @@ static int git_format_config(const char *var, const char *value)
 	if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
 		return 0;
 	}
-	if (!strcmp(var, "format.subjectprefix")) {
-		if (!value)
-			die("format.subjectprefix without value");
-		fmt_patch_subject_prefix = xstrdup(value);
-		return 0;
-	}
 
 	return git_log_config(var, value);
 }
-- 
1.5.2.2.669.gad316


                 reply	other threads:[~2007-07-04 10:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81b0412b0707040342m22d3979cte99601bc1117f065@mail.gmail.com \
    --to=raa.lkml@gmail.com \
    --cc=aroben@apple.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).