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

Re: Moving a directory into another fails

From
Nicolas Vilz <niv@iaglans.de>
Date
Jul 26, 2006, 22:34 UTC
Message-ID
<20060726223459.GA30601@vsectoor.geht-ab-wie-schnitzel.de>
In-Reply-To
<9e4733910607260800v618edf0em7b0f5c3332bf8fc5@mail.gmail.com>
On Wed, Jul 26, 2006 at 11:00:48AM -0400, Jon Smirl wrote:
Show 9 quoted lines
> I cloned a git project. Then in the original I did mkdir for a new
> directory and use git mv to move an existing directory into it. I then
> used cg diff to generate a patch for the move.
> 
> When I use cg patch to apply this patch to the cloned tree it fails.
> This seems to be a problem in the git code, not cg.  It is not picking
> up the creation of the new intervening subdirectory correctly.
> 
> I just synced and this does not work in the current code.

I tried to reproduce your scenario and before that I setup a test repository.

(1) mkdir git_test (2) cd git_test (3) git init-db (4) vim test.txt # fill in some bogus text (5) mkdir testing (6) cd testing (7) vim test1.txt # again, fill in some bogus text (8) cd .. (9) cg add test.txt testing/test1.txt (10) cg commit -C # just give a fancy commit message... (11) cd .. (12) mkdir bare_git (13) cd bare_git (14) mkdir git_test.git (15) GIT_DIR=git_test.git git init-db (16) cd ../git_test (17) git push ../bare_git/git_test.git --all (18) cd ../ (19) git clone bare_git/git_test.git git_test2 (20) cd git_test (21) mkdir blah_test (22) git mv testing/ blah_test/ (23) cg diff > ../mkdir_patch.diff (24) cd .. (25) cd git_test2/ (26) cg patch < ../mkdir_patch.diff

from the last one (26) i get 

patching file blah_test/testing/test1.txt patching file testing/test1.txt touch: cannot touch `testing/test1.txt': No such file or directory Adding file blah_test/testing/test1.txt Removing file testing/test1.txt

but the result is correct. There is no testing-directory in here anymore, and inside blah_test, there is my testing dir with the file test1.txt in it...

did I miss something?

I use cogito-0.17.3 with git version 1.4.1 (obviously without that recently rewritten git-mv...)

Nicolas
Previous: Jon SmirlNext: Jon Smirl
Message 2 of 24 in “Moving a directory into another fails”
  1. Jon SmirlJul 26, 2006
  2. Nicolas VilzJul 26, 2006
  3. Jon SmirlJul 26, 2006
  4. Nicolas VilzJul 26, 2006
  5. Petr BaudisJul 28, 2006
  6. Stefan PfetzingDec 4, 2006
  7. Jakub NarebskiDec 4, 2006
  8. Johannes SchindelinDec 4, 2006
  9. Jakub NarebskiDec 4, 2006
  10. Johannes SchindelinDec 4, 2006
  11. Jakub NarebskiDec 4, 2006
  12. Linus TorvaldsDec 4, 2006
  13. Linus TorvaldsDec 4, 2006
  14. Shawn PearceDec 4, 2006
  15. Jakub NarebskiDec 4, 2006
  16. Johannes SchindelinDec 4, 2006
  17. Linus TorvaldsDec 4, 2006
  18. Johannes SchindelinDec 5, 2006
  19. Jakub NarebskiDec 5, 2006
  20. filesystem encodings and gitweb tests, was Re: Moving a directory into another failsJohannes Schindelin, Dec 5, 2006
  21. Jakub NarebskiDec 5, 2006
  22. Johannes SchindelinDec 5, 2006
  23. Linus TorvaldsDec 5, 2006
  24. Johannes SchindelinDec 4, 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.