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

Re: Moving a directory into another fails

From
Petr Baudis <pasky@suse.cz>
Date
Jul 28, 2006, 01:43 UTC
Message-ID
<20060728014350.GI13776@pasky.or.cz>
In-Reply-To
<9e4733910607261603m6772602cr333d8c58f555edaa@mail.gmail.com>

Dear diary, on Thu, Jul 27, 2006 at 01:03:30AM CEST, I got a letter where Jon Smirl <jonsmirl@gmail.com> said that...

Show 10 quoted lines
> This is a simpler sequence
> 
> cg clone git foo
> cg clone git foo1
> cd foo
> mkdir zzz
> git mv gitweb zzz
> cg diff >patch
> cg ../foo1
> cg patch <../foo/patch
Even simpler one:
	mkdir zzz
	cg-mv gitweb zzz
	cg-diff | cg-patch -R
(which would even undo the mess supposing that it worked properly)
> [jonsmirl@jonsmirl foo1]$ cg patch <../foo/patch
> mv: cannot move `gitweb/README' to `zzz/gitweb/README': No such file
> or directory
Oops. Thanks, fixed with this:
diff --git a/cg-patch b/cg-patch
index cc82f1f..923df0e 100755
--- a/cg-patch
+++ b/cg-patch
@@ -145,6 +145,8 @@ redzone_border()
 			echo "$file1: rename destination $file2 already exists, NOT RENAMING" >&2
 			return
 		fi
+		# FIXME: Remove stale empty directories related to $mvfrom
+		case $mvto in */*) mkdir -p "${mvto%/*}";; esac
 		mv "$mvfrom" "$mvto"
 	fi
 	if [ "$op" = "delete" -o "$op" = "rename" ]; then

> mv: cannot stat `"gitweb/test/M\\303\\244rchen"': No such file or directory

Junio, how am I supposed to unmangle this *censored* stuff?
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
Previous: Nicolas VilzNext: Stefan Pfetzing
Message 5 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.