I am trying to customize the format for git log. I want all commits to be shown in one line. Each line should only show the first line of the commit message.
I found out that git log --pretty=short should do the trick but on my computer it shows the full log as git log does (besides the time stamp).
Further, I tried to use the placeholders as defined in the man page. Though, I could not find a command to shorten the log message. I tried this line git log --pretty=format:'%h : %s' which shows the shorted hash %hand the full message %s in one line.
I am using git version 1.7.3.1.msysgit.0 on Vista.
Maybe it has something to do with the way I write my commit messages. Here is an example:
Added some functionality.
+ Added print function in Foo class.
+ Added conversion from foo to baz.
So, with the example given I only want to be output Added some functionality. prepended by the shortend hash.
%sis the subject, not the full message.shortformat isn't all on one line, though (surprise!)onelineis. Ifonelineand%h : %saren't what you want, what's wrong with them? In particular,%sis the subject, the first line of the commit message. That should indeed be a shortened version. Is it possible you've been making commits with a single long line for the message, and viewing them somehow with word wrapping?onelineand%sdo not output what we expect, at least on my computer. I updated my post with an example of my commit message. Maybe it helps.git log --onelinesince a long time. I guess one part of the problem back then was that I forgot to insert an empty line between the commit summary and the commit body. Also, who remembers Vista at all :p