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

Re: [PATCH v3] Let submodule command exit with error status if path does not exist

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 14, 2012, 20:59 UTC
Message-ID
<7vmx1x8a22.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120814203526.GA33843@book.hvoigt.net>
Heiko Voigt <hvoigt@hvoigt.net> writes:
> Previously the exit status of git submodule was zero for various
> subcommands even though the user specified an unknown path.

As any patch that fixes behaviour deals with "Previously", I'd prefer to omit it and describe the current problem in present tense instead.

Will queue with minor tweaks.  Thanks.
> this is an updated version with your proposal incorporated. I changed
> the name of check_unmatched to die_if_unmatched because IMO it describes
> more clearly what the function is doing.

In general, I would actually prefer to call this kind of function "check". That way, all the call sites only need to be aware that there is a check done there, without having to know what happens when the check triggers, and the implementation of "check" could decide that dying is too much and weaken the behaviour to only warn in later updates.

Such an update would not easily apply for this particular case because you would need to spit out all of @out from the module_list before giving the "#unmatched" warning token, and find a way to buffer the error message from ls-files so that it can be given when the warning is issued at the end if we wanted to weaken this to warn. So in this particular case, I do not mind renaming it to die-if.

Thanks.
Previous: Heiko Voigt
Message 9 of 9 in “git submodule return status”
  1. Daniel MildeJun 28, 2012
  2. Let submodule command exit with error status if path does not existHeiko Voigt, Aug 9, 2012
  3. Junio C HamanoAug 9, 2012
  4. Let submodule command exit with error status if path does not existHeiko Voigt, Aug 11, 2012
  5. Junio C HamanoAug 12, 2012
  6. Heiko VoigtAug 13, 2012
  7. Junio C HamanoAug 13, 2012
  8. Let submodule command exit with error status if path does not existHeiko Voigt, Aug 14, 2012
  9. Junio C HamanoAug 14, 2012

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.