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

Re: [PATCH] git svn: catch lack of upstream info for dcommit earlier

From
EWEric Wong <normalperson@yhbt.net>
Date
Sep 1, 2008, 03:26 UTC
Message-ID
<20080901032657.GC25876@hand.yhbt.net>
In-Reply-To
<1220190659-5955-1-git-send-email-trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> wrote:
Show 5 quoted lines
> Since 711521e 'git svn dcommit' attempts to use the upstream
> information to determine the SVN URL, before it verifies that it even
> found an upstream.  Move up the corresponding check.
> 
> Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Thanks,
Acked-by: Eric Wong <normalperson@yhbt.net>
Show 39 quoted lines
> ---
> 
> Weyert de Boer wrote:
> > Can't call method "full_url" on an undefined value at
> > /opt/local/libexec/git-core/git-svn line 425.
> 
> After resolving the problem on IRC, here's the fix to avoid the
> unhelpful message.
> 
> 
>  git-svn.perl |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index 7a1d26d..43bf201 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -421,15 +421,15 @@ sub cmd_dcommit {
>  	$head ||= 'HEAD';
>  	my @refs;
>  	my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
> +	unless ($gs) {
> +		die "Unable to determine upstream SVN information from ",
> +		    "$head history.\nPerhaps the repository is empty.";
> +	}
>  	$url = defined $_commit_url ? $_commit_url : $gs->full_url;
>  	my $last_rev = $_revision if defined $_revision;
>  	if ($url) {
>  		print "Committing to $url ...\n";
>  	}
> -	unless ($gs) {
> -		die "Unable to determine upstream SVN information from ",
> -		    "$head history.\nPerhaps the repository is empty.";
> -	}
>  	my ($linear_refs, $parents) = linearize_history($gs, \@refs);
>  	if ($_no_rebase && scalar(@$linear_refs) > 1) {
>  		warn "Attempting to commit more than one change while ",
> -- 
> 1.6.0.1.278.g5a622
Previous: Thomas Rast
Message 3 of 3 in “Problems with using git svn dcommit”
  1. Weyert de BoerAug 31, 2008
  2. git svn: catch lack of upstream info for dcommit earlierThomas Rast, Aug 31, 2008
  3. Eric WongSep 1, 2008

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.