eclipse-egit / egit

EGit, the git integration of Eclipse IDE
https://www.eclipse.org/egit/
Eclipse Public License 2.0
17 stars 7 forks source link

Ability to prepopulate merge vs rebase choice based on project policy preference #2

Closed srikanth-sankaran closed 11 months ago

srikanth-sankaran commented 11 months ago

I work on Eclipse/JDT - the project policies are to opt for Rebase when pulling (Right click on repo, choose Pull ...) or when I create a branch and configure upstream for push/pull.

Most of the time when working with egit, these dialogs come pre-populated with Merge. Given how divergent the course of action these choices implement, I am paranoid about the wrong default choice being picked up.

This issue is to request a way to configure and control the pre-poplulation choice of Rebase v Merge.

(If there is already a way to do that, apologies for the noise - I did ask around among more expert users and didn't find a way)

iloveeclipse commented 11 months ago

@NikunjChavda19 : your problem is completely unrelated to this ticket. Please create dedicated issue!

NikunjChavda19 commented 11 months ago

@iloveeclipse : I have already created one.

Please refer this : https://github.com/eclipse-egit/egit/issues/1#issue-1969923700

iloveeclipse commented 11 months ago

@iloveeclipse : I have already created one.

Fine, so please avoid hijacking other tickets.

NikunjChavda19 commented 11 months ago

@iloveeclipse Oh ! Can you please let me know the dedicated platform to report the issue ?

iloveeclipse commented 11 months ago

Can you please let me know the dedicated platform to report the issue ?

You have already reported one: https://github.com/eclipse-egit/egit/issues/1

srikanth-sankaran commented 11 months ago

@NikunjChavda19 - If your issue doesn't get picked up for work in "reasonable time" and it is impacting your work/productivity, you may want to ask in the project mailing lists for help. (See https://projects.eclipse.org/projects/technology.egit/contact). I don't have visibility into the project's plans, priorities and resource constraint etc.

NikunjChavda19 commented 11 months ago

@srikanth-sankaran : Thank you for the guidance 👍

Bananeweizen commented 11 months ago

That's possible since many years: https://git-scm.com/docs/git-config#Documentation/git-config.txt-branchautoSetupRebase (with always). egit will respect that setting. In fact, I have all my company Oomph profiles with that (and some other) config values so everyone gets it without even knowing. Might be good to add it to JDTs Oomph setup too.

iloveeclipse commented 11 months ago

Thanks, that works!

TL;DR

branch.autoSetupRebase=always entry should be added to the git repository properties dialog, the end result will look like:

image

iloveeclipse commented 11 months ago

@merks : for those who use Oomph (I'm thinking on Platform setups), could we automatically change git settings after clone to have rebase preselected?

merks commented 11 months ago

Could you please open an issue and in that issue paste the full config file text of a properly configured repository so that I can be sure I've created the correct structure. Probably we'd want to do this for all the SDK setup clones, so it doesn't matter in which repo you create the issue...

iloveeclipse commented 11 months ago

@merks : https://github.com/eclipse-jdt/eclipse.jdt/issues/79

srikanth-sankaran commented 11 months ago

Thanks, that works!

TL;DR

branch.autoSetupRebase=always entry should be added to the git repository properties dialog

FYI, This works for the git branch, git switch or git checkout operations wrapped up by the egit UI. However, if right click on a repo and choose Pull ... I still see merge as the prepopulated choice.

tomaswolf commented 10 months ago

Also set pull.rebase = true.

merks commented 10 months ago

@tomaswolf

The existing property looks like this in the setup:

image

So this new one should be like the selected above?

tomaswolf commented 10 months ago

What's that image? An Oomph setup? I don't know how it should look.

If the git config is already set via the Oomph setup, then it's fine. But then I don't understand why srikanth still had the merge option pre-selected.

merks commented 9 months ago

Yes, I don't understand either what the purpose of this other option is. I can set it like above and then it looks like this in the clone:

image

But what does that do?

When Oomph clones the branch it always sets it to rebase by default, as you can see above. So a Pull... does this

image

Before I add the other option, I'd like to understand what it does.

Bananeweizen commented 9 months ago

I'm not sure if the "rebase.pull" option needs to be set globally. The behavior is as follows, AFAIK:

Does that roughly fit, @tomaswolf or did I miss some aspect? I would think that a freshly created Oomph setup would not need the rebase.pull option, because there are no branches without specific setting, right?

@merks You can experiment on your own by simply deleting all lines belonging to a branch configuration, but not the section of the branch. So for the first branch in this screenshot the dialog will always be rebase, for the second one it will be either repository default or last used: grafik