Re: [PATCH/RFC] commit: new option to abort -a something is already staged
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 23, 2018, 02:15 UTC
- Message-ID
- <20180823021547.GE92374@aiede.svl.corp.google.com>
- In-Reply-To
- <20180823021156.GD92374@aiede.svl.corp.google.com>
A few quick corrections:
Jonathan Nieder wrote:
> I'm starting to lean toward having this on unconditionally, with a > message that points the user who really doesn't want to clobber their
... who really *does* want to clobber their index ...
Show 13 quoted lines
> index toward "git add -u", as a good idea. I think that for humans, > that would be okay and that configuration doesn't really help much > for this. > > The remaining question becomes scripts. A script might do > > ... modify old-file and create new-file ... > git add new-file > git commit -m "some great message" > > which would trip this error. For that matter, humans might do that, > too. Could the check detect this case (where the only changes in the > index are additions of new files) and treat it as non-destructive?
(where the only changes in the index are additions of new files *that match the worktree*)
Sorry for the noise, Jonathan