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

2016-09-19 Thread Duy Nguyen
On Fri, Sep 16, 2016 at 12:48 AM, Junio C Hamano  wrote:
> Aviv Eyal  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-rgpyxysjbalrmia7d3dfqpr4cxasnsalycnmgm...@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 wy behind my git backlog. This
definitely gets a rise-up, together with the multiworktree bug fix in
git-init.
-- 
Duy


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

2016-09-15 Thread Junio C Hamano
Aviv Eyal  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-rgpyxysjbalrmia7d3dfqpr4cxasnsalycnmgm...@mail.gmail.com%3E/

I do not offhand recall what happend to the topic after that.


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

2016-09-14 Thread Aviv Eyal
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