From: Eric Wong <normalperson@yhbt.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Joakim Tjernlund <joakim.tjernlund@transmode.se>,
Steven Grimm <koreth@midwinter.com>,
git@vger.kernel.org
Subject: Re: git-svn set-tree bug
Date: Tue, 12 Jun 2007 01:39:10 -0700 [thread overview]
Message-ID: <20070612083910.GA28369@muzzle> (raw)
In-Reply-To: <7v1wghlj7j.fsf@assigned-by-dhcp.pobox.com>
Junio C Hamano <gitster@pobox.com> wrote:
> Eric Wong <normalperson@yhbt.net> writes:
>
> > If dcommit detects a merge commit when doing rev-list When looking at
> > commit objects, is it safe to assume that the first parent is always the
> > "mainline" and that parents after it are the ones to merge from?
> >
> > So if I saw:
> >
> > commit $X
> > parent $A
> > parent $B
> >
> > I'd basically do:
> > reset --hard $A
> > merge --squash $B
> >
> > And resulting in $C which would have the same tree as $X,
> > then, when dcommit-ting, $D would be created with two parents:
> > $D~1 (svn), $B (git), but not $A
>
> I am not sure what you mean by "mainline", but I assume that you
> mean "SVN is the main and we are tracking it while taking
> advantage of more efficient and merge-capable git in guerrilla
> fashion". Because the tip of the current branch is what the
> user is pushing back to SVN via dcommit, I would say it is safe
> to assume that the first parent of such a merge is the line that
> corresponds to the SVN branch you are keeping track.
Yes, "mainline" meaning the history that would be committed to SVN if
history were linear.
I've gotten the following patch working for Joakim's second test script
(with dcommit before merge). However, without the dcommit before merge
in the first test script, git-svn has trouble figuring out which history
to follow. It'll take more work to figure out what to do in this
situation, and how to deal with more complex history...
Subject: git-svn: Allow dcommit to handle certain single-parent merge commits
This only works if a merge is the first commit to be committed
in a chain of commits.
---
git-svn.perl | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 0ae8d70..6b3e021 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -403,6 +403,9 @@ sub cmd_dcommit {
svn_path => '');
if (!SVN::Git::Editor->new(\%ed_opts)->apply_diff) {
print "No changes\n$d~1 == $d\n";
+ } elsif (my $merge_parent = verify_ref("$d^2")) {
+ $gs->{inject_parents}->{$last_rev} =
+ $merge_parent;
}
}
}
--
Eric Wong
next prev parent reply other threads:[~2007-06-12 8:39 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-08 17:25 git-svn set-tree bug Joakim Tjernlund
2007-06-10 1:47 ` Eric Wong
2007-06-10 17:21 ` Joakim Tjernlund
2007-06-10 17:27 ` Joakim Tjernlund
2007-06-10 21:33 ` Eric Wong
2007-06-10 23:27 ` Joakim Tjernlund
2007-06-10 23:37 ` Steven Grimm
2007-06-10 23:55 ` Joakim Tjernlund
2007-06-11 4:25 ` Eric Wong
2007-06-11 5:52 ` Junio C Hamano
2007-06-12 7:20 ` Eric Wong
2007-06-12 7:34 ` Junio C Hamano
2007-06-12 8:39 ` Eric Wong [this message]
2007-06-12 9:21 ` Joakim Tjernlund
2007-06-12 12:15 ` Steven Grimm
2007-06-13 9:23 ` [PATCH] git-svn: allow dcommit to retain local merge information Eric Wong
2007-06-13 17:13 ` Joakim Tjernlund
2007-06-13 23:17 ` Joakim Tjernlund
2007-06-20 7:04 ` Eric Wong
2007-06-20 6:56 ` Eric Wong
2007-06-21 16:54 ` Joakim Tjernlund
2007-07-01 13:09 ` Joakim Tjernlund
2007-06-14 6:30 ` Steven Grimm
2007-06-22 11:55 ` Joakim Tjernlund
2007-06-12 8:04 ` git-svn set-tree bug Lars Hjemli
2007-06-11 6:58 ` Steven Grimm
2007-06-11 8:52 ` Joakim Tjernlund
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=20070612083910.GA28369@muzzle \
--to=normalperson@yhbt.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=joakim.tjernlund@transmode.se \
--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).