Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-65032] Add option to include merge commits in changelogs #1214

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

railsharipov
Copy link

@railsharipov railsharipov commented Nov 14, 2024

Testing done

  • Added new tests

Added features

  • Option to Include merge commits in the changelog

Changes

  • CliGit implementation changelog format was reverted from custom format to --format=raw.
  • Since CliGit implementation was reverted to use raw format the date format has changed to default (unix time).

In the past, changelog format for CliGit implementation was changed to custom format because of the git-plugin date parsing issue (https://issues.jenkins.io/browse/JENKINS-27097). Since then git-plugin date parsing has been updated: https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitChangeSet.java#L282-L300

Currently following custom changelog format is used:

/** Equivalent to the git-log raw format but using ISO 8601 date format - also prevent to depend on git CLI future changes */
public static final String RAW =
    "commit %H%ntree %T%nparent %P%nauthor %aN <%aE> %ai%ncommitter %cN <%cE> %ci%n%n%w(0,4,4)%B";

The above custom format is not equivalent to git-log raw format since all parent commits are placed on a single line:

parent sha1 sha2 ...

Although expected output is:

parent sha1
parent sha2

Existing JGit implementation places each parent commit on a separate line so there is inconsistency between CliGit and JGit implementations.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@railsharipov railsharipov requested a review from a team as a code owner November 14, 2024 04:48
@github-actions github-actions bot added the tests Automated test addition or improvement label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Automated test addition or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant