Git Mailing List Archive mirror
 help / color / mirror / Atom feed
* Possible Bug with `git commit -a` in v2.41.0
@ 2023-07-03 18:18 Dylan Brotherston
  2023-07-03 19:29 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Dylan Brotherston @ 2023-07-03 18:18 UTC (permalink / raw)
  To: git@vger.kernel.org

`git commit -a` is unable to remove the last file in the index in v2.41.0

 

comparing git version 2.30.2 to 2.41.0

 

```

$ git --version

git version 2.30.2

$ git init

Initialized empty Git repository in /tmp/tmp.vXqq6iVaqq/.git/

$ echo "foo" > a

$ git add a

$ git commit -m "C1"

[master (root-commit) b3abdc4] C1

 1 file changed, 1 insertion(+)

 create mode 100644 a

$ rm a

$ git commit -a -m "C2"

[master c3d4c44] C2

 1 file changed, 1 deletion(-)

 delete mode 100644 a

```

 

```

$ git --version

git version 2.41.0

$ 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")

```

 

- Dylan Brotherston

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Possible Bug with `git commit -a` in v2.41.0
  2023-07-03 18:18 Possible Bug with `git commit -a` in v2.41.0 Dylan Brotherston
@ 2023-07-03 19:29 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2023-07-03 19:29 UTC (permalink / raw)
  To: Dylan Brotherston
  Cc: Junio C Hamano, Johannes Schindelin, git@vger.kernel.org

On Tue, Jul 04, 2023 at 04:18:42AM +1000, Dylan Brotherston wrote:

> $ 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-03 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03 18:18 Possible Bug with `git commit -a` in v2.41.0 Dylan Brotherston
2023-07-03 19:29 ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).