All of lore.kernel.org
 help / color / mirror / Atom feed
* 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

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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.