git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] rerere-train: modernise a bit
@ 2022-02-16  7:05 Junio C Hamano
  2022-02-20 19:52 ` Derrick Stolee
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Junio C Hamano @ 2022-02-16  7:05 UTC (permalink / raw)
  To: git

The script wants to create a list of merges using "rev-list" and
filters commits that do not have more than one parent, but if we
always pass "--merges" to "rev-list", there is no need to filter.

The command uses "git show --pretty=format:..." on a single commit
while generating progress reports, which means this title line is
left unterminated.  It should have used --pretty=tformat:...
instead, or better yet, use the more modern --format=... to ensure
that the title line is properly terminated.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/rerere-train.sh | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git c/contrib/rerere-train.sh w/contrib/rerere-train.sh
index 75125d6ae0..499b07e4a6 100755
--- c/contrib/rerere-train.sh
+++ w/contrib/rerere-train.sh
@@ -66,14 +66,9 @@ original_HEAD=$(git rev-parse --verify HEAD) || {
 
 mkdir -p "$GIT_DIR/rr-cache" || exit
 
-git rev-list --parents "$@" |
+git rev-list --parents --merges "$@" |
 while read commit parent1 other_parents
 do
-	if test -z "$other_parents"
-	then
-		# Skip non-merges
-		continue
-	fi
 	git checkout -q "$parent1^0"
 	if git merge $other_parents >/dev/null 2>&1
 	then
@@ -86,7 +81,7 @@ do
 	fi
 	if test -s "$GIT_DIR/MERGE_RR"
 	then
-		git show -s --pretty=format:"Learning from %h %s" "$commit"
+		git show -s --format="Learning from %h %s" "$commit"
 		git rerere
 		git checkout -q $commit -- .
 		git rerere

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-02-28  5:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16  7:05 [PATCH] rerere-train: modernise a bit Junio C Hamano
2022-02-20 19:52 ` Derrick Stolee
2022-02-27 18:02 ` Johannes Altmanninger
2022-02-27 19:07   ` Re* " Junio C Hamano
2022-02-27 20:23     ` Johannes Altmanninger
2022-02-27 22:13       ` Junio C Hamano
2022-02-27 22:09 ` [PATCH v2] rerere-train: two fixes to the use of "git show -s" Junio C Hamano
2022-02-28  5:33   ` Johannes Altmanninger

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).