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

BUG? git log -Sfoo --max-count=N

From
ÓFÓscar Fuentes <ofv@wanadoo.es>
Date
Mar 6, 2011, 21:37 UTC
Message-ID
<87hbbgvske.fsf@wanadoo.es>
The documentation says
--max-count=<number> 
  Limit the number of commits output
but when used with -S as in
git log -Sfoo --max-count=N

it acts as "inspect only the N first commits", i.e. if `foo' is not present on any of the first N commits no output is shown.

Using other filtering options (such as `--grep=' or `-- somepath') together with --max-count=N will output at most N commits regardless of the position on the history of those commits, as expected.

Tested with git 1.7.1 and 1.7.4.
Next: Matthieu Moy
Message 1 of 8 in “BUG? git log -Sfoo --max-count=N”
  1. Óscar FuentesMar 6, 2011
  2. Re: BUG? git log -Sfoo --max-count=NMatthieu Moy, Mar 7, 2011
  3. Junio C HamanoMar 8, 2011
  4. log: fix --max-count when used together with -S or -GMatthieu Moy, Mar 9, 2011
  5. Jeff KingMar 9, 2011
  6. Matthieu MoyMar 9, 2011
  7. Junio C HamanoMar 9, 2011
  8. Jeff KingMar 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.