[git repos] (was: elmentary (watson): merge (named) branches and/or bookmarks)

Uwe Brauer oub at mat.ucm.es
Sun Dec 18 14:37:00 UTC 2016


   > Uwe Brauer writes:


   > Same for me. And I wish I could tell hg-git to use named branches — but
   > I know that this doesn’t work.

   > The trouble you run into is what git calls fast-forward merge, by
   > the way. It’s not an actual merge, just a pointer movement.

Actually I would like to describe the  problem  I am having with these
git repos I access via the hg-git plugin a bit more in detail.
Suppose I would like to contribute to that repo by adding a new file.

    -  what works: I create a new branch, call it feature. I edit and
       commit several times till I am satisfied. I then merge that to
       the default branch. Now I could push just the default branch to
       the repo or in case I don't have write access, I just would send
       a patch. However then I have to strip the merge commit before
       pulling again. This strategy works relatively well.

    -  what causes trouble: I create a bookmark say bookfeature.  I edit and commit
       several times till I am satisfied. Now as we just said I cannot
       merge, (I could of course do
       hg update bookfeature (to be sure)
       hg bookmark -f master (moving the master bookmark forward).

       But now I can neither push nor generate a patch, because that
       would actually generate a series of small patches, which the
       maintainers don't like. So I could have avoided that by using the
       amend option, (but then what is the point of a version system, if
       I collapse all the commits).

       In that situation I cannot use histedit, nor rebase (with the
       collapse option).
       Only if I pull and hopefully obtain a new head I could use
       histedit or rebase, that looks a bit absurd.

Here is the small script which simulates the situation


hg init
hg bookmark master
echo main > new.el
hg add new.el
hg commit -m main1
echo offical2 >> new.el
hg commit -m main2
echo main3 >> new.el
hg commit -m main3
hg bookmark feature
echo feature > feature.el
hg add feature.el
hg commit -m feature
echo feature2 >> feature.el
hg commit -m feature2
hg update master
hg merge feature


That is basically what I sent earlier.




More information about the Mercurial mailing list