* git add --intent-to-add silently creates empty commits @ 2016-09-15 5:01 Aviv Eyal 2016-09-15 17:48 ` Junio C Hamano 0 siblings, 1 reply; 3+ messages in thread From: Aviv Eyal @ 2016-09-15 5:01 UTC (permalink / raw) To: git Hello, I think this is an unintended behavior, but I might be wrong: 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 git log -1 -p --format='' HEAD | wc -l # prints 0 git status -s # prints `AM file` 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 Thanks, Aviv ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git add --intent-to-add silently creates empty commits 2016-09-15 5:01 git add --intent-to-add silently creates empty commits Aviv Eyal @ 2016-09-15 17:48 ` Junio C Hamano 2016-09-19 13:16 ` Duy Nguyen 0 siblings, 1 reply; 3+ messages in thread From: Junio C Hamano @ 2016-09-15 17:48 UTC (permalink / raw) To: Aviv Eyal, Nguyễn Thái Ngọc Duy; +Cc: git 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. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git add --intent-to-add silently creates empty commits 2016-09-15 17:48 ` Junio C Hamano @ 2016-09-19 13:16 ` Duy Nguyen 0 siblings, 0 replies; 3+ messages in thread From: Duy Nguyen @ 2016-09-19 13:16 UTC (permalink / raw) To: Junio C Hamano; +Cc: Aviv Eyal, Git Mailing List On Fri, Sep 16, 2016 at 12:48 AM, Junio C Hamano <gitster@pobox.com> wrote: > 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-19 13:17 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-09-15 5:01 git add --intent-to-add silently creates empty commits Aviv Eyal 2016-09-15 17:48 ` Junio C Hamano 2016-09-19 13:16 ` Duy Nguyen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).