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

Re: git-mv is not able to handle directory with one file in it

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Nov 23, 2005, 14:47 UTC
Message-ID
<200511231547.51988.Josef.Weidendorfer@gmx.de>
In-Reply-To
<200511231326.27972.lan@ac-sw.com>
On Wednesday 23 November 2005 08:26, Alexander Litvinov wrote:
Show 5 quoted lines
> I have found one error during directory movig: If I move directory with one 
> file somewhere in it this script will try to add target directory instead of 
> file. Commenting lines starting from 190 solve this error. But I don't 
> understand what is the logic behind this case ? Why do target directory 
> checked instead of target file ?

$src/$dst pairs match the arguments given on the command line of git-mv, And git-mv (as was git-rename) is able to move directory trees around.

It is simplier to keep the granularity at directories, as multiple moves of directories can not overlap each other. If you do it at file level, you have to remote and create directories yourself.

Of course, for git it is done at file level (that are the @srcfiles/@dstfiles arrays), but this is quite trivial as git does not work with directories, but only with files.

> Should we replace $dst my $destfiles[0] ?
Yes, that was part of my patch.
Josef
Previous: Josef WeidendorferNext: Randal L. Schwartz
Message 22 of 23 in “git-mv is not able to handle big directories”
  1. git-mv is not able to handle big directoriesAlexander Litvinov, Nov 23, 2005
  2. Junio C HamanoNov 23, 2005
  3. Junio C HamanoNov 23, 2005
  4. Randal L. SchwartzNov 23, 2005
  5. Junio C HamanoNov 23, 2005
  6. Ryan AndersonNov 23, 2005
  7. Perl version support (was Re: [PATCH] git-mv is not able to handle big directories)Randal L. Schwartz, Nov 23, 2005
  8. Junio C HamanoNov 23, 2005
  9. Randal L. SchwartzNov 23, 2005
  10. H. Peter AnvinNov 23, 2005
  11. Randal L. SchwartzNov 23, 2005
  12. Morten WelinderNov 23, 2005
  13. Ryan AndersonNov 28, 2005
  14. Andreas EricssonNov 28, 2005
  15. Junio C HamanoNov 23, 2005
  16. Ryan AndersonNov 23, 2005
  17. Alexander LitvinovNov 23, 2005
  18. Andreas EricssonNov 23, 2005
  19. Alexander LitvinovNov 23, 2005
  20. Alexander LitvinovNov 23, 2005
  21. Josef WeidendorferNov 23, 2005
  22. Josef WeidendorferNov 23, 2005
  23. Randal L. SchwartzNov 23, 2005

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.