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

Re: [PATCH] ls-files.c: add --only-object-name option

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 8, 2022, 16:09 UTC
Message-ID
<xmqq7d5rrvbf.fsf@gitster.g>
In-Reply-To
<CAOLTT8Sz3q2db1fRcHp7Exnarw4sMCnUfAF6bot+pwYxmXJjiw@mail.gmail.com>
ZheNing Hu <adlternative@gmail.com> writes:
Show 7 quoted lines
>> But in any case shouldn't this be called --name-only to go with "git
>> ls-tree"'s version of this? Or is there some subtle difference I'm
>> missing...?
>
> Eh, git ls-tree --name-only will only show file paths, so maybe
> --only-object-name will be better than --object-name-only in git
> ls-files.

Yeah, it is not "--name-only" which is about paths, but "--object-name-only" would be more correct but it is a tad long.

I think ls-tree learned "--object-only" for that fairly recently. When in doubt, always check the documentation of a similar command for inspiration.

Thanks.
Previous: ZheNing HuNext: ZheNing Hu via GitGitGadget
Message 4 of 8 in “ls-files.c: add --only-object-name option”
  1. ls-files.c: add --only-object-name optionZheNing Hu via GitGitGadget, Jun 6, 2022
  2. Ævar Arnfjörð BjarmasonJun 6, 2022
  3. ZheNing HuJun 8, 2022
  4. Junio C HamanoJun 8, 2022
  5. ls-files.c: add --object-only optionZheNing Hu via GitGitGadget, Jun 9, 2022
  6. Junio C HamanoJun 9, 2022
  7. ZheNing HuJun 12, 2022
  8. Junio C HamanoJun 13, 2022

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.