Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Git clone task Config sections override
Git clone task Config sections override [message #1775579] Wed, 01 November 2017 17:19 Go to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 350
Registered: March 2011
Senior Member
Hi. I have a Git clone task with a "Config Sections" child to set the default configuration of the master branch as follows:

    <configSections
        name="branch &quot;master&quot;">
      <properties
          key="rebase"
          value="preserve"/>
    </configSections>


However this results in creating a new section, rather than overriding the default configuration property. More precisely the resulting .git/config file contains the following:

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


instead of just

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


Is there a way to override git config properties?

Thanks
Re: Git clone task Config sections override [message #1775617 is a reply to message #1775579] Thu, 02 November 2017 09:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29545
Registered: July 2009
Senior Member
I expect the processing in org.eclipse.oomph.setup.git.impl.GitCloneTaskImpl.configureRepository(SetupTaskContext, Repository, String, boolean, String, String, String, List<? extends ConfigSection>) which does this:
          if (value.isEmpty())
          {
            config.unset(sectionName, subsectionName, key);
            changed |= oldValue.length != 0;
          }
          else
          {
            config.setStringList(sectionName, subsectionName, key, value);
            changed |= !Arrays.asList(oldValue).equals(value);
          }
to do what the method names suggest, i.e., unset the value or set the value, not to add a new value that duplicates. I suspect the structure you have is inappropriate, i.e., I suspect the section name should be "branch", with a subsection named "master", with properties nested in that subsection.
Previous Topic:Eclipse Installer Create Start Menu and Desktop Shortcut
Next Topic:Eclipse Installer Create Start Menu and Desktop Shortcut
Goto Forum:
  


Current Time: Fri Sep 21 17:16:31 GMT 2018

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

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

Back to the top