Skip to content

Add support for first-parent arg when fetching the list of changes from git#391

Closed
zambamingi wants to merge 7 commits intojenkinsci:masterfrom
zambamingi:master
Closed

Add support for first-parent arg when fetching the list of changes from git#391
zambamingi wants to merge 7 commits intojenkinsci:masterfrom
zambamingi:master

Conversation

@zambamingi
Copy link

@zambamingi zambamingi commented Jan 3, 2019

This is the git-client-plugin side of the changes to implement https://issues.jenkins-ci.org/browse/JENKINS-50366. There are changes in the git-plugin as well, I'll submitted a pull request there as well.

return includes(rev.name());
}

public ChangelogCommand firstParent() {
Copy link
Contributor

@darxriggs darxriggs Jan 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add @Override and in the JGit implementation too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching this, I addressed this in my latest commit

return firstParent(true);
}

public ChangelogCommand firstParent(boolean firstParent) {
Copy link
Contributor

@darxriggs darxriggs Jan 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add @Override and in the JGit implementation too.

ChangelogCommand includes(ObjectId rev);

/**
* Sets the firstParent private variable to true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to document the behaviour that is triggered by setting the variable value, not just that the variable is set. The former is more useful for the user of this API.

ChangelogCommand firstParent();

/**
* Sets the firstParent private variable to boolean param
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment for firstParent().

/**
* Sets the firstParent private variable to boolean param
*
* @param firstParent a {@link java.lang.boolean} object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't include the type in description again (even if there are some existing Javadocs like this} - java.lang.boolean is not even valid.

}

public ChangelogCommand firstParent(boolean firstParent) {
return this;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please either implement this functionality in JGit (preferred) or log a warning that this parameter is not supported in the JGit implementation. Otherwise the user has no idea when enabling this feature why it's not working as expected.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the suggestion, I addressed this in my latest commit

String mergeMessage = "Merge message to be tested.";
w.git.merge().setMessage(mergeMessage).setGitPluginFastForwardMode(MergeCommand.GitPluginFastForwardMode.NO_FF).setRevisionToMerge(w.git.getHeadRev(w.repoPath(), "branch-1")).execute();

if (w.git instanceof CliGitAPIImpl) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use @NotImplementedInJGit on the test method instead of this instanceof check. The former is more descriptive.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the suggestion, I addressed this in my latest commit

@MarkEWaite MarkEWaite added the Changelog Changelog computation label Mar 9, 2019
@MarkEWaite
Copy link
Contributor

Assigned label 'Changelog' and milestone 'Later' so that it can be revisited when reviewing changelog related pull requests

@MarkEWaite MarkEWaite closed this Mar 9, 2019
@MarkEWaite MarkEWaite removed the Changelog Changelog computation label Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants