Rebase by default when pulling

Pierre Goiffon 4 years ago updated 4 years ago 12

For a fresh new SmartGit install in my team, we always need to change the default pull behavior : doing a rebase with local changes instead of a merge commit. The later produces absolutely unreadable logs and I think for the vast majority of users is an aberration.

So I'd suggest to change the default value, or make it configurable as soon as clogin / opening a new repo.

Satisfaction mark by Pierre Goiffon 4 years ago

The dialog should have an option to remember it for all repositories. While I completely agree with you regarding the preference of rebase over merge, I guess the most teams will rather use merge, e.g. because they don't trust rebase.

Yes, there should be at least a way to change it globally. After you've installed SmartGit (might be an option in the installer right ?) And for an existing installation also... Because for now if you forget to change the option immediately after cloning or opening for each repo, then you are in trouble :(

No, this checkbox should be shown on each repository where you are pulling the first time - until you select it.

Thomas, I didn't understand your last answer, can you explain more ?

For now the option is present when pulling, but is pretty well hidden. Indeed we did install some new SmartGit instances recently and despite our well written procedure we forgot twice to change the option, which caused our logs to become mad again.

And if you don't change it on the first pull then you'll have to re open each branch on which you already pulled with the wrong option right ?

The different solution I see :

* Changing the default option value

Reading your first comment I understood you don't want to change this ? But I can say SmartGit is the only Git client I have used that have this behavior by default, and that it is VERY annoying.

* Add a screen in the install wizard that let you choose the default option value

* Have a way to change the default behavior globally, including already pulled branches

Ich mean this dialog which pops up on Pull if pull.rebase is not configured yet in the .git/config file.

If you select the "Remember"-checkbox, pull.rebase = true will be added to ~/.gitconfig and you won't see this dialog again.

Ok, your proposal is that on each repo when you pull for the first time you would get this new dialog ? This gives more visibility to the option indeed... could a good solution as a first step.

But I'm still concerned that new developers would miss the step even having this option exposed as clearly... And by the time someone else on the team notice, he'll have dozens of repo configured with the merge commit option instead of rebase. In this case, you'll have to change every branch manually, which is quite a pain :/

You will see this dialog, if rebase-vs-merge is not yet configured. The default of this dialog is already rebase. I reckon we can assume if the user intentionally selects Merge, then this is done for a good reason. You also can tell your co-workers to always set the option pull.rebase=true in their ~/.gitconfig files. Then they will not see this dialog.

Sorry I still don't understand. The dialog opening depends on the pull.rebase option in ~/.gitconfig. As we didn't see the dialog in newly fresh installs, my questions :

  • is the dialog only present in recent builds, ie not present in 8 and downwards ?
  • is the pull.rebase option added by anything other than SmartGit ? Can it be already fixed when launching SmartGit for the first time ?

This dialog should exist for a couple of releases. Did you check your ~/.gitconfig and .git/config files for this pull.rebase option?

I need to try installing SmartGit from scratch... Will do and i'll get back to you.

I've just tried a fresh new install, with SmartGit 8.0, and I had this dialog on the first pull I did, with rebase selected as default. It's quite nice ! I would suggest "remember as default" option to be checked by default also if possible ?