author | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Oct 2009 06:43:32 +0000 (23:43 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Oct 2009 06:43:32 +0000 (23:43 -0700) | ||
commit | 9fa708dab1ccf8be69a606ca4eb58e62f3ef334a | |
tree | f7161d095174d809d3839dab1ac4d78f433f792c | tree | snapshot |
parent | a7aebb9d00332364411e85c703cc25dc0580f2d4 | commit | diff |
Pretty-format: %[+-]x to tweak inter-item newlines
This teaches the "pretty" machinery to expand '%+x' to a LF followed by
the expansion of '%x' if and only if '%x' expands to a non-empty string,
and to remove LFs before '%-x' if '%x' expands to an empty string. This
works for any supported expansion placeholder 'x'.
This is expected to be immediately useful to reproduce the commit log
message with "%s%+b%n"; "%s%n%b%n" adds one extra LF if the log message is
a one-liner.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This teaches the "pretty" machinery to expand '%+x' to a LF followed by
the expansion of '%x' if and only if '%x' expands to a non-empty string,
and to remove LFs before '%-x' if '%x' expands to an empty string. This
works for any supported expansion placeholder 'x'.
This is expected to be immediately useful to reproduce the commit log
message with "%s%+b%n"; "%s%n%b%n" adds one extra LF if the log message is
a one-liner.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/pretty-formats.txt | diff | blob | history | |
pretty.c | diff | blob | history | |
t/t6006-rev-list-format.sh | diff | blob | history |