* [PATCH] Allow git-svnimport to take "" as the trunk directory.
@ 2007-08-14 4:03 Alberto Bertogli
2007-08-14 5:45 ` David Kastrup
0 siblings, 1 reply; 4+ messages in thread
From: Alberto Bertogli @ 2007-08-14 4:03 UTC (permalink / raw)
To: git; +Cc: llucax, Alberto Bertogli
Some repositories started with the trunk in "/" and then moved it to the
standard "trunk/" location.
On these repositories, the correct thing would be to call git-svnimport -T "",
but because of the way the options are handled, it uses the default "trunk"
instead of the given empty string. This patch fixes that behaviour.
Reported by Leandro Lucarella <llucax@gmail.com>.
Signed-off-by: Alberto Bertogli <albertito@gmail.com>
---
While the same could be done for tags and branches, I don't think it makes
much sense.
git-svnimport.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-svnimport.perl b/git-svnimport.perl
index b73d649..8c17fb5 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -49,7 +49,7 @@ getopts("A:b:C:dDFhiI:l:mM:o:rs:t:T:SP:R:uv") or usage();
usage if $opt_h;
my $tag_name = $opt_t || "tags";
-my $trunk_name = $opt_T || "trunk";
+my $trunk_name = defined $opt_T ? $opt_T : "trunk";
my $branch_name = $opt_b || "branches";
my $project_name = $opt_P || "";
$project_name = "/" . $project_name if ($project_name);
--
1.5.3.rc4.67.gf9286-dirty
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Allow git-svnimport to take "" as the trunk directory.
2007-08-14 4:03 [PATCH] Allow git-svnimport to take "" as the trunk directory Alberto Bertogli
@ 2007-08-14 5:45 ` David Kastrup
2007-08-14 12:36 ` Leandro Lucarella
0 siblings, 1 reply; 4+ messages in thread
From: David Kastrup @ 2007-08-14 5:45 UTC (permalink / raw)
To: Alberto Bertogli; +Cc: git, llucax
Alberto Bertogli <albertito@gmail.com> writes:
> Some repositories started with the trunk in "/" and then moved it to the
> standard "trunk/" location.
>
> On these repositories, the correct thing would be to call
> git-svnimport -T "",
I would not call that the best solution: it makes the bad decision
from the past impact useful work in the future. I very much like git
having a good toplevel directory structure.
There are two approaches possible: one is to version the mapping
trunk/tags/branches. Another would be if one could tell git-svn where
to stick stuff that does not sort into trunk/tags/branches.
Incidentally, I've seen repositories that have something like a
"support" or "vendor" directory, too.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Allow git-svnimport to take "" as the trunk directory.
2007-08-14 5:45 ` David Kastrup
@ 2007-08-14 12:36 ` Leandro Lucarella
2007-08-14 13:33 ` David Kastrup
0 siblings, 1 reply; 4+ messages in thread
From: Leandro Lucarella @ 2007-08-14 12:36 UTC (permalink / raw)
To: David Kastrup; +Cc: Alberto Bertogli, git
David Kastrup, el 14 de agosto a las 07:45 me escribiste:
> Alberto Bertogli <albertito@gmail.com> writes:
>
> > Some repositories started with the trunk in "/" and then moved it to the
> > standard "trunk/" location.
> >
> > On these repositories, the correct thing would be to call
> > git-svnimport -T "",
>
> I would not call that the best solution: it makes the bad decision
> from the past impact useful work in the future. I very much like git
> having a good toplevel directory structure.
Besides the example of a mutating trunk directory, I have repositories
where there is only trunk (in "/" directory) and it never changes. Without
this patch, I can't even import that kind of repositories.
With repositories with a mutating trunk directory, I used the options -s
and -l to incrementally import the repository. For example:
$ git svnimport -l 100 -T '' <repo>
and then
$ git svnimport -s 101 -T 'trunk' <repo>
> There are two approaches possible: one is to version the mapping
> trunk/tags/branches. Another would be if one could tell git-svn where
> to stick stuff that does not sort into trunk/tags/branches.
> Incidentally, I've seen repositories that have something like a
> "support" or "vendor" directory, too.
The patch is for git-svnimport, not git-svn (but maybe git-svn has
the same problem). Anyways, a way to map trunk/tags/branches to different
directories in different versions would be great, but is a different
problem than -T not supporting an empty string.
--
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
.------------------------------------------------------------------------,
\ GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05 /
'--------------------------------------------------------------------'
Como un rinoceronte que lleva un pájaro en el lomo,
yo te alimento, no te veo ni te toco.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Allow git-svnimport to take "" as the trunk directory.
2007-08-14 12:36 ` Leandro Lucarella
@ 2007-08-14 13:33 ` David Kastrup
0 siblings, 0 replies; 4+ messages in thread
From: David Kastrup @ 2007-08-14 13:33 UTC (permalink / raw)
To: git
Leandro Lucarella <llucax@gmail.com> writes:
> David Kastrup, el 14 de agosto a las 07:45 me escribiste:
>> Alberto Bertogli <albertito@gmail.com> writes:
>>
>> > Some repositories started with the trunk in "/" and then moved it to the
>> > standard "trunk/" location.
>> >
>> > On these repositories, the correct thing would be to call
>> > git-svnimport -T "",
>>
>> I would not call that the best solution: it makes the bad decision
>> from the past impact useful work in the future. I very much like git
>> having a good toplevel directory structure.
>
> Besides the example of a mutating trunk directory, I have repositories
> where there is only trunk (in "/" directory) and it never changes. Without
> this patch, I can't even import that kind of repositories.
[...]
> The patch is for git-svnimport, not git-svn
Oops. In that case, I have no qualified opinion.
--
David Kastrup
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-08-14 13:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-14 4:03 [PATCH] Allow git-svnimport to take "" as the trunk directory Alberto Bertogli
2007-08-14 5:45 ` David Kastrup
2007-08-14 12:36 ` Leandro Lucarella
2007-08-14 13:33 ` David Kastrup
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).