From: Andreas Ericsson <ae@op5.se>
To: git@vger.kernel.org
Subject: Re: git-mv is not able to handle directory with one file in it
Date: Wed, 23 Nov 2005 08:57:00 +0100 [thread overview]
Message-ID: <438420CC.4050303@op5.se> (raw)
In-Reply-To: <200511231326.27972.lan@ac-sw.com>
Alexander Litvinov wrote:
> 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.
Are you saying this setup
foodir/somefile.c <--file
newdir/ <--directory
with this command
git-mv foodir/ newdir
tries to create
newdir/foodir/somefile.c <-- directory
or does it create
newdir/somefile.c <-- file
?
It should create
newdir/foodir/somefile.c <-- file
Otherwise it's misbehaving.
Try running it with the -v switch to make it shout out loud what it's
trying to do, and then paste the output here.
> 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 ? Should we replace $dst my $destfiles[0] ?
>
> at line 190 in git-mv:
> if (scalar @srcfiles == 1) {
> if ($overwritten{$dst} ==1) {
> push @changedfiles, $dst;
> } else {
> push @addedfiles, $dst;
> }
> }
> else {
> push @addedfiles, @dstfiles;
> }
This is broken. It only checks if there's just one source-file
regardless of whether or not it resided in a subdirectory. I'm not
exactly fluent in perl so I can't submit a patch, but the src option
needs to be directory aware, traverse all source directories and then
move the files axing everything but the bottom-most dirname to the
destination directory.
Any takers?
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
next prev parent reply other threads:[~2005-11-23 7:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-23 5:41 [PATCH] git-mv is not able to handle big directories Alexander Litvinov
2005-11-23 6:14 ` Junio C Hamano
2005-11-23 6:32 ` Junio C Hamano
2005-11-23 7:55 ` Randal L. Schwartz
2005-11-23 8:37 ` Junio C Hamano
2005-11-23 13:56 ` Ryan Anderson
2005-11-23 14:27 ` Perl version support (was Re: [PATCH] git-mv is not able to handle big directories) Randal L. Schwartz
2005-11-23 19:47 ` Perl version support Junio C Hamano
2005-11-23 19:59 ` Randal L. Schwartz
2005-11-23 21:56 ` Perl version support (was Re: [PATCH] git-mv is not able to handle big directories) H. Peter Anvin
2005-11-23 22:01 ` Randal L. Schwartz
2005-11-23 22:02 ` Morten Welinder
2005-11-28 1:46 ` Ryan Anderson
2005-11-28 8:49 ` Andreas Ericsson
2005-11-23 18:53 ` [PATCH] git-mv is not able to handle big directories Junio C Hamano
2005-11-23 19:54 ` Ryan Anderson
[not found] ` <200511231619.41497.lan@ac-sw.com>
2005-11-23 14:29 ` Randal L. Schwartz
2005-11-23 7:26 ` git-mv is not able to handle directory with one file in it Alexander Litvinov
2005-11-23 7:57 ` Andreas Ericsson [this message]
2005-11-23 9:57 ` Alexander Litvinov
2005-11-23 10:21 ` Alexander Litvinov
2005-11-23 11:07 ` Josef Weidendorfer
2005-11-23 14:47 ` Josef Weidendorfer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=438420CC.4050303@op5.se \
--to=ae@op5.se \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.