git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] git-svn: Handle git root commits in mergeinfo ranges
@ 2011-06-18  6:47 Michael Haggerty
  2011-06-18  6:47 ` [PATCH 1/3] git-svn: Demonstrate a bug with " Michael Haggerty
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michael Haggerty @ 2011-06-18  6:47 UTC (permalink / raw)
  To: git; +Cc: gitster, bert.wesarg, normalperson, git, Michael Haggerty

The maint version of git-svn fails if there is a svn:mergeinfo range
that includes a commit that has no parent; for example, "/trunk:1-59".
Similar problems have been discussed before [1,2].

The problem in this case is that git-svn tries to obtain the list of
git revisions brought into the branch by this range by running

    git rev-list "$bottom_commit^..$top_commit"

where $bottom_commit is the SHA1 of the git commit corresponding to
the first commit in the mergeinfo range.  But $bottom_commit is a root
commit and does not have a parent.

As noted in [3], the obvious solution,

    git rev-list "$bottom_commit^!" "$top_commit"

, causes breakage in test 5 of t9151-svn-mergeinfo.sh.  The problem is
that it is important to exclude only those commits reachable from the
*first* parent of $bottom_commit, not *all* parents.

Instead, this patch simply uses "git rev-parse" to determine whether
$bottom_commit has any parents at all.  If not, then the following
command is used instead:

    git rev-list "$top_commit"

I don't believe the extra "git rev-parse" invocation to be a
performance problem, but I am not familiar enough with the code to be
certain.

Michael

[1] http://thread.gmane.org/gmane.comp.version-control.git/146255
[2] http://thread.gmane.org/gmane.comp.version-control.git/171248
[3] http://article.gmane.org/gmane.comp.version-control.git/150416

Michael Haggerty (3):
  git-svn: Demonstrate a bug with root commits in mergeinfo ranges
  git-svn: Disambiguate rev-list arguments to improve error message
  git-svn: Correctly handle root commits in mergeinfo ranges

 git-svn.perl                           |   11 ++++++---
 t/t9159-git-svn-no-parent-mergeinfo.sh |   33 ++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 4 deletions(-)
 create mode 100755 t/t9159-git-svn-no-parent-mergeinfo.sh

-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-28  3:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-18  6:47 [PATCH 0/3] git-svn: Handle git root commits in mergeinfo ranges Michael Haggerty
2011-06-18  6:47 ` [PATCH 1/3] git-svn: Demonstrate a bug with " Michael Haggerty
2011-06-18  6:47 ` [PATCH 2/3] git-svn: Disambiguate rev-list arguments to improve error message Michael Haggerty
2011-06-18  6:48 ` [PATCH 3/3] git-svn: Correctly handle root commits in mergeinfo ranges Michael Haggerty
2011-06-28  3:37 ` [PATCH 0/3] git-svn: Handle git " Eric Wong

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).