{"thread":{"id":"27633","subject":"Re: Patch-level-format conversion","startedAt":"2011-06-15T20:55:07Z","lastAt":"2011-06-15T22:28:14Z","messageCount":4,"participants":["Jonathan Nieder","Sedat Dilek","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"170083","messageId":"20110615205507.GB27172@elie","threadId":"27633","inReplyTo":"BANLkTimRArtFBqA4BFASjkS9BC1sbSfUJQ@mail.gmail.com","subject":"Re: Patch-level-format conversion","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-06-15T20:55:07Z","receivedAt":"2011-06-15T20:55:07Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: the git list so others can correct me.  I hope that's okay.)\n\nHi,\n\nSedat Dilek wrote:\n\n> I have here a patchset extracted from my own git-repo (via git format-patch).\n>\n> The project for which those patches are want \"p0\" format, means no\n> ---- a/... +++ b/... but --- ... +++ ...\n>\n> IIRC git does \"p1\" format as default.\n> Any help? Idea?\n\nIf I understand correctly, you are in luck.  The \"git format-patch\n--no-prefix\" command thanks to Dscho seems to do exactly that:\n\n $ git log -Sno-prefix -- Documentation/diff-options.txt\n commit eab9a40b6dd5c1c571b1deb264133db47bb4794d\n Author: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n Date:   Tue Dec 18 19:32:14 2007 +0000\n\n     Teach diff machinery to display other prefixes than \"a/\" and \"b/\"\n\n     With the new options \"--src-prefix=<prefix>\", \"--dst-prefix=<prefix>\"\n     and \"--no-prefix\", you can now control the path prefixes of the diff\n     machinery.  These used to by hardwired to \"a/\" for the source prefix\n     and \"b/\" for the destination prefix.\n\n     Initial patch by Pascal Obry.  Sane option names suggested by Linus.\n\n     Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n     Acked-by: Linus Torvalds <torvalds@linux-foundation.org>\n     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nHope that helps.\nJonathan\n"},{"id":"170086","messageId":"BANLkTim8bdVGo8u_HzZpE_5+xmPe_O+_Dw@mail.gmail.com","threadId":"27633","inReplyTo":"20110615205507.GB27172@elie","subject":"Re: Patch-level-format conversion","fromName":"Sedat Dilek","fromEmail":"sedat.dilek@googlemail.com","sentAt":"2011-06-15T21:16:54Z","receivedAt":"2011-06-15T21:16:54Z","isPatch":false,"sender":{"key":"sedat.dilek@googlemail.com","avatar":null},"body":"On Wed, Jun 15, 2011 at 10:55 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> (+cc: the git list so others can correct me.  I hope that's okay.)\n>\n> Hi,\n>\n> Sedat Dilek wrote:\n>\n>> I have here a patchset extracted from my own git-repo (via git format-patch).\n>>\n>> The project for which those patches are want \"p0\" format, means no\n>> ---- a/... +++ b/... but --- ... +++ ...\n>>\n>> IIRC git does \"p1\" format as default.\n>> Any help? Idea?\n>\n> If I understand correctly, you are in luck.  The \"git format-patch\n> --no-prefix\" command thanks to Dscho seems to do exactly that:\n>\n>  $ git log -Sno-prefix -- Documentation/diff-options.txt\n>  commit eab9a40b6dd5c1c571b1deb264133db47bb4794d\n>  Author: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n>  Date:   Tue Dec 18 19:32:14 2007 +0000\n>\n>     Teach diff machinery to display other prefixes than \"a/\" and \"b/\"\n>\n>     With the new options \"--src-prefix=<prefix>\", \"--dst-prefix=<prefix>\"\n>     and \"--no-prefix\", you can now control the path prefixes of the diff\n>     machinery.  These used to by hardwired to \"a/\" for the source prefix\n>     and \"b/\" for the destination prefix.\n>\n>     Initial patch by Pascal Obry.  Sane option names suggested by Linus.\n>\n>     Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>     Acked-by: Linus Torvalds <torvalds@linux-foundation.org>\n>     Signed-off-by: Junio C Hamano <gitster@pobox.com>\n>\n> Hope that helps.\n> Jonathan\n>\n\nHi Jonathan,\n\nI played a bit with git format-patch and git diff and got some helpful\nhints from friends of #grml and #quassel.de.\nAttached is the README.txt I produced some hours ago.\n\nRegards,\n- Sedat -\n\n\nQ: How to generate freetz-conform patches out of a GIT repository?\n\nA. Follow these instructions.\n\n### Checkout freetz development branch\nsvn co http://svn.freetz.org/trunk/ freetz-trunk\ncd freetz-trunk/\n\n### Get latest revision\nrevision=$(LC_ALL=C svn info | grep \"Last Changed Rev\" | awk {'print $4'})\necho $revision\n\n### Turn freetz-trunk source-dir into a GIT repository\ngit add --ignore-errors ./ ; git commit -m \"`basename $PWD` SVN revision $revision\"\n\n### Edit some files and save changes\n$EDITOR file1 file2\n\n### Extract patchset\ngit format-patch --no-prefix --no-numbered $FIRST..$LAST\n\n### Some git format-patch options explained:\n      --no-prefix: Do not show any source or destination prefix.\n   -n, --numbered: Name output in [PATCH n/m] format, even with a single patch.\n-N, --no-numbered: Name output in [PATCH] format.\n\n\n- Sedat Dilek <sedat.dilek@gmail.com> (15-Jun-2011)\n"},{"id":"170087","messageId":"7v39jakajn.fsf@alter.siamese.dyndns.org","threadId":"27633","inReplyTo":"BANLkTim8bdVGo8u_HzZpE_5+xmPe_O+_Dw@mail.gmail.com","subject":"Re: Patch-level-format conversion","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-06-15T22:13:48Z","receivedAt":"2011-06-15T22:13:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sedat Dilek <sedat.dilek@googlemail.com> writes:\n\n> I played a bit with git format-patch and git diff and got some helpful\n> hints from friends of #grml and #quassel.de.\n> Attached is the README.txt I produced some hours ago.\n>\n> Regards,\n> - Sedat -\n>\n> Q: How to generate freetz-conform patches out of a GIT repository?\n>\n> A. Follow these instructions.\n>\n> ### Checkout freetz development branch\n> svn co http://svn.freetz.org/trunk/ freetz-trunk\n> cd freetz-trunk/\n>\n> ### Get latest revision\n> revision=$(LC_ALL=C svn info | grep \"Last Changed Rev\" | awk {'print $4'})\n> echo $revision\n>\n> ### Turn freetz-trunk source-dir into a GIT repository\n> git add --ignore-errors ./ ; git commit -m \"`basename $PWD` SVN revision $revision\"\n\nWouldn't \"add ./\" add all the cruft in .svn (and its huge \"pristine\"\nsubdirectory)?  Why --ignore-errors?\n\n> ### Edit some files and save changes\n> $EDITOR file1 file2\n>\n> ### Extract patchset\n> git format-patch --no-prefix --no-numbered $FIRST..$LAST\n\nYou would need to record your own changes made by the $EDITOR step in\ncommits before asking format-patch to make patch files out of them, but I\ndo not see that step.\n\nAlso it is unclear how you determine $FIRST and $LAST.  FIRST must name\nthe commit that is the _parent_ of your first commit (i.e. your sample\ncommand line tells $FIRST to be excluded).\n\n> ### Some git format-patch options explained:\n>       --no-prefix: Do not show any source or destination prefix.\n>    -n, --numbered: Name output in [PATCH n/m] format, even with a single patch.\n> -N, --no-numbered: Name output in [PATCH] format.\n>\n>\n> - Sedat Dilek <sedat.dilek@gmail.com> (15-Jun-2011)\n"},{"id":"170088","messageId":"BANLkTi=w1SP6zEZGs1WQ_2L0bWQ2cneNSQ@mail.gmail.com","threadId":"27633","inReplyTo":"7v39jakajn.fsf@alter.siamese.dyndns.org","subject":"Re: Patch-level-format conversion","fromName":"Sedat Dilek","fromEmail":"sedat.dilek@googlemail.com","sentAt":"2011-06-15T22:28:14Z","receivedAt":"2011-06-15T22:28:14Z","isPatch":false,"sender":{"key":"sedat.dilek@googlemail.com","avatar":null},"body":"Hi Junio,\n\nOn Thu, Jun 16, 2011 at 12:13 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Sedat Dilek <sedat.dilek@googlemail.com> writes:\n>\n>> I played a bit with git format-patch and git diff and got some helpful\n>> hints from friends of #grml and #quassel.de.\n>> Attached is the README.txt I produced some hours ago.\n>>\n>> Regards,\n>> - Sedat -\n>>\n>> Q: How to generate freetz-conform patches out of a GIT repository?\n>>\n>> A. Follow these instructions.\n>>\n>> ### Checkout freetz development branch\n>> svn co http://svn.freetz.org/trunk/ freetz-trunk\n>> cd freetz-trunk/\n>>\n>> ### Get latest revision\n>> revision=$(LC_ALL=C svn info | grep \"Last Changed Rev\" | awk {'print $4'})\n>> echo $revision\n>>\n>> ### Turn freetz-trunk source-dir into a GIT repository\n>> git add --ignore-errors ./ ; git commit -m \"`basename $PWD` SVN revision $revision\"\n>\n> Wouldn't \"add ./\" add all the cruft in .svn (and its huge \"pristine\"\n> subdirectory)?  Why --ignore-errors?\n>\n\nI used to use it after reading the blog-post in [1].\n\n>> ### Edit some files and save changes\n>> $EDITOR file1 file2\n>>\n>> ### Extract patchset\n>> git format-patch --no-prefix --no-numbered $FIRST..$LAST\n>\n> You would need to record your own changes made by the $EDITOR step in\n> commits before asking format-patch to make patch files out of them, but I\n> do not see that step.\n>\n\nOoops, yeah missed the git commit command(s) :-(.\nThanks for the pointer!\n\n> Also it is unclear how you determine $FIRST and $LAST.  FIRST must name\n> the commit that is the _parent_ of your first commit (i.e. your sample\n> command line tells $FIRST to be excluded).\n>\n\nIt's just an example...\nIIRC I really did \"git format-patch --no-prefix -19\" (extract last 19 commits).\nHmmm, remember I got no \"origine\" for initial commit...\n\n>> ### Some git format-patch options explained:\n>>       --no-prefix: Do not show any source or destination prefix.\n>>    -n, --numbered: Name output in [PATCH n/m] format, even with a single patch.\n>> -N, --no-numbered: Name output in [PATCH] format.\n>>\n>>\n>> - Sedat Dilek <sedat.dilek@gmail.com> (15-Jun-2011)\n>\n\n- Sedat -\n\n[1] http://who-t.blogspot.com/2009/06/git-patches-from-tarballs.html\n"}]}