threads / discuss / 34152

git log: Add a switch to limit the number of displayed lines from the commit messages

Subject: git log: Add a switch to limit the number of displayed lines from the commit messages

## tl;dr

4 messages between Jun 15, 2013 and Jun 17, 2013.

replies: 3people: 3as markdown or json

Paul Menzel· Jun 15, 2013, 18:07 UTC · lore
Dear git folks,

there are people out there disliking elaborate commit messages, as going over `git log` is tedious as you have to scroll a lot. As I do not like the suggestion to make commit messages shorter by omitting certain details, a way to limit the number displayed lines of the commit messages would be nice to have.

The switch `--format=oneline` exists already. Unfortunately a lot of commits do not have a informative enough summary, so the first lines of the commit message are still needed/desired to understand the commit more.

Could a switch be added, like `--commit-message-lines` (sorry for not coming up with something better) to limit the number of displayed lines? That would be great!

For older git versions, do you know of editor/pager options to achieve this?

Thanks,
Paul
Jonathan Nieder· Jun 15, 2013, 19:19 UTC · re: Paul Menzel · lore

Re: git log: Add a switch to limit the number of displayed lines from the commit messages

Hi Paul,
Paul Menzel wrote:
Show 5 quoted lines
> there are people out there disliking elaborate commit messages, as going
> over `git log` is tedious as you have to scroll a lot. As I do not like
> the suggestion to make commit messages shorter by omitting certain
> details, a way to limit the number displayed lines of the commit
> messages would be nice to have.

Have you tried gitk or tig? They split the screen so you can browse through commits, one per line, in one half and read the corresponding commit messages and patches in the other.

Hope that helps, Jonathan

Junio C Hamano· Jun 17, 2013, 04:41 UTC · re: Jonathan Nieder · lore

Re: git log: Add a switch to limit the number of displayed lines from the commit messages

Jonathan Nieder <jrnieder@gmail.com> writes:
Show 9 quoted lines
>> there are people out there disliking elaborate commit messages, as going
>> over `git log` is tedious as you have to scroll a lot. As I do not like
>> the suggestion to make commit messages shorter by omitting certain
>> details, a way to limit the number displayed lines of the commit
>> messages would be nice to have.
>
> Have you tried gitk or tig?  They split the screen so you can browse
> through commits, one per line, in one half and read the corresponding
> commit messages and patches in the other.
Or inside "less" that is spawned by "git log -p", I often say this:
    /^commit .*|^diff --git .*<ENTER>
and navigate with 'n' and 'p'.
Jonathan Nieder· Jun 17, 2013, 06:18 UTC · re: Junio C Hamano · lore

Re: git log: Add a switch to limit the number of displayed lines from the commit messages

Junio C Hamano wrote:
Show 5 quoted lines
> Or inside "less" that is spawned by "git log -p", I often say this:
>
>     /^commit .*|^diff --git .*<ENTER>
>
> and navigate with 'n' and 'p'.
Hm, that implies an interesting trick.  If I run
	LESS='FRSX +/^commit |^diff --git ' git log -p

then 'n' and shift+'n' can be used for navigating without having to spell out the /pattern to start by hand.

← back to recent threads