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

Re: git add --intent-to-add silently creates empty commits

From
Duy Nguyen <pclouds@gmail.com>
Date
Sep 19, 2016, 13:16 UTC
Message-ID
<CACsJy8AGYPfX9936QJyKU8paxbt+SABMbeCWnpgVvODFr7v4LA@mail.gmail.com>
In-Reply-To
<xmqq1t0loxz4.fsf@gitster.mtv.corp.google.com>
On Fri, Sep 16, 2016 at 12:48 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> Aviv Eyal <avivey@gmail.com> writes:
>
>> Using `git add -N` allows creating of empty commits:
>>
>> git init test && cd test
>> echo text > file
>> git add --intent-to-add file
>> git commit -m 'Empty commit'
>> echo $?                                    # prints 0
>> ...
>> I'd expect `git commit` to error out instead of producing an empty commit.
>>
>> I've seen this with git 2.8.1 and 2.10.0.129.g35f6318
>
> I think I've seen this reported some time ago.
>
> https://public-inbox.org/git/%3CCACsJy8A8-RgpYxYsJBaLrMia7D3DfQPr4cxASNsaLyCnmgm3ZQ@mail.gmail.com%3E/
>
> I do not offhand recall what happend to the topic after that.

Yeah. I'm a bit behind, no, I'm waaaay behind my git backlog. This definitely gets a rise-up, together with the multiworktree bug fix in git-init.

-- 
Duy
Previous: Junio C Hamano
Message 3 of 3 in “git add --intent-to-add silently creates empty commits”
  1. Aviv EyalSep 15, 2016
  2. Junio C HamanoSep 15, 2016
  3. Duy NguyenSep 19, 2016

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.