git merge vs git rebase

Hi Genete,

The log file says that you used “git merge” to merge changes from the master branch into your genete_setup_dialog branch. I was wondering whether you should not be using the “git rebase” command instead to avoid conflicts further on? As indicated, I don’t have much practical git experience, so I good be completely wrong, but the git websites seem to suggest to use “git rebase” when applying changes from public branches…

Comments anyone?

G.

This morning I was trying the git rebase command but it refuses to push the rebased branch. See the comments in the chat:

So what I’m doing is this:

I have a pending review branch because it is a “large” modification or/and needs some testing in review board.

/---D--E(my_branch) ----Q---A--B--C(master)

I want to have a clean diff from ‘my_branch’ to ‘master’. Also I like to have a proper working patch from ‘my_branch’ to ‘master’.

So I do:

git checkout my_branch git merge master
and obtain:

/---D'--E'(my_branch) ----Q---A--B--C(master)

Then I have the opportunity to locally check if there are conflicts with my_branch and the current accepted master. If there are I have to fix them first. Once solved I can offer a clean diff just doing:

git diff master..my_branch

Once approved the branch then just merge it into master and that’s all.
-G

Hi Gerco,
Despite the above post, I’ve seen that you have rebased the gerco_opengl branch to the master one. Didn’t have you any of the mentioned problems? Can you type here what steps did you do?

Also I’ve seen that you’re using Eclipse as GUI for coding. I’m be interested on the settings to make that GUI work.

Ah! and good luck with the opengl branch! It is a very needed and demanded feature.

-G

The reason I had no problem with “git push” was because it was the first time I pushed, so I created a new head. You tried to update an existing head!

As I now understand it now, “git push” requires a “fast forward” merge to complete successfully. This fast forward can only occur if the head of the remote branch you push to is one of the ancestors of you local branch. Doing a “git rebase” on your local branch, however, basically rewrites your local ancestors, and they are therefore no longer the same as on the remote branch, making “git push” fail.

BTW, this looks more like a rebase than a merge!

              /---D'--E'(my_branch)
----Q---A--B--C(master)

As you indicated in the IRC, we have to be very careful with (external) diffs since they can potential undo new changes on the master branch!

I simply create three empty, C++ Makefile projects on top of the existing directories (ETL, synfig-core, synfigstudio) that way Eclipse does not modify the Makefile. I add the “all” and “install” targets to the three Eclipse projects to compile, and configure the project paths to allow Eclipse to better find the various include files. What else would you like to know…

Well, it’s currently not my intention start heavy development on the OpenGL stuff, but this way the threshold to continue working on it is lower for everyone (including me). However, apart from OpenGL knowledge, people working on the OpenGL stuff also need to know the approach taken, the overal plan, and how much is already done. Do you know whether that is documented somewhere?

G.

No. Everything is (was) in Uiomae head. I walked with him during his development (cheated a lot meanwhile he was coding) but he didn’t documented anything. That’s the curse of the geniuses. They don’t feel the need to document his acts.
-G