Re: request for documentation about branch surgery

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bruno Haible
Date: Tuesday, July 7, 2009 - 3:13 am

Hi Junio,


Cool! I wouldn't have guessed that. Now you wrote it into the mailing list
archives. It would be even better if it were mentioned in the user's manual,
chapter "Rewriting history and maintaining patch series"


There are two cases of "git merge" operation: the one that creates a diamond
commit, and the one that doesn't (the "simple" case of "git merge"). The latter
operation I found useful in achieving this surgery:

            C---D---E              topic
           /
      A---B                        master

  =>

            C---D---E              topic
           /
      A---B---C---D---E            master

How do I do this, if not by using "git merge"? Is there a way to do it with
"git rebase" only?

If I have a certain task at hand, what rule of thumb would you give me,
when can I do it with "git rebase", and when can I do it with the simple case
of "git merge"?


I regularly use "git repack -a -d", so that branches like that
master@{1} get garbage collected. So from the point of view of someone
who considers only the contents of the commits that sit on branches,
it *does* cut the branch.

I know that all commits are still present and reachable by their ID,
as long as they have not been garbage collected. But when doing
branch surgery, only the contents of the labelled branches matters to me.


Oh, I do and did know all this. There is no confusion about that. My problem
was that
  - I had a couple of "how do I ..." questions regarding branch surgery,
  - the mapping between such a task and the git command to use is not clear
    (combinations of "git checkout", "git branch", "git rebase", "git merge",
    "git reset", "git cherry-pick" - enough complicated commands to get
    confused),
  - the user's manual answered only half of my questions.

Bruno
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
request for documentation about branch surgery, Bruno Haible, (Mon Jul 6, 4:05 pm)
Re: request for documentation about branch surgery, Elijah Newren, (Mon Jul 6, 7:30 pm)
Re: request for documentation about branch surgery, Junio C Hamano, (Mon Jul 6, 7:50 pm)
Re: request for documentation about branch surgery, Elijah Newren, (Mon Jul 6, 8:45 pm)
Re: request for documentation about branch surgery, Bruno Haible, (Tue Jul 7, 2:51 am)
Re: request for documentation about branch surgery, Andreas Ericsson, (Tue Jul 7, 3:06 am)
Re: request for documentation about branch surgery, Bruno Haible, (Tue Jul 7, 3:13 am)
Re: request for documentation about branch surgery, Andreas Ericsson, (Tue Jul 7, 4:03 am)
Re: request for documentation about branch surgery, Junio C Hamano, (Tue Jul 7, 8:52 am)
Re: request for documentation about branch surgery, Daniel Barkalow, (Tue Jul 7, 11:28 am)