aboutsummaryrefslogtreecommitdiff
path: root/t/t3511-cherry-pick-x.sh
Commit message (Collapse)AuthorAge
* t/t3511-cherry-pick-x.sh: use the $( ... ) construct for command substitutionElia Pinto2015-12-28
| | | | | | | | | | | | | | | | | | | | | | | The Git CodingGuidelines prefer the $(...) construct for command substitution instead of using the backquotes `...`. The backquoted form is the traditional method for command substitution, and is supported by POSIX. However, all but the simplest uses become complicated quickly. In particular, embedded command substitutions and/or the use of double quotes require careful escaping with the backslash character. The patch was generated by: for _f in $(find . -name "*.sh") do perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}" done and then carefully proof-read. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* sequencer: preserve commit messagesMichael J Gruber2015-03-06
| | | | | | | | | | | | | | | sequencer calls "commit" with default options, which implies "--cleanup=default" unless the user specified something else in their config. This leads to cherry-picked commits getting a cleaned up commit message, which is usually not an intended side-effect. Make the sequencer use "--cleanup=verbatim" so that it preserves commit messages independent of the default, unless the user has set config for "commit" or the message is amended with -s or -x. Reported-by: Christoph Anton Mitterer <calestyo@scientia.net> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* sequencer.c: teach append_signoff how to detect duplicate s-o-bBrandon Casey2013-02-12
| | | | | | | | | | | Teach append_signoff how to detect a duplicate s-o-b in the commit footer. This is in preparation to unify the append_signoff implementations in log-tree.c and sequencer.c. Fixes test in t3511. Signed-off-by: Brandon Casey <bcasey@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* sequencer.c: always separate "(cherry picked from" from commit bodyBrandon Casey2013-02-12
| | | | | | | | | | | | Start treating the "(cherry picked from" line added by cherry-pick -x the same way that the s-o-b lines are treated. Namely, separate them from the main commit message body with an empty line. Introduce tests to test this functionality. Signed-off-by: Brandon Casey <bcasey@nvidia.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footerBrandon Casey2013-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | When 'cherry-pick -s' is used to append a signed-off-by line to a cherry picked commit, it does not currently detect the "(cherry picked from..." that may have been appended by a previous 'cherry-pick -x' as part of the s-o-b footer and it will insert a blank line before appending a new s-o-b. Let's detect "(cherry picked from...)" as part of the footer so that we will produce this: Signed-off-by: A U Thor <author@example.com> (cherry picked from da39a3ee5e6b4b0d3255bfef95601890afd80709) Signed-off-by: C O Mmitter <committer@example.com> instead of this: Signed-off-by: A U Thor <author@example.com> (cherry picked from da39a3ee5e6b4b0d3255bfef95601890afd80709) Signed-off-by: C O Mmitter <committer@example.com> [with improvements from Jonathan Nieder] Signed-off-by: Brandon Casey <bcasey@nvidia.com> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t/t3511: add some tests of 'cherry-pick -s' functionalityBrandon Casey2013-02-12
Add some tests to ensure that 'cherry-pick -s' operates in the following manner: * Inserts a blank line before appending a s-o-b to a commit message that does not contain a s-o-b footer * Does not mistake first line "subject: description" as a s-o-b footer * Does not mistake single word message body as conforming to rfc2822 * Appends a s-o-b when last s-o-b in footer does not match committer s-o-b, even when committer's s-o-b exists elsewhere in footer. * Does not append a s-o-b when last s-o-b matches committer s-o-b * Correctly detects a non-conforming footer containing a mix of s-o-b like elements and s-o-b elements. (marked "expect failure") Signed-off-by: Brandon Casey <bcasey@nvidia.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>