From: Jonathan Nieder <jrnieder@gmail.com>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
Stephen Bash <bash@genarts.com>, Matt Stump <mstump@goatyak.com>,
git@vger.kernel.org, David Michael Barr <david.barr@cordelta.com>,
Tomas Carnecky <tom@dbservice.com>
Subject: Re: Converting to Git using svn-fe (Was: Speeding up the initial git-svn fetch)
Date: Mon, 18 Oct 2010 14:33:12 -0500 [thread overview]
Message-ID: <20101018193311.GE6877@burratino> (raw)
In-Reply-To: <AANLkTi=tT=AHWhHUw1tWT777ZPjvmTuMjDJ_orHYYN-x@mail.gmail.com>
Sverre Rabbelier wrote:
> On Mon, Oct 18, 2010 at 13:25, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Good question. Ram, I think there was some discussion of this
>> recently in connection with svnrdump, right? IIRC the suggested
>> method was to use hooks or mine a commits@ mailing list. :(
>
> Hmmm, in that case perhaps we should instead just ignore changed
> history?
Yeah. It's unpleasant to imagine that
git clone svn://whatever
... sneakily change svn repo ...
... add some new revs on top ...
cd whatever && git fetch origin
would produce an origin/trunk that does not match any clone of the
svn repo at all, but in practice it is not so different from coping
with any other upstream that is incurably willing to rewrite history.
Example: downstream tracking an unstable branch
-----------------------------------------------
Suppose I maintain a patchset in the long term, based, for whatever
reason, on git's "next" branch. Occasionally there is a need to
merge from upstream. What can one do?
Simple use of "git merge" produces history that is difficult to
follow. Time flowing from left to right, "u" denotes upstream
commits:
u --- u --- u [next-2005-01-03]
|\ \
| \ A --- o - o ----- B
\ \ / /
\ u --- u --- u --- u [next-2006-03-27]
\ /
u --- u --- u --- u --- u [next-2009-11-27]
If a person wants to find what changed downstream between A and B,
a simple "git log A..B ^origin/next" will unfortunately include the
commits from next-2006-03-27 as well.
One option is to rebase whenever upstream does, but that is
dangerous because it prevents users from tracking changes in the
project long-term.
Another option is to use a "rebasing merge" [1]. The history can be
followed without too much trouble if you set up "git log" commands
appropriately. Naïve use of "git log" will list (and git will store)
multiple copies of every commit, though.
And lastly, one can say "screw upstream" and produce a long-term
"next" branch to build on. :) Like this:
1. git branch long-term-next next-2005-01-03
2. When "next" is rebased to clean out cruft, advance long-term-next
to the pre-rebase state. Luckily such rebases leave a "before" in
long-term-next and "after" in next with identical content. Add a
replace ref to make history easy to follow.
git diff <after> <before>; # confirm that they really match
git replace <after> <before>
3. To advance long-term-next, rewrite commits from upstream.
git checkout origin/next
git filter-branch HEAD
git diff origin/next; # should match
git push . HEAD:long-term-next; # should be fast-forward
4. Only merge long-term-next into downstream branches.
5. Publish the latest replace ref so others can follow the history
easily.
[1] http://thread.gmane.org/gmane.comp.version-control.msysgit/10264
next prev parent reply other threads:[~2010-10-18 19:36 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-13 15:44 Speeding up the initial git-svn fetch Matt Stump
2010-10-13 16:02 ` Stephen Bash
2010-10-13 17:47 ` Matt Stump
2010-10-13 18:18 ` Stephen Bash
2010-10-14 16:22 ` Converting to Git using svn-fe (Was: Speeding up the initial git-svn fetch) Stephen Bash
2010-10-14 16:34 ` Jonathan Nieder
2010-10-14 20:07 ` Sverre Rabbelier
2010-10-15 14:50 ` Stephen Bash
2010-10-15 23:39 ` Sverre Rabbelier
2010-10-16 0:16 ` Stephen Bash
2010-10-17 2:25 ` Sverre Rabbelier
2010-10-17 3:33 ` David Michael Barr
2010-10-18 5:17 ` Ramkumar Ramachandra
2010-10-18 7:31 ` Jonathan Nieder
2010-10-18 16:38 ` Ramkumar Ramachandra
2010-10-18 16:46 ` Sverre Rabbelier
2010-10-18 16:56 ` Jonathan Nieder
2010-10-18 17:16 ` Ramkumar Ramachandra
2010-10-18 17:18 ` Sverre Rabbelier
2010-10-18 17:28 ` Jonathan Nieder
2010-10-18 18:10 ` Sverre Rabbelier
2010-10-18 18:13 ` Jonathan Nieder
2010-10-18 18:20 ` Sverre Rabbelier
2010-10-18 18:25 ` Jonathan Nieder
2010-10-18 18:35 ` Sverre Rabbelier
2010-10-18 19:33 ` Jonathan Nieder [this message]
2010-10-19 3:08 ` Ramkumar Ramachandra
2010-10-19 0:40 ` Stephen Bash
2010-10-19 1:42 ` Stephen Bash
2010-10-19 6:42 ` Ramkumar Ramachandra
2010-10-19 13:33 ` Stephen Bash
2010-10-19 14:28 ` David Michael Barr
2010-10-19 14:57 ` Stephen Bash
2010-10-20 8:39 ` Will Palmer
2010-10-20 11:59 ` Jakub Narebski
2010-10-20 13:42 ` Will Palmer
2010-10-20 20:44 ` Jakub Narebski
2010-10-21 1:54 ` mrevilgnome
2010-10-21 8:16 ` Jakub Narebski
2010-10-21 13:49 ` Stephen Bash
2010-10-21 9:08 ` Will Palmer
2010-10-21 14:00 ` Stephen Bash
2010-10-21 18:37 ` Jakub Narebski
2010-10-21 21:27 ` Stephen Bash
2010-10-21 22:49 ` Jakub Narebski
2010-10-21 23:26 ` Stephen Bash
2010-10-22 10:38 ` Jakub Narebski
2010-10-21 15:52 ` Jakub Narebski
2010-10-21 16:16 ` Jonathan Nieder
2010-10-20 14:05 ` Ramkumar Ramachandra
2010-10-20 14:21 ` Stephen Bash
2010-10-20 16:56 ` Ramkumar Ramachandra
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=20101018193311.GE6877@burratino \
--to=jrnieder@gmail.com \
--cc=artagnon@gmail.com \
--cc=bash@genarts.com \
--cc=david.barr@cordelta.com \
--cc=git@vger.kernel.org \
--cc=mstump@goatyak.com \
--cc=srabbelier@gmail.com \
--cc=tom@dbservice.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).