]> git.ipfire.org Git - thirdparty/git.git/commit
rerere-train: two fixes to the use of "git show -s"
authorJunio C Hamano <gitster@pobox.com>
Sun, 27 Feb 2022 22:09:24 +0000 (14:09 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 27 Feb 2022 22:14:03 +0000 (14:14 -0800)
commit2587df669bff9daeb7d2a66cfce6b1ce28af2ef3
tree730118f64f153f893bb7b233862a24d7bb14b579
parent4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a
rerere-train: two fixes to the use of "git show -s"

The script uses "git show -s" to display the title of the merge
commit being studied, without explicitly disabling the pager, which
is not a safe thing to do in a script.

For example, when the pager is set to "less" with "-SF" options (-S
tells the pager not to fold lines but allow horizontal scrolling to
show the overly long lines, -F tells the pager not to wait if the
output in its entirety is shown on a single page), and the title of
the merge commit is longer than the width of the terminal, the pager
will wait until the end-user tells it to quit after showing the
single line.

Explicitly disable the pager with this "git show" invocation to fix
this.

The command uses the "--pretty=format:..." format, which adds LF in
between each pair of commits it outputs, which means that the label
for the merge being learned from will be followed by the next
message on the same line.  "--pretty=tformat:..." is what we should
instead, which adds LF after each commit, or a more modern way to
spell it, i.e. "--format=...".  This existing breakage becomes
easier to see, now we no longer use the pager.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/rerere-train.sh