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

Re: git-svn error: ambiguous argument

From
PLPaul Lindner <lindner@inuus.com>
Date
May 11, 2010, 19:44 UTC
Message-ID
<0D702391-E490-4942-AAB6-C8C887E671C5@inuus.com>
In-Reply-To
<AANLkTimE6Wo9HT0p5WMfTggJ059dhDg4fyPeax93VCLy@mail.gmail.com>
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
Previous: Bert WesargNext: Bert Wesarg
Message 5 of 8 in “git-svn error: ambiguous argument”
  1. Paul LindnerMay 3, 2010
  2. Bert WesargMay 11, 2010
  3. Bert WesargMay 11, 2010
  4. Bert WesargMay 11, 2010
  5. Paul LindnerMay 11, 2010
  6. Bert WesargJun 28, 2010
  7. Eric WongJun 28, 2010
  8. Bert WesargJul 6, 2010

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.