Git development
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Matt Kern <matt.kern@undue.org>
Cc: git@vger.kernel.org
Subject: Re: Git SVN Rebranching Issue
Date: Tue, 4 Nov 2008 00:41:11 -0800	[thread overview]
Message-ID: <20081104084111.GB14405@untitled> (raw)
In-Reply-To: <20081103140746.GA5969@mars.cyantechnology.local>

Matt Kern <matt.kern@undue.org> wrote:
> I have a git-svn issue which keeps biting me.
> 
> My company uses svn as its primary version control system.  We
> frequently create branches, e.g. /branches/somebranch, by forking the
> trunk to ensure stability over the "somebranch" code.  The problem is
> that we also frequently blow away /branches/somebranch and refork it
> from the trunk.
> 
> git-svn does a good job for most work, but I notice that if you delete
> the "somebranch" branch in svn and then refork it, also in svn, then
> when you git-svn fetch, the git commit at the head of remotes/somebranch
> will have two parents: the first is the previous head of
> remotes/somebranch, and the second is the head of remotes/trunk.  Surely
> only the remotes/trunk parent should be listed?  Any connection with the
> previous remotes/somebranch is an accident of naming.  The real problem
> then comes when you come to look at the history in gitk.  If
> "somebranch" is rebranched many times, the git history starts looking
> pretty complicated, when in fact it should simply be the linear history
> of remotes/trunk up to the branch point followed by a few,
> branch-specific commits.  Is there any way to prevent (or modify) the
> git history to remove the errant parent?

Hi Matt,

Short answer: you can use grafts to remove parents.


It was actually an intentional design decision on my part preserve
parents based on branch name.  We would eventually otherwise lose
history of the now-deleted branches, as reflogs can expire.

To me, it's easier to drop history connections you don't want with
grafts than to recover it by refetching.

-- 
Eric Wong

  reply	other threads:[~2008-11-04  8:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-03 14:07 Git SVN Rebranching Issue Matt Kern
2008-11-04  8:41 ` Eric Wong [this message]
2008-11-04  9:42   ` Dmitry Potapov
2008-11-04 10:15     ` Sverre Rabbelier
2008-11-04 11:24     ` Matt Kern
2008-11-05  0:33     ` Eric Wong
2008-11-05  0:40       ` Avery Pennarun
2008-11-06  9:39         ` Eric Wong
2008-11-06 20:48           ` Avery Pennarun

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=20081104084111.GB14405@untitled \
    --to=normalperson@yhbt.net \
    --cc=git@vger.kernel.org \
    --cc=matt.kern@undue.org \
    /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