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

[BUG] rev-list doesn't validate arguments to -n option

From
Britton Kerin <britton.kerin@gmail.com>
Date
Dec 7, 2023, 22:12 UTC
Message-ID
<CAC4O8c-nuOTS=a0sVp1603KaM2bZjs+yNZzdAaa5CGTNGFE7hQ@mail.gmail.com>
It tolerates non-numeric arguments and garbage after a number:
For example:

$ # -n 1 means same as -n 0: $ git rev-list -n q newest_commit $ git rev-list -n 0 newest_commit $ # Garbage after number is tolerated: $ git rev-list -n 1q newest_commit 3be33f83695088d968cf084a1a08bdcde25a8d7a $ git rev-list -n 2q newest_commit 3be33f83695088d968cf084a1a08bdcde25a8d7a 286e62e1b68e39334978e6222cbff187ecc17bcf

Next: Junio C Hamano
Message 1 of 6 in “[BUG] rev-list doesn't validate arguments to -n option”
  1. Britton KerinDec 7, 2023
  2. Junio C HamanoDec 8, 2023
  3. revision: parse integer arguments to --max-count, --skip, etc., more carefullyJunio C Hamano, Dec 8, 2023
  4. Jeff KingDec 12, 2023
  5. Junio C HamanoDec 12, 2023
  6. Jeff KingDec 12, 2023

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.