{"thread":{"id":"24681","subject":"git commit return code","startedAt":"2010-08-09T15:32:43Z","lastAt":"2010-08-10T06:46:31Z","messageCount":3,"participants":["Tomasz Pajor","Ævar Arnfjörð Bjarmason","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"147508","messageId":"4C601F9B.6040102@puffy.pl","threadId":"24681","inReplyTo":null,"subject":"git commit return code","fromName":"Tomasz Pajor","fromEmail":"nikon@puffy.pl","sentAt":"2010-08-09T15:32:43Z","receivedAt":"2010-08-09T15:32:43Z","isPatch":false,"sender":{"key":"nikon@puffy.pl","avatar":null},"body":"Hello,\n\nIs this proper behaviour:\n\nroot# su <username> -c \"git commit --quiet -a -m \\\"templates generation\\\";\"\n# On branch master\nnothing to commit (working directory clean)\nroot# echo $?\n1\n\nroot# git --version\ngit version 1.7.1\n"},{"id":"147509","messageId":"AANLkTi=HKBjT6=_RUNwPWJO-KsqgkjWUsxT_ontdvj6a@mail.gmail.com","threadId":"24681","inReplyTo":"4C601F9B.6040102@puffy.pl","subject":"Re: git commit return code","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-09T16:13:11Z","receivedAt":"2010-08-09T16:13:11Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Aug 9, 2010 at 15:32, Tomasz Pajor <nikon@puffy.pl> wrote:\n\n> Is this proper behaviour:\n>\n> root# su <username> -c \"git commit --quiet -a -m \\\"templates generation\\\";\"\n> # On branch master\n> nothing to commit (working directory clean)\n> root# echo $?\n> 1\n\nYes, you asked it to create a commit, but there's nothing to commit.\nHence the failure to commit.\n"},{"id":"147610","messageId":"vpqr5i7q81k.fsf@bauges.imag.fr","threadId":"24681","inReplyTo":"4C601F9B.6040102@puffy.pl","subject":"Re: git commit return code","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-08-10T06:46:31Z","receivedAt":"2010-08-10T06:46:31Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Tomasz Pajor <nikon@puffy.pl> writes:\n\n> Hello,\n>\n> Is this proper behaviour:\n>\n> root# su <username> -c \"git commit --quiet -a -m \\\"templates generation\\\";\"\n> # On branch master\n> nothing to commit (working directory clean)\n> root# echo $?\n> 1\n\nThe exit status doesn't seem documented in the manpage, but it's\nexpected behavior that \"git commit\" refuses to create an empty commit,\nand it seems sensible to \"exit(1)\" in this case.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}