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

Re: [PATCH 2/4] option-strings: use OPT_FILENAME

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 23, 2015, 19:08 UTC
Message-ID
<xmqqfv9wtpha.fsf@gitster.dls.corp.google.com>
In-Reply-To
<3af5c93959b22dc327d7fb3974d36764906c2969.1424707497.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> Some commands use OPT_STRING to specify a <file> argument. Let them use
> OPT_FILENAME so that they can profit from path prefixing.

If the existing code that takes string actually already works correctly, they must be doing the necessary prefixing on their own, but I do not see in this patch a hunk that removes such a custom prefixing. Puzzled...

It may be that some of them do not work correctly from subdirectory and this change fixes bugs, but are all of them like that, or is this patch fixing some of them while breaking some others?

Show 9 quoted lines
>
>  archive.c             | 2 +-
>  builtin/archive.c     | 2 +-
>  builtin/blame.c       | 4 ++--
>  builtin/config.c      | 2 +-
>  builtin/fast-export.c | 4 ++--
>  builtin/hash-object.c | 2 +-
>  builtin/ls-files.c    | 2 +-
>  7 files changed, 9 insertions(+), 9 deletions(-)
Previous: Jeff KingNext: Junio C Hamano
Message 11 of 18 in “checkout: --to requires directory”
  1. checkout: --to requires directoryMichael J Gruber, Feb 23, 2015
  2. Jeff KingFeb 23, 2015
  3. Michael J GruberFeb 23, 2015
  4. 0/4 OPT_{FILENAME,PATH}Michael J Gruber, Feb 23, 2015
  5. 1/4 parse-options: introduce OPT_PATHMichael J Gruber, Feb 23, 2015
  6. Junio C HamanoFeb 23, 2015
  7. Michael J GruberFeb 24, 2015
  8. Philip OakleyFeb 23, 2015
  9. 2/4 option-strings: use OPT_FILENAMEMichael J Gruber, Feb 23, 2015
  10. Jeff KingFeb 23, 2015
  11. Junio C HamanoFeb 23, 2015
  12. Junio C HamanoFeb 23, 2015
  13. 3/4 option-strings: use OPT_PATHMichael J Gruber, Feb 23, 2015
  14. Jeff KingFeb 23, 2015
  15. Junio C HamanoFeb 23, 2015
  16. Jeff KingFeb 23, 2015
  17. 4/4 checkout: --to requires directoryMichael J Gruber, Feb 23, 2015
  18. Duy NguyenFeb 24, 2015

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.