{"thread":{"id":"10380","subject":"[PATCH] git-cherry-pick: improve description of -x.","startedAt":"2007-10-19T17:41:34Z","lastAt":"2007-10-22T05:19:08Z","messageCount":6,"participants":["Ralf Wildenhues","Frank Lichtenheld","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"56606","messageId":"20071019174134.GD9906@ins.uni-bonn.de","threadId":"10380","inReplyTo":null,"subject":"[PATCH] git-cherry-pick: improve description of -x.","fromName":"Ralf Wildenhues","fromEmail":"ralf.wildenhues@gmx.de","sentAt":"2007-10-19T17:41:34Z","receivedAt":"2007-10-19T17:41:34Z","isPatch":true,"sender":{"key":"ralf.wildenhues@gmx.de","avatar":null},"body":"Reword the first sentence of the description of -x, in order to\nmake it easier to read and understand.\n\nSigned-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>\n---\n\nI have two issues with \"git-cherry-pick -x\": When reading its manpage\ndescription for the first time, I completely failed to understand the\nfirst sentence, and had to try it out in order to understand.\n\nFurther, I am surprised that -x seems to be nonfunctional when the\ncherry pick introduces a conflict.  Example:\n  git init\n  echo >dummy\n  git add dummy\n  git commit -m dummy\n  git checkout -b br\n  echo one >file\n  git add file\n  git commit -m one\n  echo two >>file\n  git commit -a -m two\n  git checkout master\n  git cherry-pick -x br         # conflict, tells me \"-c ...\" arg to use\n                                # for the commit later\n  echo '1d\n  w' | ed file                  # resolve conflict\n  git add file\n  git commit -c ...\n\nThe prototype commit message now does not contain the\n| (cherry picked from commit ...).\n\nIs that by design (because there were conflicts) or an omission?\nIn case of the former, maybe the description of -x should mention this.\n\nThanks,\nRalf\n\n Documentation/git-cherry-pick.txt |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex 47b1e8c..c7d83ce 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -27,10 +27,10 @@ OPTIONS\n \tmessage prior committing.\n \n -x::\n-\tCause the command to append which commit was\n-\tcherry-picked after the original commit message when\n-\tmaking a commit.  Do not use this option if you are\n-\tcherry-picking from your private branch because the\n+\tWhen recording the commit, the original commit message will\n+\tbe appended with a note that indicates which commit this\n+\tchange was cherry-picked from.  Do not use this option if\n+\tyou are cherry-picking from your private branch because the\n \tinformation is useless to the recipient.  If on the\n \tother hand you are cherry-picking between two publicly\n \tvisible branches (e.g. backporting a fix to a\n-- \n1.5.3.1.153.g89df5\n"},{"id":"56633","messageId":"20071019211152.GN3917@planck.djpig.de","threadId":"10380","inReplyTo":"20071019174134.GD9906@ins.uni-bonn.de","subject":"Re: [PATCH] git-cherry-pick: improve description of -x.","fromName":"Frank Lichtenheld","fromEmail":"frank@lichtenheld.de","sentAt":"2007-10-19T21:11:52Z","receivedAt":"2007-10-19T21:11:52Z","isPatch":true,"sender":{"key":"frank@lichtenheld.de","avatar":"https://gravatar.com/avatar/b9f1d4b120e138f157c9e480d0818197c474628923786adb98f30017cdb99c3c?d=mp&s=160"},"body":"On Fri, Oct 19, 2007 at 07:41:34PM +0200, Ralf Wildenhues wrote:\n> Further, I am surprised that -x seems to be nonfunctional when the\n> cherry pick introduces a conflict.  Example:\n[...]\n> The prototype commit message now does not contain the\n> | (cherry picked from commit ...).\n> \n> Is that by design (because there were conflicts) or an omission?\n> In case of the former, maybe the description of -x should mention this.\n\ngit commit currently doesn't know that you commit a cherry-pick. The -c\nonly says to use the commit message of the original commit. So this is\ncurrently by design.\n\n> diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\n> index 47b1e8c..c7d83ce 100644\n> --- a/Documentation/git-cherry-pick.txt\n> +++ b/Documentation/git-cherry-pick.txt\n> @@ -27,10 +27,10 @@ OPTIONS\n>  \tmessage prior committing.\n>  \n>  -x::\n> -\tCause the command to append which commit was\n> -\tcherry-picked after the original commit message when\n> -\tmaking a commit.  Do not use this option if you are\n> -\tcherry-picking from your private branch because the\n> +\tWhen recording the commit, the original commit message will\n> +\tbe appended with a note that indicates which commit this\n> +\tchange was cherry-picked from.  Do not use this option if\n> +\tyou are cherry-picking from your private branch because the\n\nIs \"will be appended with\" correct English? Sounds odd to me (but I'm no\nnative speaker, so it might be perfectly fine).\n\nGruesse,\n-- \nFrank Lichtenheld <frank@lichtenheld.de>\nwww: http://www.djpig.de/\n"},{"id":"56648","messageId":"20071020031917.GR14735@spearce.org","threadId":"10380","inReplyTo":"20071019211152.GN3917@planck.djpig.de","subject":"Re: [PATCH] git-cherry-pick: improve description of -x.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-10-20T03:19:17Z","receivedAt":"2007-10-20T03:19:17Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Frank Lichtenheld <frank@lichtenheld.de> wrote:\n> On Fri, Oct 19, 2007 at 07:41:34PM +0200, Ralf Wildenhues wrote:\n> > Further, I am surprised that -x seems to be nonfunctional when the\n> > cherry pick introduces a conflict.  Example:\n> [...]\n> > The prototype commit message now does not contain the\n> > | (cherry picked from commit ...).\n> > \n> > Is that by design (because there were conflicts) or an omission?\n> > In case of the former, maybe the description of -x should mention this.\n> \n> git commit currently doesn't know that you commit a cherry-pick. The -c\n> only says to use the commit message of the original commit. So this is\n> currently by design.\n\nRalf, can you submit an updated version of this patch that describes\nthe current behavior better, given the \"by design\" remark above\nfrom Frank?\n \n-- \nShawn.\n"},{"id":"56762","messageId":"20071021093618.GC12794@ins.uni-bonn.de","threadId":"10380","inReplyTo":"20071020031917.GR14735@spearce.org","subject":"Re: [PATCH] git-cherry-pick: improve description of -x.","fromName":"Ralf Wildenhues","fromEmail":"ralf.wildenhues@gmx.de","sentAt":"2007-10-21T09:36:19Z","receivedAt":"2007-10-21T09:36:19Z","isPatch":true,"sender":{"key":"ralf.wildenhues@gmx.de","avatar":null},"body":"Reword the first sentence of the description of -x, in order to\nmake it easier to read and understand.\n\nSigned-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>\n---\n\n* Shawn O. Pearce wrote on Sat, Oct 20, 2007 at 05:19:17AM CEST:\n> Frank Lichtenheld <frank@lichtenheld.de> wrote:\n> > On Fri, Oct 19, 2007 at 07:41:34PM +0200, Ralf Wildenhues wrote:\n> > > \n> > > Is that by design (because there were conflicts) or an omission?\n> > > In case of the former, maybe the description of -x should mention this.\n> > \n> > git commit currently doesn't know that you commit a cherry-pick. The -c\n> > only says to use the commit message of the original commit. So this is\n> > currently by design.\n> \n> Ralf, can you submit an updated version of this patch that describes\n> the current behavior better, given the \"by design\" remark above\n> from Frank?\n\nHere it goes.  Still makes me wonder whether that is the ideal mode of\noperation or not.\n\nFWIW, I think the previous passive voice wording was correct English,\nbut here's a rewrite using mostly active voice (sound nicer anyway).\n\nCheers,\nRalf\n\n Documentation/git-cherry-pick.txt |   11 ++++++-----\n 1 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex 47b1e8c..76a2edf 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -27,11 +27,12 @@ OPTIONS\n \tmessage prior committing.\n \n -x::\n-\tCause the command to append which commit was\n-\tcherry-picked after the original commit message when\n-\tmaking a commit.  Do not use this option if you are\n-\tcherry-picking from your private branch because the\n-\tinformation is useless to the recipient.  If on the\n+\tWhen recording the commit, append to the original commit\n+\tmessage a note that indicates which commit this change\n+\twas cherry-picked from.  Append the note only for cherry\n+\tpicks without conflicts.  Do not use this option if\n+\tyou are cherry-picking from your private branch because\n+\tthe information is useless to the recipient.  If on the\n \tother hand you are cherry-picking between two publicly\n \tvisible branches (e.g. backporting a fix to a\n \tmaintenance branch for an older release from a\n-- \n1.5.3.1.153.g89df5\n"},{"id":"56802","messageId":"20071022051453.GM14735@spearce.org","threadId":"10380","inReplyTo":"20071021093618.GC12794@ins.uni-bonn.de","subject":"Re: [PATCH] git-cherry-pick: improve description of -x.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-10-22T05:14:53Z","receivedAt":"2007-10-22T05:14:53Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Ralf Wildenhues <Ralf.Wildenhues@gmx.de> wrote:\n> * Shawn O. Pearce wrote on Sat, Oct 20, 2007 at 05:19:17AM CEST:\n> > Frank Lichtenheld <frank@lichtenheld.de> wrote:\n> > > On Fri, Oct 19, 2007 at 07:41:34PM +0200, Ralf Wildenhues wrote:\n> > > > \n> > > > Is that by design (because there were conflicts) or an omission?\n> > > > In case of the former, maybe the description of -x should mention this.\n> > > \n> > > git commit currently doesn't know that you commit a cherry-pick. The -c\n> > > only says to use the commit message of the original commit. So this is\n> > > currently by design.\n> > \n> > Ralf, can you submit an updated version of this patch that describes\n> > the current behavior better, given the \"by design\" remark above\n> > from Frank?\n> \n> Here it goes.  Still makes me wonder whether that is the ideal mode of\n> operation or not.\n\nThanks.\n\nI think you are right that the current behavior of -x *not*\nincluding the prior commit SHA-1 in the case of a conflict is wrong.\nThe problem however is that git-commit.sh doesn't get the data\nnecessary to preseve the original author name/email/date/tz unless\nyou use the \"-c $id\" option.  There's some work here to store the\nnecessary information into a file that git-commit.sh could pickup,\nand then making sure stale versions of those files get cleaned up\nproperly, etc.\n\nAt least the current behavior is now documented.  Maybe someone\nwill be bothered enough by it to try and submit a patch that changes\nthe behavior.\n \n-- \nShawn.\n"},{"id":"56803","messageId":"20071022051908.GA16164@ins.uni-bonn.de","threadId":"10380","inReplyTo":"20071022051453.GM14735@spearce.org","subject":"Re: [PATCH] git-cherry-pick: improve description of -x.","fromName":"Ralf Wildenhues","fromEmail":"ralf.wildenhues@gmx.de","sentAt":"2007-10-22T05:19:08Z","receivedAt":"2007-10-22T05:19:08Z","isPatch":true,"sender":{"key":"ralf.wildenhues@gmx.de","avatar":null},"body":"* Shawn O. Pearce wrote on Mon, Oct 22, 2007 at 07:14:53AM CEST:\n> \n> I think you are right that the current behavior of -x *not*\n> including the prior commit SHA-1 in the case of a conflict is wrong.\n> The problem however is that git-commit.sh doesn't get the data\n> necessary to preseve the original author name/email/date/tz unless\n> you use the \"-c $id\" option.\n\nBut the note added by -x is even missing when I add \"-c $id\" to\nthe git-commit command!  That's the point I was trying to make,\nand really the only thing that seemed weird to me.\n\nCheers,\nRalf\n"}]}