git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse
       [not found]   ` <200709171333.48331.danda@osc.co.cr>
@ 2007-09-18  7:47     ` Matthias Urlichs
  2007-09-18  8:54       ` Junio C Hamano
  2007-09-20 19:07       ` Dan Libby
  0 siblings, 2 replies; 9+ messages in thread
From: Matthias Urlichs @ 2007-09-18  7:47 UTC (permalink / raw)
  To: Dan Libby; +Cc: git


Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
---
Please tell me whether that works for you.

Somebody else, preferably its author, can fix git-svn. ;-)

diff --git a/git-svnimport.perl b/git-svnimport.perl
index d3ad5b9..aa5b3b2 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -633,7 +633,7 @@ sub commit {
 
 	my $rev;
 	if($revision > $opt_s and defined $parent) {
-		open(H,"git-rev-parse --verify $parent |");
+		open(H,'-|',"git-rev-parse","--verify",$parent);
 		$rev = <H>;
 		close(H) or do {
 			print STDERR "$revision: cannot find commit '$parent'!\n";
-- 
1.5.2.5

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
"Could a being create the fifty billion galaxies, each with two hundred
 billion stars, then rejoice in the smell of burning goat flesh?"
                         [Ron Patterson]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse
  2007-09-18  7:47     ` [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse Matthias Urlichs
@ 2007-09-18  8:54       ` Junio C Hamano
  2007-09-18  9:29         ` Matthias Urlichs
  2007-09-20 19:07       ` Dan Libby
  1 sibling, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2007-09-18  8:54 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: Dan Libby, git

Matthias Urlichs <smurf@smurf.noris.de> writes:

> Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
> ---
> Please tell me whether that works for you.
>
> Somebody else, preferably its author, can fix git-svn. ;-)
> 
> diff --git a/git-svnimport.perl b/git-svnimport.perl
> index d3ad5b9..aa5b3b2 100755
> --- a/git-svnimport.perl
> +++ b/git-svnimport.perl
> @@ -633,7 +633,7 @@ sub commit {
>  
>  	my $rev;
>  	if($revision > $opt_s and defined $parent) {
> -		open(H,"git-rev-parse --verify $parent |");
> +		open(H,'-|',"git-rev-parse","--verify",$parent);
>  		$rev = <H>;
>  		close(H) or do {
>  			print STDERR "$revision: cannot find commit '$parent'!\n";

I seem to be missing the context, but please describe what
problem this fixes in the commit log message.  I guess some
people use shell metacharacters and/or SP in their branch names
and this is about that problem?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse
  2007-09-18  8:54       ` Junio C Hamano
@ 2007-09-18  9:29         ` Matthias Urlichs
  2007-09-20 19:40           ` Dan Libby
  0 siblings, 1 reply; 9+ messages in thread
From: Matthias Urlichs @ 2007-09-18  9:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Dan Libby, git

Some people seem to create SVN branch names with spaces
or other shell metacharacters.

Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
---
Junio C Hamano:
> > -		open(H,"git-rev-parse --verify $parent |");
> > +		open(H,'-|',"git-rev-parse","--verify",$parent);
> 
> I seem to be missing the context, but please describe what
> problem this fixes in the commit log message.  I guess some
> people use shell metacharacters and/or SP in their branch names
> and this is about that problem?

Exactly. Sorry; it seems that the original question hasn't been posted
to the mailing list.

diff --git a/git-svnimport.perl b/git-svnimport.perl
index d3ad5b9..aa5b3b2 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -633,7 +633,7 @@ sub commit {
 
 	my $rev;
 	if($revision > $opt_s and defined $parent) {
-		open(H,"git-rev-parse --verify $parent |");
+		open(H,'-|',"git-rev-parse","--verify",$parent);
 		$rev = <H>;
 		close(H) or do {
 			print STDERR "$revision: cannot find commit '$parent'!\n";



-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
BOFH excuse #11:

magnetic interference from money/credit cards

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse
  2007-09-18  7:47     ` [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse Matthias Urlichs
  2007-09-18  8:54       ` Junio C Hamano
@ 2007-09-20 19:07       ` Dan Libby
  1 sibling, 0 replies; 9+ messages in thread
From: Dan Libby @ 2007-09-20 19:07 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: git

Hi, it worked for the small test case.  I am trying it on the large repo now, 
and will let you know how it turns out.  thanks!

On Tuesday 18 September 2007 01:47, Matthias Urlichs wrote:
> Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
> ---
> Please tell me whether that works for you.
>
> Somebody else, preferably its author, can fix git-svn. ;-)
>
> diff --git a/git-svnimport.perl b/git-svnimport.perl
> index d3ad5b9..aa5b3b2 100755
> --- a/git-svnimport.perl
> +++ b/git-svnimport.perl
> @@ -633,7 +633,7 @@ sub commit {
>
>  	my $rev;
>  	if($revision > $opt_s and defined $parent) {
> -		open(H,"git-rev-parse --verify $parent |");
> +		open(H,'-|',"git-rev-parse","--verify",$parent);
>  		$rev = <H>;
>  		close(H) or do {
>  			print STDERR "$revision: cannot find commit '$parent'!\n";
> --
> 1.5.2.5

-- 
Dan Libby

Open Source Consulting
San Jose, Costa Rica
http://osc.co.cr
phone: 011 506 223 7382
Fax: 011 506 223 7359

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse
  2007-09-18  9:29         ` Matthias Urlichs
@ 2007-09-20 19:40           ` Dan Libby
  2007-09-21  6:11             ` Matthias Urlichs
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Libby @ 2007-09-20 19:40 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: Junio C Hamano, git

Hi Matthias,

So the svnimport (with your patch) chugged along for quite a while, but now 
I've run into a new (related?) problem.  Here's the output:

--
Merge parent branch: 57b2ce794c20e71efa9c7bd0cc71df72e01f5d39
Commit ID 37f501fd2fd0d309b4d3fdce77bac13c84646423
Writing to refs/heads/Verny
DONE: 2385 Verny 37f501fd2fd0d309b4d3fdce77bac13c84646423
Switching from 37f501fd2fd0d309b4d3fdce77bac13c84646423 to 
0e1b0bb88f077b66c6cf537899ab6c0a69d5ec30 (/Cristian new code)
we do not like 'Cristian new code' as a tag name.
Cannot create tag Cristian new code: Bad file descriptor
--

This is a fatal error that stops the import.

regards,

On Tuesday 18 September 2007 03:29, Matthias Urlichs wrote:
> Some people seem to create SVN branch names with spaces
> or other shell metacharacters.
>
> Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
> ---
>
> Junio C Hamano:
> > > -		open(H,"git-rev-parse --verify $parent |");
> > > +		open(H,'-|',"git-rev-parse","--verify",$parent);
> >
> > I seem to be missing the context, but please describe what
> > problem this fixes in the commit log message.  I guess some
> > people use shell metacharacters and/or SP in their branch names
> > and this is about that problem?
>
> Exactly. Sorry; it seems that the original question hasn't been posted
> to the mailing list.
>
> diff --git a/git-svnimport.perl b/git-svnimport.perl
> index d3ad5b9..aa5b3b2 100755
> --- a/git-svnimport.perl
> +++ b/git-svnimport.perl
> @@ -633,7 +633,7 @@ sub commit {
>
>  	my $rev;
>  	if($revision > $opt_s and defined $parent) {
> -		open(H,"git-rev-parse --verify $parent |");
> +		open(H,'-|',"git-rev-parse","--verify",$parent);
>  		$rev = <H>;
>  		close(H) or do {
>  			print STDERR "$revision: cannot find commit '$parent'!\n";

-- 
Dan Libby

Open Source Consulting
San Jose, Costa Rica
http://osc.co.cr
phone: 011 506 223 7382
Fax: 011 506 223 7359

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse
  2007-09-20 19:40           ` Dan Libby
@ 2007-09-21  6:11             ` Matthias Urlichs
  2007-09-21  6:59               ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Matthias Urlichs @ 2007-09-21  6:11 UTC (permalink / raw)
  To: Dan Libby; +Cc: Junio C Hamano, git

Hi,

Dan Libby:
> we do not like 'Cristian new code' as a tag name.

Duh? That's a perfectly valid tag name.
I have no idea why git croaked on this one.

Please run 

    strace -f -s300 -eexecve git-svnimport ... 2>&1 | \
		grep check-ref-format | grep -v ENOENT

and mail me the output, replacing the "..." with your normal arguments
of course.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Taken as a whole, the universe is absurd.
					-- Walter Savage Landor

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse
  2007-09-21  6:11             ` Matthias Urlichs
@ 2007-09-21  6:59               ` Junio C Hamano
  2007-09-21 10:24                 ` Matthias Urlichs
  0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2007-09-21  6:59 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: Dan Libby, git

Matthias Urlichs <smurf@smurf.noris.de> writes:

>> we do not like 'Cristian new code' as a tag name.
>
> Duh? That's a perfectly valid tag name.

Is it?

$ man git-check-ref-format

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse
  2007-09-21  6:59               ` Junio C Hamano
@ 2007-09-21 10:24                 ` Matthias Urlichs
  2007-09-21 20:21                   ` Dan Libby
  0 siblings, 1 reply; 9+ messages in thread
From: Matthias Urlichs @ 2007-09-21 10:24 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Dan Libby, git

Hi,

Junio C Hamano:
> Matthias Urlichs <smurf@smurf.noris.de> writes:
> 
> >> we do not like 'Cristian new code' as a tag name.
> >
> > Duh? That's a perfectly valid tag name.
> 
> Is it?
> 
> $ man git-check-ref-format

Bah, stupid me. You're right, obviously.

I'll replace them with underscores. :-/

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Murphy's Law:
If anything can go wrong, it will.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse
  2007-09-21 10:24                 ` Matthias Urlichs
@ 2007-09-21 20:21                   ` Dan Libby
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Libby @ 2007-09-21 20:21 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: Junio C Hamano, git

Hi,

I saw this, so I haven't run the strace command you mentioned.  No need now, 
right?

I'm no expert on these things, but I'd think that it should be replacing (or 
escaping) any characters (not just spaces) that are not allowed by 
git-check-ref-format.

For us, replacing any such characters with _ should work fine.

regards,

On Friday 21 September 2007 04:24, Matthias Urlichs wrote:
> Hi,
>
> Junio C Hamano:
> > Matthias Urlichs <smurf@smurf.noris.de> writes:
> > >> we do not like 'Cristian new code' as a tag name.
> > >
> > > Duh? That's a perfectly valid tag name.
> >
> > Is it?
> >
> > $ man git-check-ref-format
>
> Bah, stupid me. You're right, obviously.
>
> I'll replace them with underscores. :-/

-- 
Dan Libby

Open Source Consulting
San Jose, Costa Rica
http://osc.co.cr
phone: 011 506 223 7382
Fax: 011 506 223 7359

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-09-21 20:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200709161857.06065.danda@osc.co.cr>
     [not found] ` <20070917070303.GI31176@kiste.smurf.noris.de>
     [not found]   ` <200709171333.48331.danda@osc.co.cr>
2007-09-18  7:47     ` [PATCH] git-svnimport: Use separate arguments in the pipe for git-rev-parse Matthias Urlichs
2007-09-18  8:54       ` Junio C Hamano
2007-09-18  9:29         ` Matthias Urlichs
2007-09-20 19:40           ` Dan Libby
2007-09-21  6:11             ` Matthias Urlichs
2007-09-21  6:59               ` Junio C Hamano
2007-09-21 10:24                 ` Matthias Urlichs
2007-09-21 20:21                   ` Dan Libby
2007-09-20 19:07       ` Dan Libby

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).