empty commits

538 views
Skip to first unread message

Mathieu Arnold

unread,
Feb 2, 2011, 12:24:33 PM2/2/11
to gitflo...@googlegroups.com
Hi,

I've been playing with gitflow quite a bit for a few days, and first, I'd
like to say that I find it very good.

Now, I have question, when merging branches, it does the merge with
--no-ff, which generates an empty merge commit.

Now, I don't see any good reason for it to be so, I mean, gratuitous empty
commits in my history hurt my eyes :-)

So, for my questions, what exactly is the point of doing such an empty
commit ? And would it be possible not to do so ?

Regards,

--
Mathieu Arnold

Vincent Driessen

unread,
Feb 2, 2011, 1:56:49 PM2/2/11
to gitflo...@googlegroups.com
Hi Mathieu,

Thanks for trying out git-flow. The empty merge commit you are talking about is there for a very deliberate reason. It is discussed in the original branching model blog post. It's mainly about not losing historical information. For a more in-depth discussion, please look under the heading "Incorporating a finished feature on develop" on http://nvie.com/posts/a-successful-git-branching-model/ (sorry, no permalink to the paragraph there).

Hope that clarifies the intentions.

Cheers,
Vincent

Mathieu Arnold

unread,
Feb 3, 2011, 6:19:05 AM2/3/11
to gitflo...@googlegroups.com
+--On 2 février 2011 19:56:49 +0100 Vincent Driessen <vin...@datafox.nl>
wrote:

| Hi Mathieu,
|
| Thanks for trying out git-flow. The empty merge commit you are talking
| about is there for a very deliberate reason. It is discussed in the
| original branching model blog post. It's mainly about not losing
| historical information. For a more in-depth discussion, please look under
| the heading "Incorporating a finished feature on develop" on
| http://nvie.com/posts/a-successful-git-branching-model/ (sorry, no
| permalink to the paragraph there).
|
| Hope that clarifies the intentions.

Ok, it does, thank you.

But, as I was more likely to do rebase than merge so that I did not have
extra commits, do you think it would be possible to have the possibility to
have a mode in git-flow where the merge --no-ff were replaced with a rebase

Vincent Driessen

unread,
Feb 3, 2011, 6:59:57 AM2/3/11
to gitflo...@googlegroups.com
Hi Mathieu,

You could use feature rebase for that purpose:

$ git flow feature rebase

That rebases the current feature branch onto develop.

Cheers,
Vincent

Mark Derricutt

unread,
Feb 3, 2011, 7:07:09 AM2/3/11
to gitflo...@googlegroups.com
Vincent,

That however keeps the feature branch open ( use that command often - love it ), but my reading of this was that Mathieu more wanted to rebase the feature onto develop and delete the feature brach.

Effectively the same of "feature finish", but with a rebase instead of a merge, so that you only have a linear revision history, rather than a diverging/rejoining path of commits.

As it is currently, you'll still get the merge commit after a rebase.

--
"Great artists are extremely selfish and arrogant things" — Steven Wilson, Porcupine Tree

Mathieu Arnold

unread,
Feb 3, 2011, 8:17:27 AM2/3/11
to gitflo...@googlegroups.com
+--On 4 février 2011 01:07:09 +1300 Mark Derricutt <ma...@talios.com> wrote:
| Effectively the same of "feature finish", but with a rebase instead of a
| merge, so that you only have a linear revision history, rather than a
| diverging/rejoining path of commits.

And not only for feature but also release or hotfix or... :-)

--
Mathieu Arnold

Alexander Sorokin

unread,
Feb 4, 2011, 3:34:34 PM2/4/11
to gitflo...@googlegroups.com
You can always use plain git to do all the magic.

The point of gitflow is to make sure the merge history is preserved.
Specifically, if you must revert the changes, you won't need to track
down individual commits.

I love rebasing and squashing feature branches to make them easier to
understand, but I try to avoid --ff merges to develop/master branches.

Cheers!
Alex

Vincent Driessen

unread,
Feb 8, 2011, 1:38:35 AM2/8/11
to gitflo...@googlegroups.com
Hi Mathieu, Mark,

Don't forget that there exists a -r flag to the finish command, which rebases instead of merges when finishing. I think this is what you are looking for.

The option was broken for a while, due to a flag parsing bug, but it should work again on the latest develop.

Cheers,
Vincent

Reply all
Reply to author
Forward
0 new messages