Re: Possible Bug with `git commit -a` in v2.41.0
- From
Jeff King <peff@peff.net>
- Date
- Jul 3, 2023, 19:29 UTC
- Message-ID
- <20230703192952.GB3546592@coredump.intra.peff.net>
- In-Reply-To
- <ZKMRAkH1r2mQ85Ff@vx12.orchestra.cse.unsw.EDU.AU>
On Tue, Jul 04, 2023 at 04:18:42AM +1000, Dylan Brotherston wrote:
Show 19 quoted lines
> $ git init > Initialized empty Git repository in /tmp/tmp.vXqq6iVaqq/.git/ > > $ echo "foo" > a > $ git add a > $ git commit -m "C1" > [master (root-commit) af7c07d] C1 > 1 file changed, 1 insertion(+) > create mode 100644 a > > $ rm a > $ git commit -a -m "C2" > On branch master > Changes not staged for commit: > (use "git add/rm <file>..." to update what will be committed) > (use "git restore <file>..." to discard changes in working directory) > deleted: a > > no changes added to commit (use "git add" and/or "git commit -a")
Thanks for an easy reproduction recipe. I think this bug has already been fixed by 2ee045eea1 (commit -a -m: allow the top-level tree to become empty again, 2023-06-29). That's currently in 'next', and slated to merge to 'master' soon (and hopefully will make it to 'maint' for a v2.41.1 release).
-Peff