summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 30aa4fb)
raw | patch | inline | side by side (parent: 30aa4fb)
author | Jeremy White <jwhite@codeweavers.com> | |
Thu, 12 Feb 2009 15:51:55 +0000 (09:51 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 12 Feb 2009 22:48:43 +0000 (14:48 -0800) |
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-format-patch.txt | patch | blob | history | |
builtin-log.c | patch | blob | history |
index 11a7d772618f48b961d41fb5fe1cb269d7ae7cd1..e7ae8cf109003f0dc43c448c40e5fb09a480f912 100644 (file)
--------
[verse]
'git format-patch' [-k] [-o <dir> | --stdout] [--thread]
- [--attach[=<boundary>] | --inline[=<boundary>]]
+ [--attach[=<boundary>] | --inline[=<boundary>] |
+ [--no-attach]]
[-s | --signoff] [<common diff options>]
[-n | --numbered | -N | --no-numbered]
[--start-number <n>] [--numbered-files]
which is the commit message and the patch itself in the
second part, with "Content-Disposition: attachment".
+--no-attach::
+ Disable the creation of an attachment, overriding the
+ configuration setting.
+
--inline[=<boundary>]::
Create multipart/mixed attachment, the first part of
which is the commit message and the patch itself in the
-------------
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]
suffix = .txt
numbered = auto
cc = <email>
+ attach [ = mime-boundary-string ]
------------
diff --git a/builtin-log.c b/builtin-log.c
index 2ae39afccdc1978141fe4cc4453befa632ecaadf..8549028817ac1a4add0a224ac2996bcbea9a6455 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
static int numbered = 0;
static int auto_number = 1;
+static char *default_attach = NULL;
+
static char **extra_hdr;
static int extra_hdr_nr;
static int extra_hdr_alloc;
auto_number = auto_number && numbered;
return 0;
}
+ if (!strcmp(var, "format.attach")) {
+ if (value && *value)
+ default_attach = xstrdup(value);
+ else
+ default_attach = xstrdup(git_version_string);
+ return 0;
+ }
+
return git_log_config(var, value, cb);
}
rev.subject_prefix = fmt_patch_subject_prefix;
+ if (default_attach) {
+ rev.mime_boundary = default_attach;
+ rev.no_inline = 1;
+ }
+
/*
* Parse the arguments before setup_revisions(), or something
* like "git format-patch -o a123 HEAD^.." may fail; a123 is
rev.mime_boundary = argv[i] + 9;
rev.no_inline = 1;
}
+ else if (!strcmp(argv[i], "--no-attach")) {
+ rev.mime_boundary = NULL;
+ rev.no_inline = 0;
+ }
else if (!strcmp(argv[i], "--inline")) {
rev.mime_boundary = git_version_string;
rev.no_inline = 0;