{"thread":{"id":"6414","subject":"[PATCH] git-format-patch -3","startedAt":"2007-01-17T21:35:13Z","lastAt":"2007-01-18T15:13:07Z","messageCount":8,"participants":["Junio C Hamano","Shawn O. Pearce","Johannes Schindelin","Andy Parkins","Brian Gernhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"31924","messageId":"7vk5zlqqum.fsf@assigned-by-dhcp.cox.net","threadId":"6414","inReplyTo":null,"subject":"[PATCH] git-format-patch -3","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-17T21:35:13Z","receivedAt":"2007-01-17T21:35:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This teaches \"git-format-patch\" to honor the --max-count\nparameter revision traversal machinery takes, so that you can\nsay \"git-format-patch -3\" to process the three topmost commits\nfrom the current HEAD (or \"git-format-patch -2 topic\" to name a\nspecific branch).\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n * I think this is incompatible with --ignore-if-upstream, which\n   I haven't bothered to look into yet.\n\n   Likes, dislikes?\n\n builtin-log.c |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 1cd9d3f..9453e6d 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -482,8 +482,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (rev.pending.nr == 1) {\n-\t\trev.pending.objects[0].item->flags |= UNINTERESTING;\n-\t\tadd_head(&rev);\n+\t\tif (rev.max_count < 0) {\n+\t\t\trev.pending.objects[0].item->flags |= UNINTERESTING;\n+\t\t\tadd_head(&rev);\n+\t\t}\n+\t\t/* Otherwise, it is \"format-patch -22 HEAD\", and\n+\t\t * get_revision() would return only the specified count.\n+\t\t */\n \t}\n \n \tif (ignore_if_in_upstream)\n"},{"id":"31925","messageId":"7vac0hqq33.fsf@assigned-by-dhcp.cox.net","threadId":"6414","inReplyTo":"7vk5zlqqum.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Add --summary to git-format-patch by default","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-17T21:51:44Z","receivedAt":"2007-01-17T21:51:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This adds --summary output in addition to the --stat to the\noutput from git-format-patch by default.\n\nI think additions, removals and filemode changes are rare but\nnotable events and always showing it makes sense.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n * An alternative would be to give --summary whenever --stat is\n   asked for _any_ diff family of commands, which might make\n   sense but I suspect is going too far.  At least format-patch\n   is a good place to add this since it allows accidental mode\n   changes to be caught at the last minute before sending the\n   message out to the public.\n\n   Opinions?\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 9453e6d..c32a1df 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -468,7 +468,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tdie (\"unrecognized argument: %s\", argv[1]);\n \n \tif (!rev.diffopt.output_format)\n-\t\trev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;\n+\t\trev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;\n \n \tif (!output_directory)\n \t\toutput_directory = prefix;\ndiff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master\nindex b4745e1..e5ddd6f 100644\n--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master\n+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master\n@@ -19,6 +19,7 @@ This is the second commit.\n  file0   |    3 +++\n  file2   |    3 ---\n  3 files changed, 5 insertions(+), 3 deletions(-)\n+ delete mode 100644 file2\n --------------g-i-t--v-e-r-s-i-o-n\n Content-Type: text/x-patch;\n  name=\"1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff\"\n@@ -77,6 +78,7 @@ Content-Transfer-Encoding: 8bit\n  dir/sub |    2 ++\n  file1   |    3 +++\n  2 files changed, 5 insertions(+), 0 deletions(-)\n+ create mode 100644 file1\n --------------g-i-t--v-e-r-s-i-o-n\n Content-Type: text/x-patch;\n  name=\"9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff\"\n@@ -126,6 +128,7 @@ Content-Transfer-Encoding: 8bit\n  file0   |    3 +++\n  file3   |    4 ++++\n  3 files changed, 9 insertions(+), 0 deletions(-)\n+ create mode 100644 file3\n --------------g-i-t--v-e-r-s-i-o-n\n Content-Type: text/x-patch;\n  name=\"c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff\"\ndiff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^\nindex a9d1cd3..d0dd19b 100644\n--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^\n+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^\n@@ -19,6 +19,7 @@ This is the second commit.\n  file0   |    3 +++\n  file2   |    3 ---\n  3 files changed, 5 insertions(+), 3 deletions(-)\n+ delete mode 100644 file2\n --------------g-i-t--v-e-r-s-i-o-n\n Content-Type: text/x-patch;\n  name=\"1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff\"\n@@ -77,6 +78,7 @@ Content-Transfer-Encoding: 8bit\n  dir/sub |    2 ++\n  file1   |    3 +++\n  2 files changed, 5 insertions(+), 0 deletions(-)\n+ create mode 100644 file1\n --------------g-i-t--v-e-r-s-i-o-n\n Content-Type: text/x-patch;\n  name=\"9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff\"\ndiff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_initial..side\nindex 57b9d0b..67a95c5 100644\n--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..side\n+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side\n@@ -17,6 +17,7 @@ Content-Transfer-Encoding: 8bit\n  file0   |    3 +++\n  file3   |    4 ++++\n  3 files changed, 9 insertions(+), 0 deletions(-)\n+ create mode 100644 file3\n --------------g-i-t--v-e-r-s-i-o-n\n Content-Type: text/x-patch;\n  name=\"c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff\"\ndiff --git a/t/t4013/diff.format-patch_--stdout_initial..master b/t/t4013/diff.format-patch_--stdout_initial..master\nindex c33302e..8b88ca4 100644\n--- a/t/t4013/diff.format-patch_--stdout_initial..master\n+++ b/t/t4013/diff.format-patch_--stdout_initial..master\n@@ -10,6 +10,7 @@ This is the second commit.\n  file0   |    3 +++\n  file2   |    3 ---\n  3 files changed, 5 insertions(+), 3 deletions(-)\n+ delete mode 100644 file2\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..8422d40 100644\n@@ -53,6 +54,7 @@ Subject: [PATCH] Third\n  dir/sub |    2 ++\n  file1   |    3 +++\n  2 files changed, 5 insertions(+), 0 deletions(-)\n+ create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\n@@ -87,6 +89,7 @@ Subject: [PATCH] Side\n  file0   |    3 +++\n  file3   |    4 ++++\n  3 files changed, 9 insertions(+), 0 deletions(-)\n+ create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\ndiff --git a/t/t4013/diff.format-patch_--stdout_initial..master^ b/t/t4013/diff.format-patch_--stdout_initial..master^\nindex 03d0f96..47a4b88 100644\n--- a/t/t4013/diff.format-patch_--stdout_initial..master^\n+++ b/t/t4013/diff.format-patch_--stdout_initial..master^\n@@ -10,6 +10,7 @@ This is the second commit.\n  file0   |    3 +++\n  file2   |    3 ---\n  3 files changed, 5 insertions(+), 3 deletions(-)\n+ delete mode 100644 file2\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..8422d40 100644\n@@ -53,6 +54,7 @@ Subject: [PATCH] Third\n  dir/sub |    2 ++\n  file1   |    3 +++\n  2 files changed, 5 insertions(+), 0 deletions(-)\n+ create mode 100644 file1\n \n diff --git a/dir/sub b/dir/sub\n index 8422d40..cead32e 100644\ndiff --git a/t/t4013/diff.format-patch_--stdout_initial..side b/t/t4013/diff.format-patch_--stdout_initial..side\nindex d10a465..e765088 100644\n--- a/t/t4013/diff.format-patch_--stdout_initial..side\n+++ b/t/t4013/diff.format-patch_--stdout_initial..side\n@@ -9,6 +9,7 @@ Subject: [PATCH] Side\n  file0   |    3 +++\n  file3   |    4 ++++\n  3 files changed, 9 insertions(+), 0 deletions(-)\n+ create mode 100644 file3\n \n diff --git a/dir/sub b/dir/sub\n index 35d242b..7289e35 100644\n"},{"id":"31927","messageId":"7vwt3lp97c.fsf_-_@assigned-by-dhcp.cox.net","threadId":"6414","inReplyTo":"7vac0hqq33.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] git-format-patch: make --binary on by default","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-17T22:41:43Z","receivedAt":"2007-01-17T22:41:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"It does not make much sense to generate a patch that cannot be\napplied.  If --text is specified on the command line it still\ntakes precedence.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n * I would opt not to make \"git am --binary\" the default for\n   now.  Even with this change, sending binary patch over e-mail\n   is unusual as it is harder to review --- I think it makes\n   sense to error out by default and draw attention from the\n   person who is applying the patch rather than accepting binary\n   patch automatically as if nothing unusual happened.\n\n builtin-log.c |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex c32a1df..930cc04 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -470,6 +470,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \tif (!rev.diffopt.output_format)\n \t\trev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;\n \n+\tif (!rev.diffopt.text)\n+\t\trev.diffopt.binary = 1;\n+\n \tif (!output_directory)\n \t\toutput_directory = prefix;\n \n-- \n1.5.0.rc1.gde38\n"},{"id":"31928","messageId":"7vhcupp81v.fsf_-_@assigned-by-dhcp.cox.net","threadId":"6414","inReplyTo":"7vwt3lp97c.fsf_-_@assigned-by-dhcp.cox.net","subject":"[PATCH - todo] Changes to e-mailed patch handling in v1.5.0","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-17T23:06:36Z","receivedAt":"2007-01-17T23:06:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This applies to the draft v1.5.0 release notes in 'todo' branch and\nsummarizes the changes my patches to format-patch bring in.  \n\nI am neutral about changing the default suffix from .txt to .patch;\ncomments?\n\n\ndiff --git a/v1.5.0.txt b/v1.5.0.txt\nindex 2fccf8e..6a9a8d6 100644\n--- a/v1.5.0.txt\n+++ b/v1.5.0.txt\n@@ -268,6 +268,21 @@ Updates in v1.5.0 since v1.4.4 series\n    excuse us for this very minor one-time inconvenience.\n \n \n+* e-mailed patches\n+\n+ - See the above I18n section.\n+\n+ - git-format-patch now enables --binary without being asked.\n+   git-am does _not_ default to it, as sending binary patch via\n+   e-mail is unusual and is harder to review than textual\n+   patches and it is prudent to require the person who is\n+   applying the patch to explicitly ask for it.\n+\n+ - The default suffix for git-format-patch output is now \".patch\",\n+   not \".txt\".  This can be changed with --suffix=.txt option,\n+   or \"format.suffix = .txt\" in the configuration.\n+\n+\n * Foreign SCM interfaces\n \n   - git-svn now requires the Perl SVN:: libraries, the\n"},{"id":"31934","messageId":"20070118010440.GA23124@spearce.org","threadId":"6414","inReplyTo":"7vac0hqq33.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add --summary to git-format-patch by default","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-01-18T01:04:40Z","receivedAt":"2007-01-18T01:04:40Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> This adds --summary output in addition to the --stat to the\n> output from git-format-patch by default.\n>    Opinions?\n\nThis is the right thing to do.  format-patch should default to\nboth --summary and --stat.\n\n-- \nShawn.\n"},{"id":"31937","messageId":"Pine.LNX.4.63.0701180221010.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6414","inReplyTo":"7vk5zlqqum.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-format-patch -3","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-18T01:25:47Z","receivedAt":"2007-01-18T01:25:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 17 Jan 2007, Junio C Hamano wrote:\n\n>  * I think this is incompatible with --ignore-if-upstream, which\n>    I haven't bothered to look into yet.\n\nUhm. What exactly _would_ be upstream?\n\nAt the moment, for \"--ignore-if-in-upstream\" we handle _only_ ranges \n(a..b), where we treat the left part as the upstream, so we first parse \nall the diffs in b..a, and then ignore all commits in a..b which have an \nalready-seen diff hash.\n\nHowever, if we want to do the logical analogue with \"-22 HEAD\", the \nequivalent to b..a would trivially contain no commits at all.\n\n>    Likes, dislikes?\n\nIt sure is supported by the principle of least surprise.\n\nCiao,\nDscho\n"},{"id":"31948","messageId":"200701180818.12372.andyparkins@gmail.com","threadId":"6414","inReplyTo":"7vhcupp81v.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: [PATCH - todo] Changes to e-mailed patch handling in v1.5.0","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-01-18T08:18:08Z","receivedAt":"2007-01-18T08:18:08Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Wednesday 2007 January 17 23:06, Junio C Hamano wrote:\n\n> I am neutral about changing the default suffix from .txt to .patch;\n> comments?\n\nI'm in favour.  The extension indicates file type, and gives guidance on the \ntool that can read it. Though .patch is stored in text it's more than that \n(c.f. .html) - the text inside it has meaning beyond just the text.\n\nTo me, .txt would implies that the file format is in human-language format \n(i.e. words, sentences, and paragraphs).\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIEE\nandyparkins@gmail.com\n"},{"id":"31985","messageId":"00691964-B639-4EEA-968D-A6BB65DC3DC8@silverinsanity.com","threadId":"6414","inReplyTo":"200701180818.12372.andyparkins@gmail.com","subject":"Re: [PATCH - todo] Changes to e-mailed patch handling in v1.5.0","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-01-18T15:13:07Z","receivedAt":"2007-01-18T15:13:07Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Jan 18, 2007, at 3:18 AM, Andy Parkins wrote:\n\n> On Wednesday 2007 January 17 23:06, Junio C Hamano wrote:\n>\n>> I am neutral about changing the default suffix from .txt to .patch;\n>> comments?\n>\n> I'm in favour.  The extension indicates file type, and gives  \n> guidance on the\n> tool that can read it. Though .patch is stored in text it's more  \n> than that\n> (c.f. .html) - the text inside it has meaning beyond just the text.\n>\n> To me, .txt would implies that the file format is in human-language  \n> format\n> (i.e. words, sentences, and paragraphs).\n\nDitto.\n\nAlso, Vim nicely detects the From <SHA1> line at the top and thinks  \nthat it's an mbox file.  With the patch extension it ignores that and  \ngives me my diff coloring again.\n\n~~ Brian\n"}]}