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

Re: [PATCH 1/2] t7001: add test for git-mv dir1 dir2/

From
Junio C Hamano <junkio@cox.net>
Date
Jul 26, 2006, 18:23 UTC
Message-ID
<7virlkrzr4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<9e4733910607261050k5f8d8d5dke5ded3a806b46f21@mail.gmail.com>
"Jon Smirl" <jonsmirl@gmail.com> writes:
Show 12 quoted lines
> An exact test case:
>
> git clone git foo
> git clone git foo1
> cd foo
> mkdir zzz
> git mv gitweb zzz
> cg diff >patch
> cd ../foo1
> cg patch <../foo/patch
>
> This patch won't apply because zzz does not exist in foo1

A short and sweet reproduction recipe is essential for a problem report like this, and I appreciate it very much. "git mv" in "master" should do the right thing and I see Johannes fixing (or fixed) the problem of "git mv" failing in his version.

We should correctly handle cases that fit your general description (the test t/t4112-apply-renames.sh has a file in "klibc/arch/x86_64" which is renamed and copied to two different locations under "include/arch"). The above does not reproduce for me if I used "git diff HEAD >patch" in place of "cg diff" (I cannot make cg behave on my machine).

$ mkdir zzz $ ~/git-master/bin/git-mv gitweb zzz/ $ LANG=C LC_ALL=C find gitweb zzz -type f -print find: gitweb: No such file or directory zzz/gitweb/README zzz/gitweb/gitweb.cgi zzz/gitweb/gitweb.css zzz/gitweb/test/M??rchen zzz/gitweb/test/file with spaces zzz/gitweb/test/file+plus+sign $ git diff HEAD >patch $ git checkout -f HEAD $ LANG=C LC_ALL=C find gitweb zzz -type f -print gitweb/README gitweb/gitweb.cgi gitweb/gitweb.css gitweb/test/M??rchen gitweb/test/file with spaces gitweb/test/file+plus+sign find: zzz: No such file or directory $ git apply --index <patch $ LANG=C LC_ALL=C find gitweb zzz -type f -print zzz/gitweb/README zzz/gitweb/gitweb.cgi zzz/gitweb/gitweb.css zzz/gitweb/test/M??rchen zzz/gitweb/test/file with spaces zzz/gitweb/test/file+plus+sign

A couple of weeks ago test t/t4114-apply-typechange.sh was added by Eric Wong, and it caught cases where git-apply was assuming that leading directories of a new file already exists or was complaining when you create file "foo" and remove a file "foo/bar" (that is, you used to have directory at "foo"). The problems that test found were all fixed as far as I recall.

Previous: Jon SmirlNext: Jon Smirl
Message 3 of 22 in “t7001: add test for git-mv dir1 dir2/”
  1. 1/2 t7001: add test for git-mv dir1 dir2/Johannes Schindelin, Jul 26, 2006
  2. Jon SmirlJul 26, 2006
  3. Junio C HamanoJul 26, 2006
  4. Jon SmirlJul 26, 2006
  5. Junio C HamanoJul 26, 2006
  6. Junio C HamanoJul 26, 2006
  7. Jon SmirlJul 26, 2006
  8. Johannes SchindelinJul 26, 2006
  9. Josef WeidendorferJul 26, 2006
  10. Junio C HamanoJul 26, 2006
  11. Petr BaudisJul 28, 2006
  12. Junio C HamanoJul 28, 2006
  13. Petr BaudisJul 28, 2006
  14. Junio C HamanoJul 28, 2006
  15. Petr BaudisJul 28, 2006
  16. Teach git-apply about '-R'Johannes Schindelin, Jul 28, 2006
  17. Linus TorvaldsJul 28, 2006
  18. Teach git-apply about '-R'Johannes Schindelin, Jul 28, 2006
  19. Junio C HamanoJul 28, 2006
  20. Johannes SchindelinJul 28, 2006
  21. Junio C HamanoJul 28, 2006
  22. Johannes SchindelinJul 28, 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.