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

Re: git commit return code

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Aug 10, 2010, 06:46 UTC
Message-ID
<vpqr5i7q81k.fsf@bauges.imag.fr>
In-Reply-To
<4C601F9B.6040102@puffy.pl>
Tomasz Pajor <nikon@puffy.pl> writes:
Show 9 quoted lines
> Hello,
>
> Is this proper behaviour:
>
> root# su <username> -c "git commit --quiet -a -m \"templates generation\";"
> # On branch master
> nothing to commit (working directory clean)
> root# echo $?
> 1

The exit status doesn't seem documented in the manpage, but it's expected behavior that "git commit" refuses to create an empty commit, and it seems sensible to "exit(1)" in this case.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Ævar Arnfjörð Bjarmason
Message 3 of 3 in “git commit return code”
  1. Tomasz PajorAug 9, 2010
  2. Ævar Arnfjörð BjarmasonAug 9, 2010
  3. Matthieu MoyAug 10, 2010

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.