git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Lars Hjemli <hjemli@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] git-svn: remove --first-parent, add --upstream
Date: Thu, 6 Sep 2007 14:01:55 -0700	[thread overview]
Message-ID: <20070906210155.GA20938@soma> (raw)
In-Reply-To: <1189096669534-git-send-email-hjemli@gmail.com>

Lars Hjemli <hjemli@gmail.com> wrote:
> This makes git-svn always issue the --first-parent option to git-log when
> trying to establish the "base" subversion branch, so the --first-parent
> option to git-svn is no longer needed. Instead a new option, --upstream
> <revspec>, is introduced. When this is specified the search for embedded
> git-svn-id lines in commit messages starts at the specified revision, if
> not specified the search starts at HEAD.
> 
> Signed-off-by: Lars Hjemli <hjemli@gmail.com>

Looks good to me.

Acked-by: Eric Wong <normalperson@yhbt.net>

> ---
>  Documentation/git-svn.txt |   10 +++++-----
>  git-svn.perl              |   18 +++++++++---------
>  2 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
> index 42d7b82..2903777 100644
> --- a/Documentation/git-svn.txt
> +++ b/Documentation/git-svn.txt
> @@ -317,15 +317,15 @@ This is only used with the 'dcommit' command.
>  Print out the series of git arguments that would show
>  which diffs would be committed to SVN.
>  
> ---first-parent::
> +--upstream=<revspec>::
>  
>  This is only used with the 'dcommit', 'rebase', 'log', 'find-rev' and
>  'show-ignore' commands.
>  
> -These commands tries to detect the upstream subversion branch by means of
> -the embedded 'git-svn-id' line in commit messages. When --first-parent is
> -specified, git-svn only follows the first parent of each commit, effectively
> -ignoring commits brought into the current branch through merge-operations.
> +These commands tries to detect the upstream subversion branch by traversing
> +the first parent of each commit (starting at HEAD), looking for an embedded
> +'git-svn-id' line in the commit messages. When --upstream is specified,
> +git-svn starts the traversal at the specified commit instead of HEAD.
>  
>  --
>  
> diff --git a/git-svn.perl b/git-svn.perl
> index d21eb7f..947a944 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -59,7 +59,7 @@ my ($_stdin, $_help, $_edit,
>  	$_template, $_shared,
>  	$_version, $_fetch_all, $_no_rebase,
>  	$_merge, $_strategy, $_dry_run, $_local,
> -	$_prefix, $_no_checkout, $_verbose, $_first_parent);
> +	$_prefix, $_no_checkout, $_verbose, $_upstream);
>  $Git::SVN::_follow_parent = 1;
>  my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
>                      'config-dir=s' => \$Git::SVN::Ra::config_dir,
> @@ -119,14 +119,14 @@ my %cmd = (
>  			  'dry-run|n' => \$_dry_run,
>  			  'fetch-all|all' => \$_fetch_all,
>  			  'no-rebase' => \$_no_rebase,
> -			  'first-parent' => \$_first_parent,
> +			  'upstream=s' => \$_upstream,
>  			%cmt_opts, %fc_opts } ],
>  	'set-tree' => [ \&cmd_set_tree,
>  	                "Set an SVN repository to a git tree-ish",
>  			{ 'stdin|' => \$_stdin, %cmt_opts, %fc_opts, } ],
>  	'show-ignore' => [ \&cmd_show_ignore, "Show svn:ignore listings",
>  			{ 'revision|r=i' => \$_revision,
> -			  'first-parent' => \$_first_parent
> +			  'upstream=s' => \$_upstream
>  			} ],
>  	'multi-fetch' => [ \&cmd_multi_fetch,
>  	                   "Deprecated alias for $0 fetch --all",
> @@ -148,11 +148,11 @@ my %cmd = (
>  			  'authors-file|A=s' => \$_authors,
>  			  'color' => \$Git::SVN::Log::color,
>  			  'pager=s' => \$Git::SVN::Log::pager,
> -			  'first-parent' => \$_first_parent
> +			  'upstream=s' => \$_upstream
>  			} ],
>  	'find-rev' => [ \&cmd_find_rev, "Translate between SVN revision numbers and tree-ish",
>  			{
> -			  'first-parent' => \$_first_parent
> +			  'upstream=s' => \$_upstream
>  			} ],
>  	'rebase' => [ \&cmd_rebase, "Fetch and rebase your working directory",
>  			{ 'merge|m|M' => \$_merge,
> @@ -160,7 +160,7 @@ my %cmd = (
>  			  'strategy|s=s' => \$_strategy,
>  			  'local|l' => \$_local,
>  			  'fetch-all|all' => \$_fetch_all,
> -			  'first-parent' => \$_first_parent,
> +			  'upstream=s' => \$_upstream,
>  			  %fc_opts } ],
>  	'commit-diff' => [ \&cmd_commit_diff,
>  	                   'Commit a diff between two trees',
> @@ -818,9 +818,9 @@ sub cmt_metadata {
>  
>  sub working_head_info {
>  	my ($head, $refs) = @_;
> -	my @args = ('log', '--no-color');
> -	push @args, '--first-parent' if $_first_parent;
> -	my ($fh, $ctx) = command_output_pipe(@args, $head);
> +	my @args = ('log', '--no-color', '--first-parent');
> +	push @args, ($_upstream ? $_upstream : $head);
> +	my ($fh, $ctx) = command_output_pipe(@args);
>  	my $hash;
>  	my %max;
>  	while (<$fh>) {
> -- 
> 1.5.3.1.g0e33-dirty
> 

-- 
Eric Wong

  parent reply	other threads:[~2007-09-06 21:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-05  9:35 [RFC/PATCH] git-svn: add support for --first-parent Lars Hjemli
2007-09-05 10:19 ` Eric Wong
2007-09-06  7:18   ` Lars Hjemli
2007-09-06  7:51     ` Eric Wong
2007-09-06  8:05       ` David Kastrup
2007-09-06  8:34       ` Lars Hjemli
2007-09-06 16:37       ` [PATCH] git-svn: remove --first-parent, add --upstream Lars Hjemli
2007-09-06 17:49         ` Steven Grimm
2007-09-06 21:01         ` Eric Wong [this message]
2007-09-06 21:35           ` Eric Wong
2007-09-06 22:14             ` Lars Hjemli
2007-09-06 23:55               ` Peter Baumann
2007-09-07  0:23                 ` Lars Hjemli
2007-09-07  8:43                   ` Peter Baumann
2007-09-07 10:13                     ` Lars Hjemli
2007-09-07 11:51                       ` Peter Baumann
2007-09-07 12:08                         ` Configure mutt to be used in git and lkml mailing lists (was: Re: [PATCH] git-svn: remove --first-parent, add --upstream) Fernando J. Pereda
2007-09-07 18:37                         ` [PATCH] git-svn: remove --first-parent, add --upstream Eric Wong
2007-09-15 14:08                       ` Lars Hjemli
2007-09-15 14:37                         ` Peter Baumann
2007-09-15 15:24                           ` Lars Hjemli
2007-09-15 15:49                             ` Peter Baumann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070906210155.GA20938@soma \
    --to=normalperson@yhbt.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hjemli@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).