]> git.ipfire.org Git - thirdparty/git.git/commit - revision.h
rev-list: add option for --pretty=format without header
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 11 Jul 2021 21:55:10 +0000 (21:55 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jul 2021 17:12:31 +0000 (10:12 -0700)
commitd1c5ae78ce1260c94c9e626b83dc0901e6843178
tree09b710baf7cf9708f1bb11124b7a5dd25de254d2
parent670b81a890388c60b7032a4f5b879f2ece8c4558
rev-list: add option for --pretty=format without header

In general, we encourage users to use plumbing commands, like git
rev-list, over porcelain commands, like git log, when scripting.
However, git rev-list has one glaring problem that prevents it from
being used in certain cases: when --pretty is used with a custom format,
it always prints out a line containing "commit" and the object ID.  This
makes it unsuitable for many scripting needs, and forces users to use
git log instead.

While we can't change this behavior for backwards compatibility, we can
add an option to suppress this behavior, so let's do so, and call it
"--no-commit-header".  Additionally, add the corresponding positive
option to switch it back on.

Note that this option doesn't affect the built-in formats, only custom
formats.  This is exactly the same behavior as users already have from
git log and is what most users will be used to.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/rev-list-options.txt
builtin/rev-list.c
revision.h
t/t6006-rev-list-format.sh