All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy White <jwhite@codeweavers.com>
To: git@vger.kernel.org
Subject: [PATCH] Enable setting attach in .gitconfig for git-format-patch.
Date: Sat, 07 Feb 2009 15:56:31 -0600	[thread overview]
Message-ID: <498E038F.3090704@codeweavers.com> (raw)

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

In an attempt to keep us Thunderbird users from embarrassing ourselves.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
---
  Documentation/git-format-patch.txt |    4 +++-
  builtin-log.c                      |   15 +++++++++++++++
  2 files changed, 18 insertions(+), 1 deletions(-)



[-- Attachment #2: a7c94b28e4cfa6b9945499da8e6c7cb7289c19d4.diff --]
[-- Type: text/x-patch, Size: 1865 bytes --]

diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index 11a7d77..2e8e94e 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -174,7 +174,8 @@ CONFIGURATION
 -------------
 You can specify extra mail header lines to be added to each message
 in the repository configuration, new defaults for the subject prefix
-and file suffix, and number patches when outputting more than one.
+and file suffix, control attachements, and number patches when outputting
+more than one.
 
 ------------
 [format]
@@ -183,6 +184,7 @@ and file suffix, and number patches when outputting more than one.
 	suffix = .txt
 	numbered = auto
 	cc = <email>
+	attach [ = mime-boundary-string ]
 ------------
 
 
diff --git a/builtin-log.c b/builtin-log.c
index 2ae39af..1a8adde 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -428,6 +428,8 @@ static const char *fmt_patch_suffix = ".patch";
 static int numbered = 0;
 static int auto_number = 1;
 
+static char *extra_attach = NULL;
+
 static char **extra_hdr;
 static int extra_hdr_nr;
 static int extra_hdr_alloc;
@@ -488,6 +490,14 @@ static int git_format_config(const char *var, const char *value, void *cb)
 		auto_number = auto_number && numbered;
 		return 0;
 	}
+	if (!strcmp(var, "format.attach")) {
+		if (value && strlen(value) > 0)
+			extra_attach = xstrdup(value);
+		else
+			extra_attach = xstrdup(git_version_string);
+		return 0;
+	}
+
 
 	return git_log_config(var, value, cb);
 }
@@ -787,6 +797,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
 	rev.subject_prefix = fmt_patch_subject_prefix;
 
+	if (extra_attach) {
+		rev.mime_boundary = extra_attach;
+		rev.no_inline = 1;
+	}
+
 	/*
 	 * Parse the arguments before setup_revisions(), or something
 	 * like "git format-patch -o a123 HEAD^.." may fail; a123 is


             reply	other threads:[~2009-02-07 22:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07 21:56 Jeremy White [this message]
2009-02-07 22:45 ` [PATCH] Enable setting attach in .gitconfig for git-format-patch Johannes Schindelin
2009-02-08  3:24   ` Jeremy White
2009-02-08  4:50 ` Boyd Stephen Smith Jr.

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=498E038F.3090704@codeweavers.com \
    --to=jwhite@codeweavers.com \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.