I was trying to work out the git log --pretty=format:...
equivalent for the default git log
behaviour. I can find that the default is "medium", but cannot track down what pretty format string that corresponds to (so that I can copy parts of it).
My real question is why %s
gives me the commit message as a single line, swallowing all the line-feeds (but otherwise the complete message). Whereas default git log
behaviour not only preserves the line breaks but also gives it a nice indent. The full command I am experimenting with is:
git log --all --pretty=format:\"%h %cd%d%+s\" --name-status --date=local
(%s
and %+s
are identical with regards to the line-breaks within the commit message)
(git version 1.9.1)
You can use the line wrapping format %w
to reintroduce new lines by setting the width to 0
.
%w(width[,<indent1>[,<indent2>]])
This format is equivalent to medium
git log --pretty="format:%C(yellow)commit %H%n%C(white)Author: %an <%ae>%nDate: %ad%n%n%w(0,4,4)%B%n"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With