Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hg log - How to get the last 5 log entries?

Tags:

mercurial

I have a Mercurial project that has hundreds of commits.

When I want to look at the most recent entries I type

hg log 

and then wait for everything to print out and then scroll back to the top.

How do I print out just the 5 most-recent entries?

like image 674
Hubert Brethwaite Avatar asked Jul 26 '11 19:07

Hubert Brethwaite


2 Answers

Use the limit parameter: hg log --limit 5

like image 154
Michael Markert Avatar answered Sep 19 '22 19:09

Michael Markert


In completion of the Michael Markert response you can use the shortversion

hg log -l 10 

In addition if you want you can define via the option -b that you want only last commit from the current branch.

You can also do

hg log -l 10 -b [your branch] 

for check 10 last commit from the branch you want

Of course you can go further with -d like this :

hg log -l 1 -d "feb 2015 to apr 2015" 

This will give you last 10 commits within this date range (3 char for each months)

And goes on..

Full example and option are available in this link : Here

like image 33
Greco Jonathan Avatar answered Sep 20 '22 19:09

Greco Jonathan