{"thread":{"id":"44090","subject":"git add --intent-to-add silently creates empty commits","startedAt":"2016-09-15T05:01:13Z","lastAt":"2016-09-19T13:18:01Z","messageCount":3,"participants":["Aviv Eyal","Junio C Hamano","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"301952","messageId":"CAGHT48L2s_nf-oSGPKrOB7uo5UAkCScNh+Ju5xH1dE5DFVnHwA@mail.gmail.com","threadId":"44090","inReplyTo":null,"subject":"git add --intent-to-add silently creates empty commits","fromName":"Aviv Eyal","fromEmail":"avivey@gmail.com","sentAt":"2016-09-15T05:01:05Z","receivedAt":"2016-09-15T05:01:13Z","isPatch":false,"sender":{"key":"avivey@gmail.com","avatar":"https://gravatar.com/avatar/93416169042bb1ee4af6a7b7d313a18252bab4b25aeca338137f2948d2d6c26a?d=mp&s=160"},"body":"Hello,\n\nI think this is an unintended behavior, but I might be wrong:\n\nUsing `git add -N` allows creating of empty commits:\n\n\ngit init test && cd test\necho text > file\ngit add --intent-to-add file\ngit commit -m 'Empty commit'\necho $?                                    # prints 0\ngit log -1 -p --format='' HEAD | wc -l     # prints 0\ngit status -s                              # prints `AM file`\n\n\nI'd expect `git commit` to error out instead of producing an empty commit.\n\nI've seen this with git 2.8.1 and 2.10.0.129.g35f6318\n\nThanks,\nAviv\n"},{"id":"301985","messageId":"xmqq1t0loxz4.fsf@gitster.mtv.corp.google.com","threadId":"44090","inReplyTo":"CAGHT48L2s_nf-oSGPKrOB7uo5UAkCScNh+Ju5xH1dE5DFVnHwA@mail.gmail.com","subject":"Re: git add --intent-to-add silently creates empty commits","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-15T17:48:47Z","receivedAt":"2016-09-15T17:49:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Aviv Eyal <avivey@gmail.com> writes:\n\n> Using `git add -N` allows creating of empty commits:\n>\n> git init test && cd test\n> echo text > file\n> git add --intent-to-add file\n> git commit -m 'Empty commit'\n> echo $?                                    # prints 0\n> ...\n> I'd expect `git commit` to error out instead of producing an empty commit.\n>\n> I've seen this with git 2.8.1 and 2.10.0.129.g35f6318\n\nI think I've seen this reported some time ago.\n\nhttps://public-inbox.org/git/%3CCACsJy8A8-RgpYxYsJBaLrMia7D3DfQPr4cxASNsaLyCnmgm3ZQ@mail.gmail.com%3E/\n\nI do not offhand recall what happend to the topic after that.\n"},{"id":"302134","messageId":"CACsJy8AGYPfX9936QJyKU8paxbt+SABMbeCWnpgVvODFr7v4LA@mail.gmail.com","threadId":"44090","inReplyTo":"xmqq1t0loxz4.fsf@gitster.mtv.corp.google.com","subject":"Re: git add --intent-to-add silently creates empty commits","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-09-19T13:16:53Z","receivedAt":"2016-09-19T13:18:01Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Sep 16, 2016 at 12:48 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Aviv Eyal <avivey@gmail.com> writes:\n>\n>> Using `git add -N` allows creating of empty commits:\n>>\n>> git init test && cd test\n>> echo text > file\n>> git add --intent-to-add file\n>> git commit -m 'Empty commit'\n>> echo $?                                    # prints 0\n>> ...\n>> I'd expect `git commit` to error out instead of producing an empty commit.\n>>\n>> I've seen this with git 2.8.1 and 2.10.0.129.g35f6318\n>\n> I think I've seen this reported some time ago.\n>\n> https://public-inbox.org/git/%3CCACsJy8A8-RgpYxYsJBaLrMia7D3DfQPr4cxASNsaLyCnmgm3ZQ@mail.gmail.com%3E/\n>\n> I do not offhand recall what happend to the topic after that.\n\nYeah. I'm a bit behind, no, I'm waaaay behind my git backlog. This\ndefinitely gets a rise-up, together with the multiworktree bug fix in\ngit-init.\n-- \nDuy\n"}]}