Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » git clone without rebase config
git clone without rebase config [message #1830592] Wed, 29 July 2020 13:49 Go to next message
Michalis Adamidis is currently offline Michalis AdamidisFriend
Messages: 5
Registered: June 2020
Junior Member
When setting up eclipse with workspaces for specific projects via oomph, we currently allow the user to either clone a predefined git repository automatically or to provide a location of an existing clone manually.
We noticed, that when we clone the repository automatically via the GitCloneTask, the local clone automatically gets setup with a "rebase" configuration for the branch:

[branch "master"]
	remote = origin
	merge = refs/heads/master
	rebase = true

This differs to a default manual checkout, which has no value set and relies on either a value in the global user configuration or to just use the regular default (which is merge).
As using "Import..." -> "Git" -> "Projects from Git" does not have that behavior I guess it's something hardcoded into Oomph?

Is there a possibility to remove that configuration? I think overwriting it with a config section in the setup model will allow us to disable it, but it would probably still overwrite the users default settings.
Re: git clone without rebase config [message #1830631 is a reply to message #1830592] Thu, 30 July 2020 06:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Yes, currently this is hard coded.

https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.setup.git/src/org/eclipse/oomph/setup/git/impl/GitCloneTaskImpl.java#n1359

I think because the branch is created after the repository is configured that you currently cannot change this.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: git clone without rebase config [message #1830633 is a reply to message #1830631] Thu, 30 July 2020 06:53 Go to previous messageGo to next message
Michalis Adamidis is currently offline Michalis AdamidisFriend
Messages: 5
Registered: June 2020
Junior Member
Can you elaborate the reason for this handling? This isn't the usual/default way to work with git repositories and it's said to be potentially dangerous if one (the user) doesn't know the implications (see https://git-scm.com/docs/git-config#Documentation/git-config.txt-branchltnamegtmerge).

Seeing as oomph is all about user choice (or at least I thought so), I'm not sure this really fits the bill here.
Re: git clone without rebase config [message #1830635 is a reply to message #1830633] Thu, 30 July 2020 08:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
There's not much to say, other than this is how we personally always used it and since 4 years, no one complained about it being this way...

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: git clone without rebase config [message #1830647 is a reply to message #1830635] Thu, 30 July 2020 12:53 Go to previous messageGo to next message
Michalis Adamidis is currently offline Michalis AdamidisFriend
Messages: 5
Registered: June 2020
Junior Member
I see. Does it make sense to make that configuration optional in the future? So it's not configured by default but can be activated in the setup model?
Re: git clone without rebase config [message #1830649 is a reply to message #1830647] Thu, 30 July 2020 13:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
We added some stuff in the past so that org.eclipse.oomph.setup.git.impl.GitCloneTaskImpl.configureLineEndingConversion(SetupTaskContext, StoredConfig) isn't called when the configuration in the task has an autocrlf property.

Perhaps something along other lines. Or a specify feature in the task, defaulting to rebase, but allowing the other sensible choices. In the IDE there seem to be four choices, Rebase, Rebase preserving merge commits, Rebase interactively, and Merge. I'm not sure how all these map to properties. You seemed to suggest that not configuring it should be possible to such that some default is used.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: git clone without rebase config [message #1830739 is a reply to message #1830649] Sun, 02 August 2020 09:52 Go to previous messageGo to next message
Michalis Adamidis is currently offline Michalis AdamidisFriend
Messages: 5
Registered: June 2020
Junior Member
Ed Merks wrote on Thu, 30 July 2020 13:43
You seemed to suggest that not configuring it should be possible to such that some default is used.


Thats the case yes. If there is no rebase configuration at all, the default handling in git clients is "merge". Of course configurations are read in a predefined order on the specific system. So global default (merge) is overwritten by the user configuration (.gitconfig in user directory), which is in turn overwritten by the repository configuration.

I like the idea of having a property "rebase" in the task configuration for that. The options you mentioned seem to map to the following git config options (see the official git config documentation):

  • "true": Rebase (current default)
  • "preserve": Rebase preserving merge commits (this seems to be deprecated in favor of "merges" which seems to do similar things)
  • "interactive" = Rebase interactively
  • "false" = merge (git default)


Additionally one could add "inherit" which would leave out the option completely.
Re: git clone without rebase config [message #1830755 is a reply to message #1830739] Mon, 03 August 2020 09:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
I'm not sure exactly how to interpret the documentation. From the documentation, I get the sense that the value of the rebase property can be "true", "preserve", "interactive", and "merges ", but playing with the EGit settings, I only see it setting the rebase property to "true", "preserve", "interactive", and "false", and once set, there is no way to remove it entirely. I'd want to ask the EGit experts for clarification on this.

But I can imagine defining an EEnum in the Git.core model with similar (the same) choices as EGit has for this, though as you suggest with an additional option (enumerator) for removing the property entirely (or not setting it at all). This could then be used as the type a rebase attribute on the GitCloneTask for directing the behavior and could then be used in GitCloneTaskImpl to change the current hard coded behavior.

You could use the following to set up a development environment to contribute such a feature:

https://www.eclipse.org/setups/installer/?url=http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/configurations/OomphConfiguration.setup&show=true


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: git clone without rebase config [message #1836821 is a reply to message #1830755] Thu, 14 January 2021 17:25 Go to previous messageGo to next message
Joe Shannon is currently offline Joe ShannonFriend
Messages: 9
Registered: February 2020
Junior Member
We would also be interested in allowing this aspect to be configured.

I think adding the enum would be a useful addition providing the names are not too confusing. E.g. "merges" is now preferred over "preserve" (which are both forms of preserving merges) but this could easily be confused with "false" which means don't rebase but merge instead.

The current implementation writes the rebase property on a per branch basis (equivalent to "branch.<name>.rebase").
One idea would be to switch to use the "pull.rebase" entry as this sets the property at the repository level rather than the branch level. This way it can be written by configureRepository() or just after. This also allows for flexibility if specific behaviour for a different branch is required it could be added by a usual config property since "branch.<name>.rebase" overrides "pull.rebase".

Has a bug been opened for this? Otherwise I can create one and take a look at contributing.
Re: git clone without rebase config [message #1836879 is a reply to message #1836821] Sun, 17 January 2021 04:50 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
No bug has been opened. So yes, please create one if you intent to contribute.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to set osgi.instance.area in installed config.ini
Next Topic:Correctly share Eclipse Product Setup
Goto Forum:
  


Current Time: Thu Mar 28 11:37:13 GMT 2024

Powered by FUDForum. Page generated in 0.03717 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top