Giter Site home page Giter Site logo

paulwellnerbou / git-changelog Goto Github PK

View Code? Open in Web Editor NEW
10.0 6.0 5.0 70 KB

A library and command line tool to extract all JIRA tickets out of commit messages between two GIT revisions and create a URL to the JIRA filter showing those commits in JIRA.

Java 100.00%

git-changelog's Introduction

git-changelog

A library and command line tool to extract a changelog out of commit messages between two GIT revisions. This changelog can be postprocessed and converted to either an human readable git changelog listing all commits, or a JIRA filter URL.

How to build

To build the project completely, package a distribution (see https://docs.gradle.org/current/userguide/application_plugin.html) and install the artifacts into your local .m2/repository:

./gradlew clean build install distZip

The distribution will be packaged into build/distributions.

How to run

You can run the application with gradle:

	./gradlew run -Pargs='--processor=jirafilter --repo=/path/to/your/git/repo --baseurl=http://jira.base.url/ --projects=PRJ1,PRJ2'

Or you can use the unzipped distribution build before:

./git-changelog --processor=jirafilter --repo=/path/to/your/git/repo --baseurl=http://jira.base.url/ --projects=PRJ1,PRJ2

Usage

usage: git-changelog [OPTIONS] <revFrom> <revTo>
    --processor <class name or id>   Available processors: jirafilter,
                                     basic
    --repo </path/to/repo>           Path to git repository to use,
                                     defaults to '.'.

The command line interface is still work in progress, it may be extracted into another library or groovy script and distributed as a separate artifact.

Postprocessors

At the moment, there are two postprocessors implemented:

  • jirafilter: Scans the git changelog for jira tickets and creates an URL to the JIRA filter.
  • basic: Prints a human readable git changelog with short commit hashes and commit messages

How to use the library

Basically all you have to do is add this as dependency. For maven, this would be:

    <dependency>
        <groupId>de.wellnerbou</groupId>
        <artifactId>git-changelog</artifactId>
        <version>VERSION</version>
    </dependency>

Then, import the GitChangelog class, create an instance of the GitChangelog object and use it, as the command line entry point (main() in GitChangelog) is doing.

Example: Changelog of Jenkins' latest release

Command line

./gradlew run -Pargs='--processor=jirafilter --repo=/path/to/src/jenkinsci --baseurl=https://issues.jenkins-ci.org/ --projects=JENKINS'

This is how the output will look like (or similar, if a newer version is released):

No revs given, searching automatically for latest released tags...
Found toRev tag jenkins-1.617
Found fromRev tag jenkins-1.616
Jira-Tickets mentioned in commits between jenkins-1.616 and jenkins-1.617:
JENKINS-28654,JENKINS-28704,JENKINS-27739
https://issues.jenkins-ci.org/issues/?jql=key%20in%20%28JENKINS-28654,JENKINS-28704,JENKINS-27739%29

Java

AppArgs gitChangelogArgs = new AppArgs();
gitChangelogArgs.setJiraBaseUrl("https://issues.jenkins-ci.org/");
gitChangelogArgs.setJiraProjectPrefixes("JENKINS");
gitChangelogArgs.setRepo("/path/to/src/jenkinsci");
GitJira gitChangelog = new GitJira(gitChangelogArgs);
final Changelog changelog = gitChangelog.changelog();
gitChangelog.jiraFilterUrl(changelog.getTickets());

git-changelog's People

Contributors

paulwellnerbou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

git-changelog's Issues

Looks like the gradle-wrapper.jar binary is missing

Checked out from github, tried to run gradlew and ran into this:

bash-3.2$ ./gradlew
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
bash-3.2$
bash-3.2$ pwd
/Users/buck/git/git-changelog
bash-3.2$ ls gradle/wrapper/
gradle-wrapper.properties
bash-3.2$

Git Plugin 4.x not compatible with changelog.

Hello,

I'm not 100% sure about the issue. Your plugins is great and worked smooth for a long time on an old Jenkins server. We rebuilt one from scratch and it does not work anymore.
Note that the new server Git plugins is now 4.1.1, on the old server it's 3.x

I get this error message :
ERROR: Step ‘Publish JIRA Filter’ aborted due to exception:
java.lang.NoSuchMethodError: org.eclipse.jgit.lib.Repository.getRef(Ljava/lang/String;)Lorg/eclipse/jgit/lib/Ref;
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.resolveRev(GitLogBetween.java:44)
at de.wellnerbou.gitchangelog.jgit.GitLogBetween.getJGitLogBetween(GitLogBetween.java:32)

I found this on the wed, similar issue : https://issues.jenkins-ci.org/browse/JENKINS-53004
Seems like the conclusion is "reference to a symbol that JGit 4.x deprecated and JGit 5.x removed."

Not sure what this means … could it be the plugins needs a new revision to be compatible git plug ins 4.x

Thanks for your help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.