{"thread":{"id":"1765","subject":"git-rev-list and git-format-patch script oddness","startedAt":"2005-09-11T08:52:51Z","lastAt":"2005-09-12T12:03:07Z","messageCount":9,"participants":["Martin Langhoff","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"8273","messageId":"46a038f905091101529e045af@mail.gmail.com","threadId":"1765","inReplyTo":null,"subject":"git-rev-list and git-format-patch script oddness","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-09-11T08:52:51Z","receivedAt":"2005-09-11T08:52:51Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"When I run git-format-patch, it insists on outputting merges that have\nalready been merged upstream, regardless of the fact that\ngit-merge-base knows better.\n\nIs there a way to get it to skip merged-in patches that git already\nhas detected as merged upstream?\n\ncheers,\n\nmartin\n"},{"id":"8275","messageId":"Pine.LNX.4.63.0509111120020.32244@wgmdd8.biozentrum.uni-wuerzburg.de","threadId":"1765","inReplyTo":"46a038f905091101529e045af@mail.gmail.com","subject":"Re: git-rev-list and git-format-patch script oddness","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-09-11T09:20:49Z","receivedAt":"2005-09-11T09:20:49Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 11 Sep 2005, Martin Langhoff wrote:\n\n> When I run git-format-patch, it insists on outputting merges that have\n> already been merged upstream, regardless of the fact that\n> git-merge-base knows better.\n> \n> Is there a way to get it to skip merged-in patches that git already\n> has detected as merged upstream?\n\nI always use something like\n\n\tgit-format-patch HEAD ^origin\n\nHth,\nDscho\n"},{"id":"8321","messageId":"7voe6zqr9y.fsf@assigned-by-dhcp.cox.net","threadId":"1765","inReplyTo":"46a038f905091101529e045af@mail.gmail.com","subject":"[PATCH] Omit patches that have already been merged from format-patch output.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-11T20:32:41Z","receivedAt":"2005-09-11T20:32:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This switches the logic to pick which commits to include in the output\nfrom git-rev-list to git-cherry; as a side effect, 'format-patch ^up mine'\nwould stop working, although up..mine would continue to work.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n Martin Langhoff <martin.langhoff@gmail.com> writes:\n\n > When I run git-format-patch, it insists on outputting merges that have\n > already been merged upstream, regardless of the fact that\n > git-merge-base knows better.\n >\n > Is there a way to get it to skip merged-in patches that git already\n > has detected as merged upstream?\n >\n > cheers,\n >\n > martin\n\n This is what the format-patch should have been from the beginning,\n although for hysterical raisins it was not the case (it predates\n git-cherry).  One thing I am reluctant about this is it breaks the\n exact example Johannes just posted.\n\n git-format-patch.sh |   38 +++++++++++++++++++++++++++-----------\n 1 files changed, 27 insertions(+), 11 deletions(-)\n\n9798f6dad84c9c3e39ed05c91d8e97fe4abc9222\ndiff --git a/git-format-patch.sh b/git-format-patch.sh\n--- a/git-format-patch.sh\n+++ b/git-format-patch.sh\n@@ -27,8 +27,6 @@ with applymbox.\n }\n \n diff_opts=\n-IFS='\n-'\n LF='\n '\n \n@@ -61,7 +59,10 @@ do\n     --output-directo|--output-director|--output-directory)\n     case \"$#\" in 1) usage ;; esac; shift\n     outdir=\"$1\" ;;\n-    -*)\tdiff_opts=\"$diff_opts$LF$1\" ;;\n+    -*' '* | -*\"$LF\"* | -*'\t'*)\n+\t# Ignore diff option that has whitespace for now.\n+\t;;\n+    -*)\tdiff_opts=\"$diff_opts$1 \" ;;\n     *) break ;;\n     esac\n     shift\n@@ -72,16 +73,20 @@ tt)\n \tdie '--keep-subject and --numbered are incompatible.' ;;\n esac\n \n-revpair=\n+rev1= rev2=\n case \"$#\" in\n 2)\n-    revpair=\"$1..$2\" ;;\n+    rev1=\"$1\" rev2=\"$2\" ;;\n 1)\n     case \"$1\" in\n     *..*)\n-    \trevpair=\"$1\";;\n+\trev1=`expr \"$1\" : '\\(.*\\)\\.\\.'`\n+\trev2=`expr \"$1\" : '.*\\.\\.\\(.*\\)'`\n+\t;;\n     *)\n-\trevpair=\"$1..HEAD\";;\n+        rev1=\"$1\"\n+\trev2=\"HEAD\"\n+\t;;\n     esac ;;\n *)\n     usage ;;\n@@ -127,10 +132,21 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0\n _x40=\"$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40\"\n stripCommitHead='/^'\"$_x40\"' (from '\"$_x40\"')$/d'\n \n-git-rev-list --no-merges --merge-order \\\n-\t$(git-rev-parse --revs-only \"$revpair\") >$series\n+git-cherry -v \"$rev1\" \"$rev2\" |\n+while read sign rev comment\n+do\n+\tcase \"$sign\" in\n+\t'-')\n+\t\techo >&2 \"Merged already: $comment\"\n+\t\t;;\n+\t*)\n+\t\techo $rev\n+\t\t;;\n+\tesac\n+done >$series\n+\n total=`wc -l <$series | tr -dc \"[0-9]\"`\n-i=$total\n+i=1\n while read commit\n do\n     git-cat-file commit \"$commit\" | git-stripspace >$commsg\n@@ -145,7 +161,7 @@ do\n     esac\n \n     file=`printf '%04d-%stxt' $i \"$title\"`\n-    i=`expr \"$i\" - 1`\n+    i=`expr \"$i\" + 1`\n     echo \"* $file\"\n     {\n \tmailScript='\n"},{"id":"8327","messageId":"46a038f90509111408f9479e2@mail.gmail.com","threadId":"1765","inReplyTo":"7voe6zqr9y.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Omit patches that have already been merged from format-patch output.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-09-11T21:08:45Z","receivedAt":"2005-09-11T21:08:45Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":">  git-cherry).  One thing I am reluctant about this is it breaks the\n>  exact example Johannes just posted.\n\nWell, Johannes example didn't work at all for me. Output was empty,\nwhen I was expecting 4~6 entries.\n\ncheers,\n\nmartin\n"},{"id":"8328","messageId":"46a038f905091114106e6e7943@mail.gmail.com","threadId":"1765","inReplyTo":"7voe6zqr9y.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Omit patches that have already been merged from format-patch output.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-09-11T21:10:45Z","receivedAt":"2005-09-11T21:10:45Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 9/12/05, Junio C Hamano <junkio@cox.net> wrote:\n> This switches the logic to pick which commits to include in the output\n> from git-rev-list to git-cherry; as a side effect, 'format-patch ^up mine'\n> would stop working, although up..mine would continue to work.\n\nAlso -- forgot to say thanks for this. I'm interested in porting this\nto cg-log as an option.\n\nBTW, anyone heard of Baudis lately?\n\ncheers,\n\n\nmartin\n"},{"id":"8366","messageId":"46a038f905091200245f6330d9@mail.gmail.com","threadId":"1765","inReplyTo":"7voe6zqr9y.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Omit patches that have already been merged from format-patch output.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-09-12T07:24:30Z","receivedAt":"2005-09-12T07:24:30Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 9/12/05, Junio C Hamano <junkio@cox.net> wrote:\n> This switches the logic to pick which commits to include in the output\n> from git-rev-list to git-cherry; as a side effect, 'format-patch ^up mine'\n> would stop working, although up..mine would continue to work.\n> \n\nHmmm - git-format-patch is now broken. Not sure if it's been this\nparticular commit or a change in git-rev-list. The bottom line is that\nit will only create patches for my commits since the last merge.\n\nThis is broken when I work for a few days, merging often from my\nupstream. At the end of the dev cycle, I want to generate the\npatchbomb for upstream, and it only gives me the commits since the\nlast merge-in of upstream.\n\nOTOH, git-log-script is doing the same since I've updated today.\nYesterday, both commands were behaving themselves...\n\ncheers,\n\nmartin\n"},{"id":"8369","messageId":"46a038f905091202343306846@mail.gmail.com","threadId":"1765","inReplyTo":"46a038f905091200245f6330d9@mail.gmail.com","subject":"Re: [PATCH] Omit patches that have already been merged from format-patch output.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-09-12T09:34:30Z","receivedAt":"2005-09-12T09:34:30Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"> Hmmm - git-format-patch is now broken. \n\nStrike that. PEBCAK: my branch entry was pointing to the wrong place. Sorry. \n\n\n\nmartin\n"},{"id":"8372","messageId":"7voe6yik0o.fsf@assigned-by-dhcp.cox.net","threadId":"1765","inReplyTo":"46a038f905091202343306846@mail.gmail.com","subject":"Re: [PATCH] Omit patches that have already been merged from format-patch output.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-12T11:48:55Z","receivedAt":"2005-09-12T11:48:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Langhoff <martin.langhoff@gmail.com> writes:\n\n> Strike that. PEBCAK: my branch entry was pointing to the wrong place. Sorry. \n\nThanks for quick correction.  Just from a curiosity, do you run\nGIT from the proposed updates branch?  I am asking because that\nsuspect git-format-patch change is supposed to be only in there.\n\nI am somewhat seriously curious.  How many of you on the list\nregularly look at what is in the proposed updates, and how many\nof you actually run it?\n"},{"id":"8373","messageId":"46a038f9050912050367418617@mail.gmail.com","threadId":"1765","inReplyTo":"7voe6yik0o.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Omit patches that have already been merged from format-patch output.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2005-09-12T12:03:07Z","receivedAt":"2005-09-12T12:03:07Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 9/12/05, Junio C Hamano <junkio@cox.net> wrote:\n> Martin Langhoff <martin.langhoff@gmail.com> writes:\n> \n> > Strike that. PEBCAK: my branch entry was pointing to the wrong place. Sorry.\n> \n> Thanks for quick correction.  Just from a curiosity, do you run\n> GIT from the proposed updates branch?  I am asking because that\n> suspect git-format-patch change is supposed to be only in there.\n \nI'm running git on ~5 different machines. On the box where I do my\ndevelopment, I have both 'master' and 'pu' checkouts, but mostly\nmaster. Elsewhere, I track master, with updates every few days, when\nmy gut feeling is that things aren't too risky. On the servers (add ~4\nservers to the list), I deploy only tagged versions, usually from the\nDebian package.\n\nAnd it was a total PEBCAK. I had just pulled in your latest merges to\nmaster and built/installed on a dev box, things were looking odd and I\njumped the gun badly. As you point out, I didn't even have the patch\nin.\n\ncheers,\n\n\nmartin\n"}]}