{"thread":{"id":"17639","subject":"[PATCH] Enable setting attach in .gitconfig for git-format-patch.","startedAt":"2009-02-07T21:56:31Z","lastAt":"2009-02-08T04:50:53Z","messageCount":4,"participants":["Jeremy White","Johannes Schindelin","Boyd Stephen Smith Jr."],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"103666","messageId":"498E038F.3090704@codeweavers.com","threadId":"17639","inReplyTo":null,"subject":"[PATCH] Enable setting attach in .gitconfig for git-format-patch.","fromName":"Jeremy White","fromEmail":"jwhite@codeweavers.com","sentAt":"2009-02-07T21:56:31Z","receivedAt":"2009-02-07T21:56:31Z","isPatch":true,"sender":{"key":"jwhite@codeweavers.com","avatar":"https://avatars.githubusercontent.com/u/1063742?v=4"},"body":"In an attempt to keep us Thunderbird users from embarrassing ourselves.\n\nSigned-off-by: Jeremy White <jwhite@codeweavers.com>\n---\n  Documentation/git-format-patch.txt |    4 +++-\n  builtin-log.c                      |   15 +++++++++++++++\n  2 files changed, 18 insertions(+), 1 deletions(-)\n\n\n\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex 11a7d77..2e8e94e 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -174,7 +174,8 @@ CONFIGURATION\n -------------\n You can specify extra mail header lines to be added to each message\n in the repository configuration, new defaults for the subject prefix\n-and file suffix, and number patches when outputting more than one.\n+and file suffix, control attachements, and number patches when outputting\n+more than one.\n \n ------------\n [format]\n@@ -183,6 +184,7 @@ and file suffix, and number patches when outputting more than one.\n \tsuffix = .txt\n \tnumbered = auto\n \tcc = <email>\n+\tattach [ = mime-boundary-string ]\n ------------\n \n \ndiff --git a/builtin-log.c b/builtin-log.c\nindex 2ae39af..1a8adde 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -428,6 +428,8 @@ static const char *fmt_patch_suffix = \".patch\";\n static int numbered = 0;\n static int auto_number = 1;\n \n+static char *extra_attach = NULL;\n+\n static char **extra_hdr;\n static int extra_hdr_nr;\n static int extra_hdr_alloc;\n@@ -488,6 +490,14 @@ static int git_format_config(const char *var, const char *value, void *cb)\n \t\tauto_number = auto_number && numbered;\n \t\treturn 0;\n \t}\n+\tif (!strcmp(var, \"format.attach\")) {\n+\t\tif (value && strlen(value) > 0)\n+\t\t\textra_attach = xstrdup(value);\n+\t\telse\n+\t\t\textra_attach = xstrdup(git_version_string);\n+\t\treturn 0;\n+\t}\n+\n \n \treturn git_log_config(var, value, cb);\n }\n@@ -787,6 +797,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \n \trev.subject_prefix = fmt_patch_subject_prefix;\n \n+\tif (extra_attach) {\n+\t\trev.mime_boundary = extra_attach;\n+\t\trev.no_inline = 1;\n+\t}\n+\n \t/*\n \t * Parse the arguments before setup_revisions(), or something\n \t * like \"git format-patch -o a123 HEAD^..\" may fail; a123 is\n\n"},{"id":"103668","messageId":"alpine.DEB.1.00.0902072344350.10279@pacific.mpi-cbg.de","threadId":"17639","inReplyTo":"498E038F.3090704@codeweavers.com","subject":"Re: [PATCH] Enable setting attach in .gitconfig for git-format-patch.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-07T22:45:34Z","receivedAt":"2009-02-07T22:45:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 7 Feb 2009, Jeremy White wrote:\n\n> In an attempt to keep us Thunderbird users from embarrassing ourselves.\n> \n> Signed-off-by: Jeremy White <jwhite@codeweavers.com>\n> ---\n>  Documentation/git-format-patch.txt |    4 +++-\n>  builtin-log.c                      |   15 +++++++++++++++\n>  2 files changed, 18 insertions(+), 1 deletions(-)\n\nPity.  You attached the patch.  So I do not quote the part where you use a \nstrlen() > 0 which would better be a *value.  But it would be nice to fix \nthe issue.\n\nCiao,\nDscho\n"},{"id":"103685","messageId":"498E507A.8080200@codeweavers.com","threadId":"17639","inReplyTo":"alpine.DEB.1.00.0902072344350.10279@pacific.mpi-cbg.de","subject":"Re: [PATCH] Enable setting attach in .gitconfig for git-format-patch.","fromName":"Jeremy White","fromEmail":"jwhite@codeweavers.com","sentAt":"2009-02-08T03:24:42Z","receivedAt":"2009-02-08T03:24:42Z","isPatch":true,"sender":{"key":"jwhite@codeweavers.com","avatar":"https://avatars.githubusercontent.com/u/1063742?v=4"},"body":"> Pity.  You attached the patch.  So I do not quote the part where you use a \n> strlen() > 0 which would better be a *value.  But it would be nice to fix \n> the issue.\n\nThat's a good point; I'll resend. Thanks for the review.\n\nCheers,\n\nJeremy\n"},{"id":"103688","messageId":"200902072250.53902.bss@iguanasuicide.net","threadId":"17639","inReplyTo":"498E038F.3090704@codeweavers.com","subject":"Re: [PATCH] Enable setting attach in .gitconfig for git-format-patch.","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-02-08T04:50:53Z","receivedAt":"2009-02-08T04:50:53Z","isPatch":true,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Saturday 07 February 2009 15:56:31 Jeremy White wrote:\n> +static char *extra_attach = NULL;\n\nThe initializer is just noise here, yes?  If the \" = NULL\" is not needed, we \ngenerally drop it.\n-- \nBoyd Stephen Smith Jr.                   ,= ,-_-. =.\nbss@iguanasuicide.net                   ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'\nhttp://iguanasuicide.net/                    \\_/\n\n"}]}