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

4 messages from 2013-06-15 to 2013-06-17. Participants: Paul Menzel, Jonathan Nieder, Junio C Hamano.
Thread: https://gitlist.dev/t/34152

## Paul Menzel, 2013-06-15 18:07

Subject: git log: Add a switch to limit the number of displayed lines from the commit messages
Message-ID: <1371319623.9845.34.camel@mattotaupa>
URL: https://gitlist.dev/e/1371319623.9845.34.camel%40mattotaupa

```
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, 2013-06-15 19:19

Subject: Re: git log: Add a switch to limit the number of displayed lines from the commit messages
Message-ID: <20130615191905.GA3363@elie.Belkin>
URL: https://gitlist.dev/e/20130615191905.GA3363%40elie.Belkin
In-Reply-To: <1371319623.9845.34.camel@mattotaupa>

```
Hi Paul,

Paul Menzel wrote:

> 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, 2013-06-17 04:41

Subject: Re: git log: Add a switch to limit the number of displayed lines from the commit messages
Message-ID: <7vd2rlic2q.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd2rlic2q.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20130615191905.GA3363@elie.Belkin>

```
Jonathan Nieder <jrnieder@gmail.com> writes:

>> 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, 2013-06-17 06:18

Subject: Re: git log: Add a switch to limit the number of displayed lines from the commit messages
Message-ID: <20130617061852.GA6942@elie.Belkin>
URL: https://gitlist.dev/e/20130617061852.GA6942%40elie.Belkin
In-Reply-To: <7vd2rlic2q.fsf@alter.siamese.dyndns.org>

```
Junio C Hamano wrote:

> 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.

```
