Re: --max-count useless with git-rev-list's --reverse
- From
Shawn Pearce <spearce@spearce.org>
- Date
- Mar 7, 2011, 19:40 UTC
- Message-ID
- <AANLkTikTQfxK8B3fN6y5UZ=tRaM_iWXcfq=ukK4vPq2R@mail.gmail.com>
- In-Reply-To
- <AANLkTikpK-r_kdqCEPwpqEgENtwgUrZDLwZnuS2QMdH=@mail.gmail.com>
On Mon, Mar 7, 2011 at 11:17, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 7 quoted lines
> From the manpage: > > --reverse > Output the commits in reverse order. Cannot be combined with > --walk-reflogs. > > Shouldn't --reverse be applied *before* --max-count?
No. Its applied after, otherwise things like "git log -n 5 --reverse" wouldn't let me review the last 5 commits in chronological order. It also would take a long time to find the first 5 commits in a project the size of linux-2.6. Most users don't care about the first 5 commits of a project, but they do care about the most recent X commits that may have occurred.
So yes, sometimes the reverse doesn't occur where you want it, but its so rare to want the first X commits of a project's history that its just accepted. In theory we could add a --reverse-from-beginning-of-time flag to do what you want, but I don't think anyone has cared enough to implement this. Most users who want the beginning of time are OK with something like `git show $(git rev-list --all | tail -1)`.
-- Shawn.