git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Steven Grimm <koreth@midwinter.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] Teach git-svn how to catch up with its tracking branches
Date: Sun, 11 May 2008 01:27:27 -0700	[thread overview]
Message-ID: <20080511082727.GB23929@untitled> (raw)
In-Reply-To: <20080508041948.GA1095@midwinter.com>

Steven Grimm <koreth@midwinter.com> wrote:
> In environments where a lot of people are sharing an svn repository using
> git-svn, everyone has identical, but individually maintained, tracking
> branches. If the svn repository is very active, it can take a while to
> run "git svn fetch" (which has to individually construct each revision
> by querying the svn server). It's much faster to run "git fetch" against
> another git-svn repository to grab the exact same git revisions you'd get
> from "git svn fetch". But until now, git-svn was confused by this because
> it didn't know how to incrementally rebuild its map of revision IDs.
> The only choice was to completely remove the map file and rebuild it
> from scratch, possibly a lengthy operation when there's a lot of history.
> 
> With this change, git-svn will try to do an incremental update of its
> revision map if it sees that its tracking branch has svn revisions that
> aren't in the map yet.

Cool.  I agree with this is a useful change for people wanting to save
time and bandwidth although I've never been in a situation to need it
myself.

However, I'm kind of uncomfortable with this being on by default, as it
really means they users have to trust the git repository they're
fetching from to always be configured identically to what they're using
and not change configurations midway through a project.  External things
like authors files would need to be synced, too, etc...

> +sub sync_rev_map_with_commits {
> +	my ($self) = @_;
> +	# If we can't pull metadata out of log messages, there's nothing
> +	# to import.
> +	return if $self->use_svm_props || $self->no_metadata;
> +	# If there isn't a revision DB yet, we'll rebuild it from scratch
> +	# elsewhere, so don't do anything here.
> +	return if ! -e $self->map_path || -z $self->map_path;
> +	# Look at the most recent commit with a git-svn-id line.
> +	my ($log, $ctx) =
> +	    command_output_pipe(qw/rev-list --pretty=raw --no-color /,
> +				'--grep=^ *git-svn-id:',

Even though rev-list outputs the commit message prefixed with spaces,
the --grep itself does not need ' *' to match the leading spaces.
No version of git-svn outputting a space before "git-svn-id: "
in the commit itself.

More importantly I'd also prefer to actually grep for the URL+path of
the ref we're tracking, too.  This can catch mistakes if people somehow
configured their remotes incorrectly.

-- 
Eric Wong

  reply	other threads:[~2008-05-11  8:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08  1:39 [PATCH] Teach git-svn how to catch up with its tracking branches Steven Grimm
2008-05-08  1:55 ` Junio C Hamano
2008-05-08  2:17   ` Steven Grimm
2008-05-08  1:58 ` Chris Shoemaker
2008-05-08  2:08   ` Steven Grimm
2008-05-08  2:25     ` Chris Shoemaker
2008-05-08  7:38       ` Karl Hasselström
2008-05-08  7:43         ` Karl Hasselström
2008-05-08  7:58           ` Steven Grimm
2008-05-08  8:13             ` Karl Hasselström
2008-05-08  4:19 ` [PATCH v2] " Steven Grimm
2008-05-11  8:27   ` Eric Wong [this message]
2008-05-08  6:48 ` [PATCH] " Asheesh Laroia
2008-05-08  7:33   ` Steven Grimm
2008-05-08  7:48   ` Chris Shoemaker
2008-05-08  8:21   ` Chris Shoemaker

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

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

  git send-email \
    --in-reply-to=20080511082727.GB23929@untitled \
    --to=normalperson@yhbt.net \
    --cc=git@vger.kernel.org \
    --cc=koreth@midwinter.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.
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 NNTP newsgroup(s).