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

Re: [BUG] 'git mv a/fileA b/fileB' causes 'c/fileC' to be deleted

From
MCMichael Cassar <m.e.cassar@gmail.com>
Date
Oct 2, 2006, 01:33 UTC
Message-ID
<750170aa0610011833n39271704q349d86af76832783@mail.gmail.com>
In-Reply-To
<7vpsdc0wkz.fsf@assigned-by-dhcp.cox.net>
On 10/2/06, Junio C Hamano <junkio@cox.net> wrote:
> There could be a bigger problem, but it does not seem to easily
> reproduce as you noted in the message.  It could be that some
> unrelated thing in the working tree is playing a role in this
> breakage, but I do not think of offhand what that is.
> [...]  Care to show a bit more details
> on your working tree?
Okay, I should stop being lazy and actually produce a minimal test-case.
Here we go:

--CUT-- #!/bin/bash

git init-db

mkdir papers mkdir papers/unsorted mkdir papers/all-papers mkdir partA echo 'moo' > papers/unsorted/Thesis.pdf echo 'cow' > partA/outline.txt echo 'this file has brackets in its filename' > 'papers/unsorted/(brackets).pdf'

git add papers partA git commit -m 'intial commit'

git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf git commit -m 'move a file'

cg log -f --CUT--

The problem seems to have come from the fact that a file in the source directory of the move contained brackets in its filename.Removing the file causes the problem to go away.

Hope this helps a little,
Mike
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “[BUG] 'git mv a/fileA b/fileB' causes 'c/fileC' to be deleted”
  1. Michael CassarOct 1, 2006
  2. Junio C HamanoOct 1, 2006
  3. Michael CassarOct 2, 2006
  4. Junio C HamanoOct 2, 2006
  5. Junio C HamanoOct 2, 2006

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.