@matheusbsbs / matheus-bagliano / commits / abd6970aca
Fork 0

cherry-pick: make -r the default

And introduce -x to expose (possibly) private commit object name for people who cherry-pick between public branches. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Oct 5, 2006 at 17:54 UTC abd6970acad5d758f48c13f7420367ae8216038e
2 files changed +23 -12
Documentation/git-cherry-pick.txt
+16 -7
@@ -7,7 +7,7 @@ git-cherry-pick - Apply the change introduced by an existing commit
7
8 SYNOPSIS
9 --------
10 -'git-cherry-pick' [--edit] [-n] [-r] <commit>
10 +'git-cherry-pick' [--edit] [-n] [-x] <commit>
11
12 DESCRIPTION
13 -----------
@@ -24,13 +24,22 @@ OPTIONS
24 With this option, `git-cherry-pick` will let you edit the commit
25 message prior committing.
26
27 --r|--replay::
28 - Usually the command appends which commit was
27 +-x::
28 + Cause the command to append which commit was
29 cherry-picked after the original commit message when
30 - making a commit. This option, '--replay', causes it to
31 - use the original commit message intact. This is useful
32 - when you are reordering the patches in your private tree
33 - before publishing.
30 + making a commit. Do not use this option if you are
31 + cherry-picking from your private branch because the
32 + information is useless to the recipient. If on the
33 + other hand you are cherry-picking between two publicly
34 + visible branches (e.g. backporting a fix to a
35 + maintenance branch for an older release from a
36 + development branch), adding this information can be
37 + useful.
38 +
39 +-r|--replay::
40 + It used to be that the command defaulted to do `-x`
41 + described above, and `-r` was to disable it. Now the
42 + default is not to do `-x` so this option is a no-op.
43
44 -n|--no-commit::
45 Usually the command automatically creates a commit with
git-revert.sh
+7 -5
@@ -12,13 +12,13 @@ case "$0" in
12 *-cherry-pick* )
13 edit=
14 me=cherry-pick
15 - USAGE='[--edit] [-n] [-r] <commit-ish>' ;;
15 + USAGE='[--edit] [-n] [-r] [-x] <commit-ish>' ;;
16 * )
17 die "What are you talking about?" ;;
18 esac
19 . git-sh-setup
20
21 -no_commit= replay=
21 +no_commit= replay=t
22 while case "$#" in 0) break ;; esac
23 do
24 case "$1" in
@@ -32,8 +32,10 @@ do
32 --n|--no|--no-|--no-e|--no-ed|--no-edi|--no-edit)
33 edit=
34 ;;
35 - -r|--r|--re|--rep|--repl|--repla|--replay)
36 - replay=t
35 + -r)
36 + : no-op ;;
37 + -x|--i-really-want-to-expose-my-private-commit-object-name)
38 + replay=
39 ;;
40 -*)
41 usage
@@ -121,7 +123,7 @@ cherry-pick)
123 git-cat-file commit $commit | sed -e '1,/^$/d'
124 case "$replay" in
125 '')
124 - echo "(cherry picked from $commit commit)"
126 + echo "(cherry picked from commit $commit)"
127 test "$rev" = "$commit" ||
128 echo "(original 'git cherry-pick' arguments: $@)"
129 ;;