Subject: Re: branch versioning

From: Tomas Carnecky <[email-masked]>
Date: Mon, 04 Oct 2010 16:33:38 +0200

On 10/4/10 3:18 PM, Nguyen Thai Ngoc Duy wrote:
> Hi,
> 
> How do you guys manage versions of a topic branch? I usually end up
> saving format-patch series somewhere or forget all old versions.
> Although I really want to keep old versions around. reflog to me   is
> polluted with every kind of branch updates. And it's local
> information. It can't be transferred to another repo (or can it?)
> 
> On the same subject, I have quite a few old topic branches that I
> rarely touch. I don't want to remove them. I just want to hide them
> away from "git branch". I've been thinking of "attic/" namespace that
> "git branch" by default will not show. Just wondering if other people
> face the same problem..

There was a blog post from someone suggesting how to extend rebase to
track the old and new commits so the old ones don't get lost (sadly I
can't find the blog post anymore). The idea was to add the old commit as
the second parent to the newly rebased commits. This way you can track
the evolution of commits across multiple iterations. You could do the
same with topic branches: after you create the new version of the topic
branch, add the old topic branch as the second parent of the new branch
head (use merge -s ours to discard changes made by the old topic
branch). And to submit the commits in a topic branch for review you'd
use --first-parent.

tom