Re: [PATCH/RFC] commit: new option to abort -a something is already staged
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Aug 24, 2018, 03:02 UTC
- Message-ID
- <CA+P7+xq3m8PXo9wYu1L7p4uG4hf-i=uwQdh+e=0QJXG1cBi04A@mail.gmail.com>
- In-Reply-To
- <xmqqr2ipje5i.fsf@gitster-ct.c.googlers.com>
On Thu, Aug 23, 2018 at 9:28 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> I think the above example forgets "-a" on the final "git commit" > step. With it added, I can understand the concern (and I am sure > you would, too). > > The user is trying to add everything done in the working tree, and > "commit -a" would catch all changes to paths that were already > tracked, but a separate "add" is necessary for newly created paths. > But adding a new path means the index no longer matches HEAD, and > the "commit -a" at the final step sweeps the changes to already > tracked paths---failing that because there "already is something > staged" will break the workflow.
Right. I think this would need to be able to understand the case of "different only by new files".
Thanks, Jake