git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bugreport

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jan 19, 2024, 23:14 UTC
Message-ID
<ZasCZ0YetzmlBFvw@tapette.crustytoothpaste.net>
In-Reply-To
<20240119132551.GA31532@debian64>
On 2024-01-19 at 13:25:51, Frank Schwidom wrote:
Show 26 quoted lines
> 
> This bug exists in possibly all git versions.
> 
> $ git init
> $ touch a.txt
> $ ln -s a.txt d
> $ git add .
> $ git commit -m + .
> [master (root-commit) f6b4468] +
>  2 files changed, 1 insertion(+)
>  create mode 100644 a.txt
>  create mode 120000 d
> $ ls -la
> total 12
> drwxr-xr-x 3 ox ox 4096 Jan 19 14:10 .
> drwxr-xr-x 4 ox ox 4096 Jan 19 14:04 ..
> drwxr-xr-x 8 ox ox 4096 Jan 19 14:10 .git
> -rw-r--r-- 1 ox ox    0 Jan 19 14:10 a.txt
> lrwxrwxrwx 1 ox ox    5 Jan 19 14:10 d -> a.txt
> $ rm d
> $ mkdir d
> $ touch d/b.txt
> $ git add .
> $ git commit . -m +
> error: 'd' does not have a commit checked out
> fatal: updating files failed

I can confirm this behaviour[0], and it's definitely wrong that it thinks `d` is a submodule. It does, however, work if you do `git commit -m +` (that is, without the .), which makes sense since the relevant change is already staged in the index.

I'm not going to get to a patch or more thorough investigation, but perhaps someone else will.

[0] git version 2.43.0.381.gb435a96ce8
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Frank SchwidomNext: Jeff King
Message 2 of 6 in “Bugreport”
  1. Frank SchwidomJan 19, 2024
  2. brian m. carlsonJan 19, 2024
  3. partial commit of file-to-directory change, was Re: BugreportJeff King, Jan 20, 2024
  4. Junio C HamanoJan 20, 2024
  5. Junio C HamanoJan 20, 2024
  6. Junio C HamanoJan 25, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.