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

Re: [PATCH] git-commit: exit non-zero if we fail to commit the index

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 17, 2008, 01:13 UTC
Message-ID
<7vir1tmey8.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<478E9C59.9070008@nrlssc.navy.mil>
Brandon Casey <casey@nrlssc.navy.mil> writes:
Show 7 quoted lines
> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
> ---
>
>
> Shouldn't we be doing this? I think if quiet is set,
> then a failed rename will go undetected since we
> won't enter print_summary to have lookup_commit fail.

But then it's a bit too late, isn't it? We already have successfully made the commit and updated the HEAD to point at it. We would need to tell the user that the index is not where it is when we detect the error, though.

> run_hook also is not checked for failure.

I think you mean the final post-commit one, but that is deliberate. post-commit is not meant to affect the outcome of the command.

Previous: Brandon CaseyNext: Brandon Casey
Message 2 of 9 in “git-commit: exit non-zero if we fail to commit the index”
  1. git-commit: exit non-zero if we fail to commit the indexBrandon Casey, Jan 17, 2008
  2. Junio C HamanoJan 17, 2008
  3. Brandon CaseyJan 17, 2008
  4. Junio C HamanoJan 17, 2008
  5. git-commit: exit non-zero if we fail to commit the indexBrandon Casey, Jan 22, 2008
  6. Junio C HamanoJan 22, 2008
  7. git-commit: exit non-zero if we fail to commit the indexBrandon Casey, Jan 23, 2008
  8. Junio C HamanoJan 23, 2008
  9. Brandon CaseyJan 23, 2008

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.