git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Ævar Arnfjörð BjarmasonNext: Jay Soffian
Message 2 of 14 in “--max-count useless with git-rev-list's --reverse”
  1. Ævar Arnfjörð BjarmasonMar 7, 2011
  2. Shawn PearceMar 7, 2011
  3. Jay SoffianMar 8, 2011
  4. Michael J GruberMar 8, 2011
  5. Michael J GruberMar 8, 2011
  6. 1/3 rev-list-options.txt: typo fixMichael J Gruber, Mar 8, 2011
  7. Junio C HamanoMar 8, 2011
  8. Michael J GruberMar 9, 2011
  9. 2/3 git-log.txt,rev-list-options.txt: -n/--max-count is commit limitingMichael J Gruber, Mar 8, 2011
  10. Junio C HamanoMar 8, 2011
  11. Michael J GruberMar 9, 2011
  12. 3/3 git-log.txt,rev-list-options.txt: put option blocks in proper orderMichael J Gruber, Mar 8, 2011
  13. Junio C HamanoMar 9, 2011
  14. Michael J GruberMar 10, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.