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

Mercurial

Mercurial Problem Overview


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?

Mercurial Solutions


Solution 1 - Mercurial

Use the limit parameter: hg log --limit 5

Solution 2 - Mercurial

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHubert BrethwaiteView Question on Stackoverflow
Solution 1 - MercurialMichael MarkertView Answer on Stackoverflow
Solution 2 - MercurialGreco JonathanView Answer on Stackoverflow