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

--max-count useless with git-rev-list's --reverse

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 7, 2011, 19:17 UTC
Message-ID
<AANLkTikpK-r_kdqCEPwpqEgENtwgUrZDLwZnuS2QMdH=@mail.gmail.com>
On git.git, this works as expected, gives me the first 3 commits:
   $ git rev-list --reverse origin/master | head -n 3
    e83c5163316f89bfbde7d9ab23ca2e25604af290
    8bc9a0c769ac1df7820f2dbf8f7b7d64835e3c68
    e497ea2a9b6c378f01d092c210af20cbee762475

Why is this so useless about ignoring the --reverse option, is this my design (these are the 3 *latest* commits):

    $ git rev-list --reverse origin/master --max-count=3
    08fd8710e277eed73a21c6c5483c57bfeb14e8a7
    6d74e5c9dbe71e2eb63c6e8862ec979e9a5f068b
    07873dc5dd67398324278ff0d7627bb1a863ba89
    $ git rev-list origin/master --max-count=3
    07873dc5dd67398324278ff0d7627bb1a863ba89
    6d74e5c9dbe71e2eb63c6e8862ec979e9a5f068b
    08fd8710e277eed73a21c6c5483c57bfeb14e8a7
>From the manpage:
   --reverse
       Output the commits in reverse order. Cannot be combined with
--walk-reflogs.
Shouldn't --reverse be applied *before* --max-count?
Next: Shawn Pearce
Message 1 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.