threads / discuss / 23686

git-svn error: ambiguous argument

Subject: git-svn error: ambiguous argument

## tl;dr

8 messages between May 3, 2010 and Jul 6, 2010.

replies: 7people: 3as markdown or json

Paul Lindner· May 3, 2010, 20:51 UTC · lore
Hi,
Since the 1.7 time frame my git-svn imports have stopped working after a period of time.  The error that crops up is:
  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '1e4ed9c6fde9e4b2465a8db6915f32a132634064'   'a51029a8667288556e02055057f250157e0a7f59' '0a7934d4a22563e29ed9857240bc022800f626f7' 'c6a0edb91eed10b86aad74c138422ff8a496ad29' 'd211954a973b92feef86aa130bf5ac253c095574' 'd9e99745569c8cd7d087cd8740f915b34f0f5fa2' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
  trace: built-in: git 'merge-base' 'd86892a76b3ef4049b87ca50f62846cdff5f204f' 'cb612e24c7d15ff8b4b13822592fff25e1efff13'
  trace: built-in: git 'rev-list' '--no-merges' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' '23dfc0fd04cedd8e09c2bfa6f0e79e9a4282bc57'
  trace: built-in: git 'rev-list' 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764' 
  fatal: ambiguous argument 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions
  rev-list dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764: command returned error: 128
This git-svn repo is a shallow clone of a very large svn repo.
It was initialized like this:
  git svn init SVNREPO --trunk=network/trunk --branches=network/branches --tags=network/tagz --ignore-paths='^.+/(?:branches)/(?!BR_ENG_PLFM|BR_REL)' network
  git svn fetch -r 112002 
It appears that one of the branches cannot find it's parent:
 git log dde42274ac34e4055275ea4926cd8cc259476399^
fails.
Any ideas or workarounds would be very welcome.
Thanks!
Bert Wesarg· May 11, 2010, 14:25 UTC · re: Paul Lindner · lore

Re: git-svn error: ambiguous argument

On Mon, May 3, 2010 at 22:51, Paul Lindner <lindner@inuus.com> wrote:
Show 24 quoted lines
> Hi,
>
> Since the 1.7 time frame my git-svn imports have stopped working after a period of time.  The error that crops up is:
>
>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '1e4ed9c6fde9e4b2465a8db6915f32a132634064'   'a51029a8667288556e02055057f250157e0a7f59' '0a7934d4a22563e29ed9857240bc022800f626f7' 'c6a0edb91eed10b86aad74c138422ff8a496ad29' 'd211954a973b92feef86aa130bf5ac253c095574' 'd9e99745569c8cd7d087cd8740f915b34f0f5fa2' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>  trace: built-in: git 'merge-base' 'd86892a76b3ef4049b87ca50f62846cdff5f204f' 'cb612e24c7d15ff8b4b13822592fff25e1efff13'
>  trace: built-in: git 'rev-list' '--no-merges' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' '23dfc0fd04cedd8e09c2bfa6f0e79e9a4282bc57'
>  trace: built-in: git 'rev-list' 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764'
>  fatal: ambiguous argument 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764': unknown revision or path not in the working tree.
>  Use '--' to separate paths from revisions
>  rev-list dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764: command returned error: 128
>
> This git-svn repo is a shallow clone of a very large svn repo.
>
> It was initialized like this:
>
>  git svn init SVNREPO --trunk=network/trunk --branches=network/branches --tags=network/tagz --ignore-paths='^.+/(?:branches)/(?!BR_ENG_PLFM|BR_REL)' network
>  git svn fetch -r 112002
>
> It appears that one of the branches cannot find it's parent:
>
>  git log dde42274ac34e4055275ea4926cd8cc259476399^

That hit me too. The first revision number is the root commit, which does not have any parents. Thats why the rev-list command fails.

Bert
Bert Wesarg· May 11, 2010, 14:46 UTC · re: Bert Wesarg · lore

Re: git-svn error: ambiguous argument

On Tue, May 11, 2010 at 16:25, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
Show 28 quoted lines
> On Mon, May 3, 2010 at 22:51, Paul Lindner <lindner@inuus.com> wrote:
>> Hi,
>>
>> Since the 1.7 time frame my git-svn imports have stopped working after a period of time.  The error that crops up is:
>>
>>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '1e4ed9c6fde9e4b2465a8db6915f32a132634064'   'a51029a8667288556e02055057f250157e0a7f59' '0a7934d4a22563e29ed9857240bc022800f626f7' 'c6a0edb91eed10b86aad74c138422ff8a496ad29' 'd211954a973b92feef86aa130bf5ac253c095574' 'd9e99745569c8cd7d087cd8740f915b34f0f5fa2' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>>  trace: built-in: git 'merge-base' 'd86892a76b3ef4049b87ca50f62846cdff5f204f' 'cb612e24c7d15ff8b4b13822592fff25e1efff13'
>>  trace: built-in: git 'rev-list' '--no-merges' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' '23dfc0fd04cedd8e09c2bfa6f0e79e9a4282bc57'
>>  trace: built-in: git 'rev-list' 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764'
>>  fatal: ambiguous argument 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764': unknown revision or path not in the working tree.
>>  Use '--' to separate paths from revisions
>>  rev-list dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764: command returned error: 128
>>
>> This git-svn repo is a shallow clone of a very large svn repo.
>>
>> It was initialized like this:
>>
>>  git svn init SVNREPO --trunk=network/trunk --branches=network/branches --tags=network/tagz --ignore-paths='^.+/(?:branches)/(?!BR_ENG_PLFM|BR_REL)' network
>>  git svn fetch -r 112002
>>
>> It appears that one of the branches cannot find it's parent:
>>
>>  git log dde42274ac34e4055275ea4926cd8cc259476399^
>
> That hit me too. The first revision number is the root commit, which
> does not have any parents. Thats why the rev-list command fails.
I think the correct useage should be
    git rev-list dde42274ac34e4055275ea4926cd8cc259476399^!
4ff8e8528dd9d3901c6839080a6f172b8e380764

Making a patch for this doesn't look trivial, because git-svn expects that a commit range is only one argument, not two in this case.

Bert
Bert Wesarg· May 11, 2010, 16:20 UTC · re: Bert Wesarg · lore

Re: git-svn error: ambiguous argument

On Tue, May 11, 2010 at 16:46, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
Show 37 quoted lines
> On Tue, May 11, 2010 at 16:25, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> On Mon, May 3, 2010 at 22:51, Paul Lindner <lindner@inuus.com> wrote:
>>> Hi,
>>>
>>> Since the 1.7 time frame my git-svn imports have stopped working after a period of time.  The error that crops up is:
>>>
>>>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '1e4ed9c6fde9e4b2465a8db6915f32a132634064'   'a51029a8667288556e02055057f250157e0a7f59' '0a7934d4a22563e29ed9857240bc022800f626f7' 'c6a0edb91eed10b86aad74c138422ff8a496ad29' 'd211954a973b92feef86aa130bf5ac253c095574' 'd9e99745569c8cd7d087cd8740f915b34f0f5fa2' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>>>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>>>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>>>  trace: built-in: git 'merge-base' 'd86892a76b3ef4049b87ca50f62846cdff5f204f' 'cb612e24c7d15ff8b4b13822592fff25e1efff13'
>>>  trace: built-in: git 'rev-list' '--no-merges' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' '23dfc0fd04cedd8e09c2bfa6f0e79e9a4282bc57'
>>>  trace: built-in: git 'rev-list' 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764'
>>>  fatal: ambiguous argument 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764': unknown revision or path not in the working tree.
>>>  Use '--' to separate paths from revisions
>>>  rev-list dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764: command returned error: 128
>>>
>>> This git-svn repo is a shallow clone of a very large svn repo.
>>>
>>> It was initialized like this:
>>>
>>>  git svn init SVNREPO --trunk=network/trunk --branches=network/branches --tags=network/tagz --ignore-paths='^.+/(?:branches)/(?!BR_ENG_PLFM|BR_REL)' network
>>>  git svn fetch -r 112002
>>>
>>> It appears that one of the branches cannot find it's parent:
>>>
>>>  git log dde42274ac34e4055275ea4926cd8cc259476399^
>>
>> That hit me too. The first revision number is the root commit, which
>> does not have any parents. Thats why the rev-list command fails.
>
> I think the correct useage should be
>
>    git rev-list dde42274ac34e4055275ea4926cd8cc259476399^!
> 4ff8e8528dd9d3901c6839080a6f172b8e380764
>
> Making a patch for this doesn't look trivial, because git-svn expects
> that a commit range is only one argument, not two in this case.
Can you try this patch, it worked on my site:
diff --git a/git-svn.perl b/git-svn.perl
index b3b6964..40ecec0 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3103,7 +3095,11 @@ sub check_cherry_pick {
 	my %commits = map { $_ => 1 }
 		_rev_list("--no-merges", $tip, "--not", $base);
 	for my $range ( @ranges ) {
-		delete @commits{_rev_list($range)};
+		if ( $range =~ /^([[:xdigit:]]{40})\^\.\.([[:xdigit:]]{40})$/i ) {
+			delete @commits{_rev_list(sprintf("%s^!", $1), $2)};
+		} else {
+			delete @commits{_rev_list($range)};
+		}
 	}
 	for my $commit (keys %commits) {
 		if (has_no_changes($commit)) {

Bert
Paul Lindner· May 11, 2010, 19:44 UTC · re: Bert Wesarg · lore

Re: git-svn error: ambiguous argument

This fixed it for my situation.  Thanks!
On May 11, 2010, at 9:20 AM, Bert Wesarg wrote:
Show 60 quoted lines
> On Tue, May 11, 2010 at 16:46, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> On Tue, May 11, 2010 at 16:25, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>>> On Mon, May 3, 2010 at 22:51, Paul Lindner <lindner@inuus.com> wrote:
>>>> Hi,
>>>> 
>>>> Since the 1.7 time frame my git-svn imports have stopped working after a period of time.  The error that crops up is:
>>>> 
>>>>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '1e4ed9c6fde9e4b2465a8db6915f32a132634064'   'a51029a8667288556e02055057f250157e0a7f59' '0a7934d4a22563e29ed9857240bc022800f626f7' 'c6a0edb91eed10b86aad74c138422ff8a496ad29' 'd211954a973b92feef86aa130bf5ac253c095574' 'd9e99745569c8cd7d087cd8740f915b34f0f5fa2' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>>>>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' 'd18d09558e4f56fb757b258cb364f38861f84116' '3f498379030b5358d65820415b98cbe338086247' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>>>>  trace: built-in: git 'rev-list' '-1' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' 'd86892a76b3ef4049b87ca50f62846cdff5f204f'
>>>>  trace: built-in: git 'merge-base' 'd86892a76b3ef4049b87ca50f62846cdff5f204f' 'cb612e24c7d15ff8b4b13822592fff25e1efff13'
>>>>  trace: built-in: git 'rev-list' '--no-merges' 'cb612e24c7d15ff8b4b13822592fff25e1efff13' '--not' '23dfc0fd04cedd8e09c2bfa6f0e79e9a4282bc57'
>>>>  trace: built-in: git 'rev-list' 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764'
>>>>  fatal: ambiguous argument 'dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764': unknown revision or path not in the working tree.
>>>>  Use '--' to separate paths from revisions
>>>>  rev-list dde42274ac34e4055275ea4926cd8cc259476399^..4ff8e8528dd9d3901c6839080a6f172b8e380764: command returned error: 128
>>>> 
>>>> This git-svn repo is a shallow clone of a very large svn repo.
>>>> 
>>>> It was initialized like this:
>>>> 
>>>>  git svn init SVNREPO --trunk=network/trunk --branches=network/branches --tags=network/tagz --ignore-paths='^.+/(?:branches)/(?!BR_ENG_PLFM|BR_REL)' network
>>>>  git svn fetch -r 112002
>>>> 
>>>> It appears that one of the branches cannot find it's parent:
>>>> 
>>>>  git log dde42274ac34e4055275ea4926cd8cc259476399^
>>> 
>>> That hit me too. The first revision number is the root commit, which
>>> does not have any parents. Thats why the rev-list command fails.
>> 
>> I think the correct useage should be
>> 
>>    git rev-list dde42274ac34e4055275ea4926cd8cc259476399^!
>> 4ff8e8528dd9d3901c6839080a6f172b8e380764
>> 
>> Making a patch for this doesn't look trivial, because git-svn expects
>> that a commit range is only one argument, not two in this case.
> 
> Can you try this patch, it worked on my site:
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index b3b6964..40ecec0 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -3103,7 +3095,11 @@ sub check_cherry_pick {
> 	my %commits = map { $_ => 1 }
> 		_rev_list("--no-merges", $tip, "--not", $base);
> 	for my $range ( @ranges ) {
> -		delete @commits{_rev_list($range)};
> +		if ( $range =~ /^([[:xdigit:]]{40})\^\.\.([[:xdigit:]]{40})$/i ) {
> +			delete @commits{_rev_list(sprintf("%s^!", $1), $2)};
> +		} else {
> +			delete @commits{_rev_list($range)};
> +		}
> 	}
> 	for my $commit (keys %commits) {
> 		if (has_no_changes($commit)) {
> 
> Bert
Bert Wesarg· Jun 28, 2010, 06:03 UTC · re: Paul Lindner · lore

Re: git-svn error: ambiguous argument

On Tue, May 11, 2010 at 21:44, Paul Lindner <lindner@inuus.com> wrote:
Show 24 quoted lines
> This fixed it for my situation.  Thanks!
>
> On May 11, 2010, at 9:20 AM, Bert Wesarg wrote:
>
>>
>> Can you try this patch, it worked on my site:
>>
>> diff --git a/git-svn.perl b/git-svn.perl
>> index b3b6964..40ecec0 100755
>> --- a/git-svn.perl
>> +++ b/git-svn.perl
>> @@ -3103,7 +3095,11 @@ sub check_cherry_pick {
>>       my %commits = map { $_ => 1 }
>>               _rev_list("--no-merges", $tip, "--not", $base);
>>       for my $range ( @ranges ) {
>> -             delete @commits{_rev_list($range)};
>> +             if ( $range =~ /^([[:xdigit:]]{40})\^\.\.([[:xdigit:]]{40})$/i ) {
>> +                     delete @commits{_rev_list(sprintf("%s^!", $1), $2)};
>> +             } else {
>> +                     delete @commits{_rev_list($range)};
>> +             }
>>       }
>>       for my $commit (keys %commits) {
>>               if (has_no_changes($commit)) {
Eric, have you picked this up, or should I re-send it as a propper patch?
Bert
Eric Wong· Jun 28, 2010, 06:24 UTC · re: Bert Wesarg · lore

Re: git-svn error: ambiguous argument

Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> On Tue, May 11, 2010 at 21:44, Paul Lindner <lindner@inuus.com> wrote:
> > This fixed it for my situation.  Thanks!
> > On May 11, 2010, at 9:20 AM, Bert Wesarg wrote:
> >> Can you try this patch, it worked on my site:
<snip>
> Eric, have you picked this up, or should I re-send it as a propper patch?
A proper patch + commit message would be easier, thanks Bert!
-- 
Eric Wong
Bert Wesarg· Jul 6, 2010, 23:11 UTC · re: Eric Wong · lore

Re: git-svn error: ambiguous argument

On Mon, Jun 28, 2010 at 08:24, Eric Wong <normalperson@yhbt.net> wrote:
Show 11 quoted lines
> Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> On Tue, May 11, 2010 at 21:44, Paul Lindner <lindner@inuus.com> wrote:
>> > This fixed it for my situation.  Thanks!
>> > On May 11, 2010, at 9:20 AM, Bert Wesarg wrote:
>> >> Can you try this patch, it worked on my site:
>
> <snip>
>
>> Eric, have you picked this up, or should I re-send it as a propper patch?
>
> A proper patch + commit message would be easier, thanks Bert!

I have invested some time to verify my patch before sending. And I think I will break something. The current patch changes the range argument for git rev-list from "r1^..r2" to "r1^!" & "r2", which should not be the same, because "r1^..r2" is equivalent to "^r1^" & "r2". This reads 'all commits reachable from r2 but not reachable from the parent of r1' where my conversion should read 'all reachable from r1 (excluding all of its parents) or reachable from r2'. But maybe the 'excluding all of its parents'-part quarantines that the semantic still holds?

At least test 5 of t9151-svn-mergeinfo.sh does not pass, so my patch proved to be wrong.

Bert
>
> --
> Eric Wong
>

← back to recent threads