Skip to main content



      Home
Home » Eclipse Projects » Oomph » git clone without rebase config
git clone without rebase config [message #1830592] Wed, 29 July 2020 09:49 Go to next message
Eclipse UserFriend
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 02:42 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: git clone without rebase config [message #1830633 is a reply to message #1830631] Thu, 30 July 2020 02:53 Go to previous messageGo to next message
Eclipse UserFriend
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 04:54 Go to previous messageGo to next message
Eclipse UserFriend
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...
Re: git clone without rebase config [message #1830647 is a reply to message #1830635] Thu, 30 July 2020 08:53 Go to previous messageGo to next message
Eclipse UserFriend
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 09:43 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: git clone without rebase config [message #1830739 is a reply to message #1830649] Sun, 02 August 2020 05:52 Go to previous messageGo to next message
Eclipse UserFriend
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 05:28 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: git clone without rebase config [message #1836821 is a reply to message #1830755] Thu, 14 January 2021 12:25 Go to previous messageGo to next message
Eclipse UserFriend
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] Sat, 16 January 2021 23:50 Go to previous message
Eclipse UserFriend
No bug has been opened. So yes, please create one if you intent to contribute.
Previous Topic:How to set osgi.instance.area in installed config.ini
Next Topic:Correctly share Eclipse Product Setup
Goto Forum:
  


Current Time: Sat May 24 16:19:40 EDT 2025

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

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

Back to the top