{"thread":{"id":"44414","subject":"How can I tell, from a script, if “git cherry-pick” fails?","startedAt":"2016-11-02T15:14:58Z","lastAt":"2016-11-02T15:36:39Z","messageCount":3,"participants":["Kevin Layer","Pranit Bauva"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"305294","messageId":"CAGSZTjKg1=tMYgFiwys=ePVT+3p6KTa1mQ0fP9pPns-Nvd+6fA@mail.gmail.com","threadId":"44414","inReplyTo":null,"subject":"How can I tell, from a script, if “git cherry-pick” fails?","fromName":"Kevin Layer","fromEmail":"layer@known.net","sentAt":"2016-11-02T15:14:49Z","receivedAt":"2016-11-02T15:14:58Z","isPatch":false,"sender":{"key":"layer@known.net","avatar":null},"body":"If the cherry-pick fails due to a merge conflict, it just returns an\nexit status of 0.  I have a script that does a series of cherry-picks\nand I need to know if they succeed.\n\nI'm sure this has been covered before.\n\nUsing git version 1.8.3.1.\n\nThank you.\n\nKevin\n"},{"id":"305295","messageId":"CAGSZTjLreF1Uj5cARt6=1vMUDCrbSQ11ZbCin7YzYGZdEmR3fg@mail.gmail.com","threadId":"44414","inReplyTo":"CAGSZTjKg1=tMYgFiwys=ePVT+3p6KTa1mQ0fP9pPns-Nvd+6fA@mail.gmail.com","subject":"Re: How can I tell, from a script, if “git cherry-pick” fails?","fromName":"Kevin Layer","fromEmail":"layer@known.net","sentAt":"2016-11-02T15:32:34Z","receivedAt":"2016-11-02T15:32:41Z","isPatch":false,"sender":{"key":"layer@known.net","avatar":null},"body":"Nevermind.  It's working as it should.  The script that was doing the\ncherry-pick was doing it in an if and I neglected to exit with a\nnon-zero status.  Sorry for the noise.\n\nOn Wed, Nov 2, 2016 at 8:14 AM, Kevin Layer <layer@known.net> wrote:\n> If the cherry-pick fails due to a merge conflict, it just returns an\n> exit status of 0.  I have a script that does a series of cherry-picks\n> and I need to know if they succeed.\n>\n> I'm sure this has been covered before.\n>\n> Using git version 1.8.3.1.\n>\n> Thank you.\n>\n> Kevin\n"},{"id":"305296","messageId":"CAFZEwPP1XyE+X6ipes4JNsUz3JVS+ErbLfQ-zYXZ3KA75bho5Q@mail.gmail.com","threadId":"44414","inReplyTo":"CAGSZTjKg1=tMYgFiwys=ePVT+3p6KTa1mQ0fP9pPns-Nvd+6fA@mail.gmail.com","subject":"Re: How can I tell, from a script, if “git cherry-pick” fails?","fromName":"Pranit Bauva","fromEmail":"pranit.bauva@gmail.com","sentAt":"2016-11-02T15:36:33Z","receivedAt":"2016-11-02T15:36:39Z","isPatch":false,"sender":{"key":"pranit.bauva@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2959938?v=4"},"body":"Hey Kevin,\n\nOn Wed, Nov 2, 2016 at 8:44 PM, Kevin Layer <layer@known.net> wrote:\n> If the cherry-pick fails due to a merge conflict, it just returns an\n> exit status of 0.  I have a script that does a series of cherry-picks\n> and I need to know if they succeed.\n\nWell, I haven't checked what it returns in git 2.10, but you can\nalways redirect the stdout and stderr to the output and grep for the\ntext which it shows in the actual output. Here[1] is an example of how\nto do it.\n\n[1]: https://github.com/git/git/blob/master/t/t3507-cherry-pick-conflict.sh#L42-L55\n\nRegards,\nPranit Bauva\n"}]}