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

[PATCH v1 0/4] make "too many arguments" a bit more useful

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 6, 2024, 00:35 UTC
Message-ID
<20240806003539.3292562-1-gitster@pobox.com>

Imagine seeing your command failing with "too many arguments" when you run "git cmd foo bar baz". Can you tell it will work if you said "git cmd foo bar"? Or is that trimming your command line too much? Too little? You cannot quite tell.

If the command reported "unknown argument: 'bar'", you would know that among the arguments you gave to "git", i.e. "cmd foo bar baz", up to "cmd foo" were understood and "bar" and "baz" were not.

This was one of the things I noticed while reviewing a topic and marked as leftoverbits to be cleaned up after the dust settled. The dust has settled and it is a good time to clean them up.

Junio C Hamano (4):
  refs: avoid "too many arguments"
  cat-file: avoid "too many arguments"
  notes: avoid "too many arguments"
  miscellaneous: avoid "too many arguments"
 builtin/cat-file.c      |  3 ++-
 builtin/notes.c         | 18 +++++++++---------
 builtin/prune-packed.c  |  6 +++---
 builtin/receive-pack.c  |  3 ++-
 builtin/refs.c          |  4 +++-
 builtin/tag.c           |  2 +-
 t/t1006-cat-file.sh     |  8 +++++---
 t/t1460-refs-migrate.sh |  7 ++++---
 t/t3301-notes.sh        |  2 +-
 9 files changed, 30 insertions(+), 23 deletions(-)
-- 
2.46.0-235-g968ce1ce0e
Next: Junio C Hamano
Message 1 of 16 in “make "too many arguments" a bit more useful”
  1. 0/4 make "too many arguments" a bit more usefulJunio C Hamano, Aug 6, 2024
  2. 1/4 refs: avoid "too many arguments"Junio C Hamano, Aug 6, 2024
  3. Patrick SteinhardtAug 6, 2024
  4. Junio C HamanoAug 6, 2024
  5. [RFC] usage_msg_opt() and _optf() must dieJunio C Hamano, Aug 6, 2024
  6. Eric SunshineAug 6, 2024
  7. Junio C HamanoAug 6, 2024
  8. Patrick SteinhardtAug 7, 2024
  9. Justin ToblerAug 6, 2024
  10. Martin ÅgrenAug 6, 2024
  11. refs: avoid "too many arguments"Junio C Hamano, Aug 6, 2024
  12. 2/4 cat-file: avoid "too many arguments"Junio C Hamano, Aug 6, 2024
  13. 3/4 notes: avoid "too many arguments"Junio C Hamano, Aug 6, 2024
  14. 4/4 miscellaneous: avoid "too many arguments"Junio C Hamano, Aug 6, 2024
  15. Eric SunshineAug 6, 2024
  16. Junio C HamanoAug 6, 2024

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.