Community
Participate
Working Groups
Background : We are using the jgitflow maven plugin (version 1.0-m3) [1], which in turn uses jgit (version 3.3.1.201403241930-r) [2]. All commits generated for us by jgitflow MUST contain the gerrit changeID [3], as these commits will enter the gerrit dance later. jgitflow uses CommitCommand [4] and MergeCommand [5] jgit API. Although the CommitCommand class has a 'insertChangeId' attribute (which defaults to false), there is no mean to have this insertChangeId set to true with some external configuration, i.e., without changing the jgitflow maven plugin sources. Worst, in MergeCommand, there seems to be no way to include a gerrit changeID in the merge commit generated. Proposal (copied verbatim from suggestions by Matthias Sohn in a mail exchange): « There is a custom git configuration option gerrit.createChangeId defined in JGit's ConfigConstants [6]. Though at the moment it's used by EGit only. So if jgitflow doesn't call the corresponding setter there is no way to configure that at the moment. (...) we could consider teaching CommitCommand to directly respect this configuration option if it's set in git configuration. (...) we should also enhance MergeCommand to support setting changeId similarly to CommitCommand » Thanks Christophe [1] https://bitbucket.org/atlassian/jgit-flow/wiki/Home [2] https://bitbucket.org/atlassian/jgit-flow/src/f78e05f8167357c7bc38a23db3f8c42a9a7fe475/pom.xml?at=develop [3] http://gerrit.googlecode.com/svn/documentation/2.0/user-changeid.html [4] https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java [5] https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java [6] https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java#L192