git

Changelog with GIT and JIRA: Creating JIRA filter URL based on git commits between two revisions with bash

I am working on a library and a jenkins plugin doing this right, but until then, here is a shell script which creates the URL to a JIRA filter containing the tickets mentioned in all commit messages between the two given revisions. Besides git and the standard command line tools (grep, sed, tr, egrep, sort, uniq) it needs gawk installed on your system. Unfortunately I didn't manage to get the variables replaces within gawk's gensub function. If you know how, drop me a line. As a workaround I am sure…

Keep reading

Getting commits between annotated tags with JGit

JGit does not support getting commits between annotated tags (or any revision and an annotated tag) as you might expect. Following code will work perfectly with commit hashs and branch identifiers: public Iterable<RevCommit> getJGitLogBetween(final String rev1, final String rev2) throws IOException, GitAPIException { Ref refFrom = repo.getRef(rev1); Ref refTo = repo.getRef(rev2); return new Git(repo).log().addRange(refFrom.getObjectId(), refTo.getObjectId()).call(); } Calling this with an annotated tag (as the maven release plugin is creating, for example): @Test public void testGetGitLogBetweenAnnotatedTagAndHead() throws Exception { Repository repository…

Keep reading

A Dockerfile for git-deps

In Git Minutes #32, Adam Spiers talked about git-deps, which was interesting for me. We don't cherry pick usually nor backport commits, but I analyse bugs trying to find out when and with which the buggy code was introduced. So I gave it a try. Just before Ubuntu released 15.04 it was not trivial to install the required dependecies for git-deps, namely libgit2 >=0.22, I created a Dockerfile based on Ubuntu 15.04, which brings all dependencies for git-deps out of the box. The git-deps visualization server starts…

Keep reading