Skip to content

Commit 130ab8a

Browse files
jrngitster
authored andcommitted
Eliminate “Finished cherry-pick/revert” message
When cherry-pick was written (v0.99.6~63, 2005-08-27), “git commit” was quiet, and the output from cherry-pick provided useful information about the progress of a rebase. Now next to the output from “git commit”, the cherry-pick notification is so much noise (except for the name of the picked commit). $ git cherry-pick ..topic Finished cherry-pick of 499088b. [detached HEAD 17e1ff2] Move glob module to libdpkg Author: Guillem Jover <guillem@debian.org> 8 files changed, 12 insertions(+), 9 deletions(-) rename {src => lib/dpkg}/glob.c (98%) rename {src => lib/dpkg}/glob.h (93%) Finished cherry-pick of ae947e1. [detached HEAD 058caa3] libdpkg: Add missing symbols to Versions script Author: Guillem Jover <guillem@debian.org> 1 files changed, 2 insertions(+), 0 deletions(-) $ The noise is especially troublesome when sifting through the output of a rebase or multiple cherry-pick that eventually failed. With the commit subject, it is already not hard to figure out where the commit came from. So drop the “Finished” message. Cc: Christian Couder <chriscool@tuxfamily.org> Cc: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 6bc83cd commit 130ab8a

4 files changed

Lines changed: 30 additions & 21 deletions

File tree

Documentation/howto/revert-branch-rebase.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,19 @@ $ git tag pu-anchor pu
112112
$ git rebase master
113113
* Applying: Redo "revert" using three-way merge machinery.
114114
First trying simple merge strategy to cherry-pick.
115-
Finished one cherry-pick.
116115
* Applying: Remove git-apply-patch-script.
117116
First trying simple merge strategy to cherry-pick.
118117
Simple cherry-pick fails; trying Automatic cherry-pick.
119118
Removing Documentation/git-apply-patch-script.txt
120119
Removing git-apply-patch-script
121-
Finished one cherry-pick.
122120
* Applying: Document "git cherry-pick" and "git revert"
123121
First trying simple merge strategy to cherry-pick.
124-
Finished one cherry-pick.
125122
* Applying: mailinfo and applymbox updates
126123
First trying simple merge strategy to cherry-pick.
127-
Finished one cherry-pick.
128124
* Applying: Show commits in topo order and name all commits.
129125
First trying simple merge strategy to cherry-pick.
130-
Finished one cherry-pick.
131126
* Applying: More documentation updates.
132127
First trying simple merge strategy to cherry-pick.
133-
Finished one cherry-pick.
134128
------------------------------------------------
135129

136130
The temporary tag 'pu-anchor' is me just being careful, in case 'git

builtin/revert.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,6 @@ static int do_pick_commit(void)
521521
} else {
522522
if (!no_commit)
523523
res = run_git_commit(defmsg);
524-
if (!res)
525-
fprintf(stderr, "Finished %s.\n", mebuf.buf);
526524
}
527525

528526
strbuf_release(&mebuf);

contrib/examples/git-revert.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ Conflicts:
181181
esac
182182
exit 1
183183
}
184-
echo >&2 "Finished one $me."
185184

186185
# If we are cherry-pick, and if the merge did not result in
187186
# hand-editing, we will hit this commit and inherit the original

t/t3508-cherry-pick-many-commits.sh

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,36 +35,54 @@ test_expect_success setup '
3535
'
3636

3737
test_expect_success 'cherry-pick first..fourth works' '
38-
cat <<-EOF >expected &&
39-
Finished cherry-pick of commit $(git rev-parse --short second).
40-
Finished cherry-pick of commit $(git rev-parse --short third).
41-
Finished cherry-pick of commit $(git rev-parse --short fourth).
38+
cat <<-\EOF >expected &&
39+
[master OBJID] second
40+
Author: A U Thor <author@example.com>
41+
1 files changed, 1 insertions(+), 0 deletions(-)
42+
[master OBJID] third
43+
Author: A U Thor <author@example.com>
44+
1 files changed, 1 insertions(+), 0 deletions(-)
45+
[master OBJID] fourth
46+
Author: A U Thor <author@example.com>
47+
1 files changed, 1 insertions(+), 0 deletions(-)
4248
EOF
4349
4450
git checkout -f master &&
4551
git reset --hard first &&
4652
test_tick &&
47-
git cherry-pick first..fourth 2>actual &&
53+
git cherry-pick first..fourth >actual &&
4854
git diff --quiet other &&
4955
git diff --quiet HEAD other &&
50-
test_cmp expected actual &&
56+
57+
sed -e "s/$_x05[0-9a-f][0-9a-f]/OBJID/" <actual >actual.fuzzy &&
58+
test_cmp expected actual.fuzzy &&
5159
check_head_differs_from fourth
5260
'
5361

5462
test_expect_success 'cherry-pick --strategy resolve first..fourth works' '
55-
cat <<-EOF >expected &&
56-
Finished cherry-pick of commit $(git rev-parse --short second) with strategy resolve.
57-
Finished cherry-pick of commit $(git rev-parse --short third) with strategy resolve.
58-
Finished cherry-pick of commit $(git rev-parse --short fourth) with strategy resolve.
63+
cat <<-\EOF >expected &&
64+
Trying simple merge.
65+
[master OBJID] second
66+
Author: A U Thor <author@example.com>
67+
1 files changed, 1 insertions(+), 0 deletions(-)
68+
Trying simple merge.
69+
[master OBJID] third
70+
Author: A U Thor <author@example.com>
71+
1 files changed, 1 insertions(+), 0 deletions(-)
72+
Trying simple merge.
73+
[master OBJID] fourth
74+
Author: A U Thor <author@example.com>
75+
1 files changed, 1 insertions(+), 0 deletions(-)
5976
EOF
6077
6178
git checkout -f master &&
6279
git reset --hard first &&
6380
test_tick &&
64-
git cherry-pick --strategy resolve first..fourth 2>actual &&
81+
git cherry-pick --strategy resolve first..fourth >actual &&
6582
git diff --quiet other &&
6683
git diff --quiet HEAD other &&
67-
test_cmp expected actual &&
84+
sed -e "s/$_x05[0-9a-f][0-9a-f]/OBJID/" <actual >actual.fuzzy &&
85+
test_cmp expected actual.fuzzy &&
6886
check_head_differs_from fourth
6987
'
7088

0 commit comments

Comments
 (0)