From e1cd88f9571db40827499361a62377cc25be6825 Mon Sep 17 00:00:00 2001 From: S L Date: Sun, 24 May 2015 12:09:38 +0200 Subject: [PATCH 1/9] refactoring: extracting some functionality to a new class JGitCommon --- .../java/pl/project13/jgit/JGitCommon.java | 76 +++++++++++++++++++ .../pl/project13/maven/git/JGitProvider.java | 33 +------- 2 files changed, 79 insertions(+), 30 deletions(-) create mode 100644 src/main/java/pl/project13/jgit/JGitCommon.java diff --git a/src/main/java/pl/project13/jgit/JGitCommon.java b/src/main/java/pl/project13/jgit/JGitCommon.java new file mode 100644 index 00000000..2f22d241 --- /dev/null +++ b/src/main/java/pl/project13/jgit/JGitCommon.java @@ -0,0 +1,76 @@ +/* + * This file is part of git-commit-id-plugin by Konrad Malawski + * + * git-commit-id-plugin is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * git-commit-id-plugin is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with git-commit-id-plugin. If not, see . + */ + +package pl.project13.jgit; + +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.GitAPIException; +import org.eclipse.jgit.lib.ObjectId; +import org.eclipse.jgit.lib.Ref; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.revwalk.RevWalk; + +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import com.google.common.collect.Collections2; + +/** + * @author Konrad 'ktoso' Malawski + */ +public class JGitCommon { + public Collection getTags(Repository repo, final ObjectId headId) throws GitAPIException{ + RevWalk walk = null; + try { + Git git = Git.wrap(repo); + walk = new RevWalk(repo); + List tagRefs = git.tagList().call(); + + final RevWalk finalWalk = walk; + Collection tagsForHeadCommit = Collections2.filter(tagRefs, new Predicate() { + @Override public boolean apply(Ref tagRef) { + boolean lightweightTag = tagRef.getObjectId().equals(headId); + + try { + // TODO make this configurable (most users shouldn't really care too much what kind of tag it is though) + return lightweightTag || finalWalk.parseTag(tagRef.getObjectId()).getObject().getId().equals(headId); // or normal tag + } catch (IOException e) { + return false; + } + } + }); + + Collection tags = Collections2.transform(tagsForHeadCommit, new Function() { + @Override public String apply(Ref input) { + return input.getName().replaceAll("refs/tags/", ""); + } + }); + + return tags; + } catch (GitAPIException e) { + throw e; + } finally { + if (walk != null) { + walk.dispose(); + } + } + } + +} diff --git a/src/main/java/pl/project13/maven/git/JGitProvider.java b/src/main/java/pl/project13/maven/git/JGitProvider.java index 2e661ab3..07159904 100644 --- a/src/main/java/pl/project13/maven/git/JGitProvider.java +++ b/src/main/java/pl/project13/maven/git/JGitProvider.java @@ -24,6 +24,7 @@ import pl.project13.jgit.DescribeCommand; import pl.project13.jgit.DescribeResult; +import pl.project13.jgit.JGitCommon; import pl.project13.maven.git.log.LoggerBridge; import java.io.File; @@ -175,42 +176,14 @@ protected String getRemoteOriginUrl() throws MojoExecutionException { @Override protected String getTags() throws MojoExecutionException { - RevWalk walk = null; try { Repository repo = getGitRepository(); - Git git = Git.wrap(repo); - walk = new RevWalk(repo); - List tagRefs = git.tagList().call(); - - final ObjectId headId = headCommit.toObjectId(); - final RevWalk finalWalk = walk; - Collection tagsForHeadCommit = Collections2.filter(tagRefs, new Predicate() { - @Override public boolean apply(Ref tagRef) { - boolean lightweightTag = tagRef.getObjectId().equals(headId); - - try { - // TODO make this configurable (most users shouldn't really care too much what kind of tag it is though) - return lightweightTag || finalWalk.parseTag(tagRef.getObjectId()).getObject().getId().equals(headId); // or normal tag - } catch (IOException e) { - return false; - } - } - }); - - Collection tags = Collections2.transform(tagsForHeadCommit, new Function() { - @Override public String apply(Ref input) { - return input.getName().replaceAll("refs/tags/", ""); - } - }); - + ObjectId headId = headCommit.toObjectId(); + Collection tags = new JGitCommon().getTags(repo,headId); return Joiner.on(",").join(tags); } catch (GitAPIException e) { loggerBridge.error("Unable to extract tags from commit: " + headCommit.getName() + " (" + e.getClass().getName() + ")"); return ""; - } finally { - if (walk != null) { - walk.dispose(); - } } } From ea4a1b670eecd069473bfac48dbdd6b471a5c140 Mon Sep 17 00:00:00 2001 From: S L Date: Sun, 24 May 2015 12:45:21 +0200 Subject: [PATCH 2/9] removing static modifier --- src/main/java/pl/project13/jgit/DescribeCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/pl/project13/jgit/DescribeCommand.java b/src/main/java/pl/project13/jgit/DescribeCommand.java index ef8f6fdf..817943ea 100644 --- a/src/main/java/pl/project13/jgit/DescribeCommand.java +++ b/src/main/java/pl/project13/jgit/DescribeCommand.java @@ -476,7 +476,7 @@ private int distanceBetween(@NotNull Repository repo, @NotNull RevCommit child, } } - private static void seeAllParents(@NotNull RevWalk revWalk, RevCommit child, @NotNull Set seen) throws IOException { + private void seeAllParents(@NotNull RevWalk revWalk, RevCommit child, @NotNull Set seen) throws IOException { Queue q = newLinkedList(); q.add(child); From a1a992d430cd72ef43e809194395ae1de49fd2f0 Mon Sep 17 00:00:00 2001 From: S L Date: Sun, 24 May 2015 13:20:36 +0200 Subject: [PATCH 3/9] refactoring: moving some common functionality to JGitCommon --- .../pl/project13/jgit/DescribeCommand.java | 109 +--------------- .../java/pl/project13/jgit/JGitCommon.java | 120 ++++++++++++++++++ .../jgit/DescribeCommandIntegrationTest.java | 12 -- .../jgit/JGitCommonIntegrationTest.java | 37 ++++++ 4 files changed, 162 insertions(+), 116 deletions(-) create mode 100644 src/test/java/pl/project13/jgit/JGitCommonIntegrationTest.java diff --git a/src/main/java/pl/project13/jgit/DescribeCommand.java b/src/main/java/pl/project13/jgit/DescribeCommand.java index 817943ea..d94255d3 100644 --- a/src/main/java/pl/project13/jgit/DescribeCommand.java +++ b/src/main/java/pl/project13/jgit/DescribeCommand.java @@ -23,6 +23,7 @@ import com.google.common.base.Preconditions; import com.google.common.base.Throwables; import com.google.common.collect.Lists; + import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.GitCommand; import org.eclipse.jgit.api.Status; @@ -37,6 +38,7 @@ import org.eclipse.jgit.revwalk.RevWalk; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; + import pl.project13.jgit.dummy.DatedRevTag; import pl.project13.maven.git.GitDescribeConfig; import pl.project13.maven.git.log.LoggerBridge; @@ -494,108 +496,12 @@ private void seeAllParents(@NotNull RevWalk revWalk, RevCommit child, @NotNull S // git commit id -> its tag (or tags) private Map> findTagObjectIds(@NotNull Repository repo, boolean tagsFlag) { - Map> commitIdsToTags = newHashMap(); - - RevWalk walk = new RevWalk(repo); - try { - walk.markStart(walk.parseCommit(repo.resolve("HEAD"))); - - List tagRefs = Git.wrap(repo).tagList().call(); - String matchPattern = createMatchPattern(); - Pattern regex = Pattern.compile(matchPattern); - log("Tag refs [", tagRefs, "]"); - - for (Ref tagRef : tagRefs) { - walk.reset(); - String name = tagRef.getName(); - if (!regex.matcher(name).matches()) { - log("Skipping tagRef with name [", name, "] as it doesn't match [", matchPattern, "]"); - continue; - } - ObjectId resolvedCommitId = repo.resolve(name); - - // todo that's a bit of a hack... - try { - final RevTag revTag = walk.parseTag(resolvedCommitId); - ObjectId taggedCommitId = revTag.getObject().getId(); - log("Resolved tag [",revTag.getTagName(),"] [",revTag.getTaggerIdent(),"], points at [",taggedCommitId,"] "); - - // sometimes a tag, may point to another tag, so we need to unpack it - while (isTagId(taggedCommitId)) { - taggedCommitId = walk.parseTag(taggedCommitId).getObject().getId(); - } - - if (commitIdsToTags.containsKey(taggedCommitId)) { - commitIdsToTags.get(taggedCommitId).add(new DatedRevTag(revTag)); - } else { - commitIdsToTags.put(taggedCommitId, newArrayList(new DatedRevTag(revTag))); - } - - } catch (IncorrectObjectTypeException ex) { - // it's an lightweight tag! (yeah, really) - if (tagsFlag) { - // --tags means "include lightweight tags" - log("Including lightweight tag [", name, "]"); - - DatedRevTag datedRevTag = new DatedRevTag(resolvedCommitId, name); - - if (commitIdsToTags.containsKey(resolvedCommitId)) { - commitIdsToTags.get(resolvedCommitId).add(datedRevTag); - } else { - commitIdsToTags.put(resolvedCommitId, newArrayList(datedRevTag)); - } - } - } catch (Exception ignored) { - error("Failed while parsing [",tagRef,"] -- ", Throwables.getStackTraceAsString(ignored)); - } - } - - for (Map.Entry> entry : commitIdsToTags.entrySet()) { - log("key [",entry.getKey(),"], tags => [",entry.getValue(),"] "); - } - - Map> commitIdsToTagNames = transformRevTagsMapToDateSortedTagNames(commitIdsToTags); - + String matchPattern = createMatchPattern(); + Map> commitIdsToTags = new JGitCommon().getCommitIdsToTags(loggerBridge, repo, tagsFlag, matchPattern); + Map> commitIdsToTagNames = new JGitCommon().transformRevTagsMapToDateSortedTagNames(commitIdsToTags); log("Created map: [",commitIdsToTagNames,"] "); return commitIdsToTagNames; - } catch (Exception e) { - log("Unable to locate tags\n[",Throwables.getStackTraceAsString(e),"]"); - } finally { - walk.release(); - } - - return Collections.emptyMap(); - } - - /** Checks if the given object id resolved to a tag object */ - private boolean isTagId(ObjectId objectId) { - return objectId.toString().startsWith("tag "); - } - - private HashMap> transformRevTagsMapToDateSortedTagNames(Map> commitIdsToTags) { - HashMap> commitIdsToTagNames = newHashMap(); - for (Map.Entry> objectIdListEntry : commitIdsToTags.entrySet()) { - List tags = objectIdListEntry.getValue(); - - List newTags = newArrayList(tags); - Collections.sort(newTags, new Comparator() { - @Override - public int compare(DatedRevTag revTag, DatedRevTag revTag2) { - return revTag2.date.compareTo(revTag.date); - } - }); - - List tagNames = Lists.transform(newTags, new Function() { - @Override - public String apply(DatedRevTag input) { - return trimFullTagName(input.tagName); - } - }); - - commitIdsToTagNames.put(objectIdListEntry.getKey(), tagNames); - } - return commitIdsToTagNames; } private String createMatchPattern() { @@ -610,11 +516,6 @@ private String createMatchPattern() { return buf.toString(); } - @VisibleForTesting - static String trimFullTagName(@NotNull String tagName) { - return tagName.replaceFirst("refs/tags/", ""); - } - private void log(Object... parts) { loggerBridge.log(parts); } diff --git a/src/main/java/pl/project13/jgit/JGitCommon.java b/src/main/java/pl/project13/jgit/JGitCommon.java index 2f22d241..e4c36074 100644 --- a/src/main/java/pl/project13/jgit/JGitCommon.java +++ b/src/main/java/pl/project13/jgit/JGitCommon.java @@ -17,20 +17,37 @@ package pl.project13.jgit; +import static com.google.common.collect.Lists.newArrayList; +import static com.google.common.collect.Maps.newHashMap; + import java.io.IOException; import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; +import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.revwalk.RevTag; import org.eclipse.jgit.revwalk.RevWalk; +import org.jetbrains.annotations.NotNull; + +import pl.project13.jgit.dummy.DatedRevTag; +import pl.project13.maven.git.log.LoggerBridge; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Predicate; +import com.google.common.base.Throwables; import com.google.common.collect.Collections2; +import com.google.common.collect.Lists; /** * @author Konrad 'ktoso' Malawski @@ -72,5 +89,108 @@ public Collection getTags(Repository repo, final ObjectId headId) throws } } } + + protected Map> getCommitIdsToTags(@NotNull LoggerBridge loggerBridge,@NotNull Repository repo, boolean tagsFlag, String matchPattern){ + Map> commitIdsToTags = newHashMap(); + + RevWalk walk = new RevWalk(repo); + try { + walk.markStart(walk.parseCommit(repo.resolve("HEAD"))); + + List tagRefs = Git.wrap(repo).tagList().call(); + Pattern regex = Pattern.compile(matchPattern); + loggerBridge.log("Tag refs [", tagRefs, "]"); + + for (Ref tagRef : tagRefs) { + walk.reset(); + String name = tagRef.getName(); + if (!regex.matcher(name).matches()) { + loggerBridge.log("Skipping tagRef with name [", name, "] as it doesn't match [", matchPattern, "]"); + continue; + } + ObjectId resolvedCommitId = repo.resolve(name); + + // TODO that's a bit of a hack... + try { + final RevTag revTag = walk.parseTag(resolvedCommitId); + ObjectId taggedCommitId = revTag.getObject().getId(); + loggerBridge.log("Resolved tag [",revTag.getTagName(),"] [",revTag.getTaggerIdent(),"], points at [",taggedCommitId,"] "); + + // sometimes a tag, may point to another tag, so we need to unpack it + while (isTagId(taggedCommitId)) { + taggedCommitId = walk.parseTag(taggedCommitId).getObject().getId(); + } + + if (commitIdsToTags.containsKey(taggedCommitId)) { + commitIdsToTags.get(taggedCommitId).add(new DatedRevTag(revTag)); + } else { + commitIdsToTags.put(taggedCommitId, newArrayList(new DatedRevTag(revTag))); + } + + } catch (IncorrectObjectTypeException ex) { + // it's an lightweight tag! (yeah, really) + if (tagsFlag) { + // --tags means "include lightweight tags" + loggerBridge.log("Including lightweight tag [", name, "]"); + + DatedRevTag datedRevTag = new DatedRevTag(resolvedCommitId, name); + + if (commitIdsToTags.containsKey(resolvedCommitId)) { + commitIdsToTags.get(resolvedCommitId).add(datedRevTag); + } else { + commitIdsToTags.put(resolvedCommitId, newArrayList(datedRevTag)); + } + } + } catch (Exception ignored) { + loggerBridge.error("Failed while parsing [",tagRef,"] -- ", Throwables.getStackTraceAsString(ignored)); + } + } + + for (Map.Entry> entry : commitIdsToTags.entrySet()) { + loggerBridge.log("key [",entry.getKey(),"], tags => [",entry.getValue(),"] "); + } + return commitIdsToTags; + } catch (Exception e) { + loggerBridge.log("Unable to locate tags\n[",Throwables.getStackTraceAsString(e),"]"); + } finally { + walk.release(); + } + return Collections.emptyMap(); + } + + /** Checks if the given object id resolved to a tag object */ + private boolean isTagId(ObjectId objectId) { + return objectId.toString().startsWith("tag "); + } + + protected HashMap> transformRevTagsMapToDateSortedTagNames(Map> commitIdsToTags) { + HashMap> commitIdsToTagNames = newHashMap(); + for (Map.Entry> objectIdListEntry : commitIdsToTags.entrySet()) { + List tags = objectIdListEntry.getValue(); + + List newTags = newArrayList(tags); + Collections.sort(newTags, new Comparator() { + @Override + public int compare(DatedRevTag revTag, DatedRevTag revTag2) { + return revTag2.date.compareTo(revTag.date); + } + }); + + List tagNames = Lists.transform(newTags, new Function() { + @Override + public String apply(DatedRevTag input) { + return trimFullTagName(input.tagName); + } + }); + + commitIdsToTagNames.put(objectIdListEntry.getKey(), tagNames); + } + return commitIdsToTagNames; + } + + @VisibleForTesting + protected String trimFullTagName(@NotNull String tagName) { + return tagName.replaceFirst("refs/tags/", ""); + } } diff --git a/src/test/java/pl/project13/jgit/DescribeCommandIntegrationTest.java b/src/test/java/pl/project13/jgit/DescribeCommandIntegrationTest.java index 686a63e9..eb5160f0 100644 --- a/src/test/java/pl/project13/jgit/DescribeCommandIntegrationTest.java +++ b/src/test/java/pl/project13/jgit/DescribeCommandIntegrationTest.java @@ -432,18 +432,6 @@ public void shouldReturnJustTheNearestTagWhenAbbrevIsZero() throws Exception { assertThat(objectId.getName()).isNotEmpty(); } - @Test - public void trimFullTagName_shouldTrimFullTagNamePrefix() throws Exception { - // given - String fullName = "refs/tags/v1.0.0"; - - // when - String simpleName = DescribeCommand.trimFullTagName(fullName); - - // then - assertThat(simpleName).isEqualTo("v1.0.0"); - } - String abbrev(@NotNull String id) { return abbrev(id, DEFAULT_ABBREV_LEN); } diff --git a/src/test/java/pl/project13/jgit/JGitCommonIntegrationTest.java b/src/test/java/pl/project13/jgit/JGitCommonIntegrationTest.java new file mode 100644 index 00000000..ff7970a5 --- /dev/null +++ b/src/test/java/pl/project13/jgit/JGitCommonIntegrationTest.java @@ -0,0 +1,37 @@ +/* + * This file is part of git-commit-id-plugin by Konrad Malawski + * + * git-commit-id-plugin is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * git-commit-id-plugin is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with git-commit-id-plugin. If not, see . + */ + +package pl.project13.jgit; + +import org.junit.Test; +import pl.project13.maven.git.GitIntegrationTest; +import static org.fest.assertions.Assertions.assertThat; + +public class JGitCommonIntegrationTest extends GitIntegrationTest { + + @Test + public void trimFullTagName_shouldTrimFullTagNamePrefix() throws Exception { + // given + String fullName = "refs/tags/v1.0.0"; + + // when + String simpleName = new JGitCommon().trimFullTagName(fullName); + + // then + assertThat(simpleName).isEqualTo("v1.0.0"); + } +} From 9dbac37c457e1c178d1d574ba2bac38adb1a5338 Mon Sep 17 00:00:00 2001 From: S L Date: Sun, 24 May 2015 16:45:45 +0200 Subject: [PATCH 4/9] First draft for https://github.com/ktoso/maven-git-commit-id-plugin/issues/54 --- .../pl/project13/jgit/DescribeCommand.java | 112 +--------- .../java/pl/project13/jgit/JGitCommon.java | 205 ++++++++++++++++-- .../project13/maven/git/GitCommitIdMojo.java | 2 + .../project13/maven/git/GitDataProvider.java | 5 + .../pl/project13/maven/git/JGitProvider.java | 22 ++ .../maven/git/NativeGitProvider.java | 19 ++ .../git/GitCommitIdMojoIntegrationTest.java | 92 ++++++++ 7 files changed, 331 insertions(+), 126 deletions(-) diff --git a/src/main/java/pl/project13/jgit/DescribeCommand.java b/src/main/java/pl/project13/jgit/DescribeCommand.java index d94255d3..db3b1346 100644 --- a/src/main/java/pl/project13/jgit/DescribeCommand.java +++ b/src/main/java/pl/project13/jgit/DescribeCommand.java @@ -49,11 +49,6 @@ import java.util.*; import java.util.regex.Pattern; -import static com.google.common.collect.Lists.newArrayList; -import static com.google.common.collect.Lists.newLinkedList; -import static com.google.common.collect.Maps.newHashMap; -import static com.google.common.collect.Sets.newHashSet; - /** * Implements git's
describe
command. * @@ -63,7 +58,7 @@ public class DescribeCommand extends GitCommand { private LoggerBridge loggerBridge; -// todo not yet implemented options: +// TODO not yet implemented options: // private boolean containsFlag = false; // private boolean allFlag = false; // private boolean tagsFlag = false; @@ -307,7 +302,7 @@ public DescribeResult call() throws GitAPIException { } // get commits, up until the nearest tag - List commits = findCommitsUntilSomeTag(repo, headCommit, tagObjectIdToName); + List commits = new JGitCommon().findCommitsUntilSomeTag(repo, headCommit, tagObjectIdToName); // if there is no tags or any tag is not on that branch then return generic describe if (foundZeroTags(tagObjectIdToName) || commits.isEmpty()) { @@ -317,7 +312,7 @@ public DescribeResult call() throws GitAPIException { // check how far away from a tag we are - int distance = distanceBetween(repo, headCommit, commits.get(0)); + int distance = new JGitCommon().distanceBetween(repo, headCommit, commits.get(0)); String tagName = tagObjectIdToName.get(commits.get(0)).iterator().next(); Pair howFarFromWhichTag = Pair.of(distance, tagName); @@ -398,102 +393,6 @@ RevCommit findHeadObjectId(@NotNull Repository repo) throws RuntimeException { } } - private List findCommitsUntilSomeTag(Repository repo, RevCommit head, @NotNull Map> tagObjectIdToName) { - RevWalk revWalk = new RevWalk(repo); - try { - revWalk.markStart(head); - - for (RevCommit commit : revWalk) { - ObjectId objId = commit.getId(); - if (tagObjectIdToName.size() > 0) { - List maybeList = tagObjectIdToName.get(objId); - if (maybeList != null && maybeList.get(0) != null) { - return Collections.singletonList(commit); - } - } - } - - return Collections.emptyList(); - } catch (Exception e) { - throw new RuntimeException("Unable to find commits until some tag", e); - } - } - - /** - * Calculates the distance (number of commits) between the given parent and child commits. - * - * @return distance (number of commits) between the given commits - * @see mdonoughe/jgit-describe/blob/master/src/org/mdonoughe/JGitDescribeTask.java - */ - private int distanceBetween(@NotNull Repository repo, @NotNull RevCommit child, @NotNull RevCommit parent) { - RevWalk revWalk = new RevWalk(repo); - - try { - revWalk.markStart(child); - - Set seena = newHashSet(); - Set seenb = newHashSet(); - Queue q = newLinkedList(); - - q.add(revWalk.parseCommit(child)); - int distance = 0; - ObjectId parentId = parent.getId(); - - while (q.size() > 0) { - RevCommit commit = q.remove(); - ObjectId commitId = commit.getId(); - - if (seena.contains(commitId)) { - continue; - } - seena.add(commitId); - - if (parentId.equals(commitId)) { - // don't consider commits that are included in this commit - seeAllParents(revWalk, commit, seenb); - // remove things we shouldn't have included - for (ObjectId oid : seenb) { - if (seena.contains(oid)) { - distance--; - } - } - seena.addAll(seenb); - continue; - } - - for (ObjectId oid : commit.getParents()) { - if (!seena.contains(oid)) { - q.add(revWalk.parseCommit(oid)); - } - } - distance++; - } - - return distance; - - } catch (Exception e) { - throw new RuntimeException(String.format("Unable to calculate distance between [%s] and [%s]", child, parent), e); - } finally { - revWalk.dispose(); - } - } - - private void seeAllParents(@NotNull RevWalk revWalk, RevCommit child, @NotNull Set seen) throws IOException { - Queue q = newLinkedList(); - q.add(child); - - while (q.size() > 0) { - RevCommit commit = q.remove(); - for (ObjectId oid : commit.getParents()) { - if (seen.contains(oid)) { - continue; - } - seen.add(oid); - q.add(revWalk.parseCommit(oid)); - } - } - } - // git commit id -> its tag (or tags) private Map> findTagObjectIds(@NotNull Repository repo, boolean tagsFlag) { String matchPattern = createMatchPattern(); @@ -519,10 +418,5 @@ private String createMatchPattern() { private void log(Object... parts) { loggerBridge.log(parts); } - - private void error(Object... parts) { - loggerBridge.error(parts); - } - } diff --git a/src/main/java/pl/project13/jgit/JGitCommon.java b/src/main/java/pl/project13/jgit/JGitCommon.java index e4c36074..6cdf3afa 100644 --- a/src/main/java/pl/project13/jgit/JGitCommon.java +++ b/src/main/java/pl/project13/jgit/JGitCommon.java @@ -25,8 +25,12 @@ import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Queue; +import java.util.Set; import java.util.regex.Pattern; import org.eclipse.jgit.api.Git; @@ -35,6 +39,7 @@ import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevTag; import org.eclipse.jgit.revwalk.RevWalk; import org.jetbrains.annotations.NotNull; @@ -49,6 +54,12 @@ import com.google.common.collect.Collections2; import com.google.common.collect.Lists; +import static com.google.common.collect.Lists.newArrayList; +import static com.google.common.collect.Lists.newLinkedList; +import static com.google.common.collect.Maps.newHashMap; +import static com.google.common.collect.Sets.newHashSet; + + /** * @author Konrad 'ktoso' Malawski */ @@ -89,8 +100,65 @@ public Collection getTags(Repository repo, final ObjectId headId) throws } } } - - protected Map> getCommitIdsToTags(@NotNull LoggerBridge loggerBridge,@NotNull Repository repo, boolean tagsFlag, String matchPattern){ + + public String getClosestTagName(@NotNull LoggerBridge loggerBridge,@NotNull Repository repo){ + Map> map = getClosestTagAsMap(loggerBridge,repo); + for(Map.Entry> entry : map.entrySet()){ + return trimFullTagName(entry.getValue().get(0).tagName); + } + return ""; + } + + public String getClosestTagCommitCount(@NotNull LoggerBridge loggerBridge,@NotNull Repository repo, RevCommit headCommit){ + HashMap> map = transformRevTagsMapToDateSortedTagNames(getClosestTagAsMap(loggerBridge,repo)); + ObjectId obj = (ObjectId) map.keySet().toArray()[0]; + + RevWalk walk = new RevWalk(repo); + RevCommit commit = walk.lookupCommit(obj); + walk.dispose(); + + int distance = distanceBetween(repo, headCommit, commit); + return String.valueOf(distance); + } + + private Map> getClosestTagAsMap(@NotNull LoggerBridge loggerBridge,@NotNull Repository repo){ + Map> mapWithClosestTagOnly = newHashMap(); + boolean includeLightweightTags = true; + String matchPattern = ".*"; + Map> commitIdsToTags = getCommitIdsToTags(loggerBridge,repo,includeLightweightTags,matchPattern); + LinkedHashMap> sortedCommitIdsToTags = sortByDatedRevTag(commitIdsToTags); + + for(Map.Entry> entry: sortedCommitIdsToTags.entrySet()){ + mapWithClosestTagOnly.put(entry.getKey(), entry.getValue()); + break; + } + + return mapWithClosestTagOnly; + } + + private LinkedHashMap> sortByDatedRevTag(Map> map) { + List>> list = new LinkedList>>(map.entrySet()); + + Collections.sort(list, new Comparator>>() { + public int compare(Map.Entry> m1, Map.Entry> m2) { + // we need to sort the DatedRevTags to a commit first, otherwise we may get problems when we have two tags for the same commit + Collections.sort(m1.getValue(), datedRevTagComparator()); + Collections.sort(m2.getValue(), datedRevTagComparator()); + + DatedRevTag datedRevTag1 = m1.getValue().get(0); + DatedRevTag datedRevTag2 = m2.getValue().get(0); + return datedRevTagComparator().compare(datedRevTag1,datedRevTag2); + } + }); + + LinkedHashMap> result = new LinkedHashMap>(); + for (Map.Entry> entry : list) { + result.put(entry.getKey(), entry.getValue()); + } + return result; + } + + protected Map> getCommitIdsToTags(@NotNull LoggerBridge loggerBridge,@NotNull Repository repo, boolean includeLightweightTags, String matchPattern){ Map> commitIdsToTags = newHashMap(); RevWalk walk = new RevWalk(repo); @@ -129,7 +197,7 @@ protected Map> getCommitIdsToTags(@NotNull LoggerBri } catch (IncorrectObjectTypeException ex) { // it's an lightweight tag! (yeah, really) - if (tagsFlag) { + if (includeLightweightTags) { // --tags means "include lightweight tags" loggerBridge.log("Including lightweight tag [", name, "]"); @@ -166,31 +234,134 @@ private boolean isTagId(ObjectId objectId) { protected HashMap> transformRevTagsMapToDateSortedTagNames(Map> commitIdsToTags) { HashMap> commitIdsToTagNames = newHashMap(); for (Map.Entry> objectIdListEntry : commitIdsToTags.entrySet()) { - List tags = objectIdListEntry.getValue(); + List tagNames = transformRevTagsMapEntryToDateSortedTagNames(objectIdListEntry); + + commitIdsToTagNames.put(objectIdListEntry.getKey(), tagNames); + } + return commitIdsToTagNames; + } + + private List transformRevTagsMapEntryToDateSortedTagNames(Map.Entry> objectIdListEntry) { + List tags = objectIdListEntry.getValue(); + + List newTags = newArrayList(tags); + Collections.sort(newTags, datedRevTagComparator()); - List newTags = newArrayList(tags); - Collections.sort(newTags, new Comparator() { + List tagNames = Lists.transform(newTags, new Function() { + @Override + public String apply(DatedRevTag input) { + return trimFullTagName(input.tagName); + } + }); + return tagNames; + } + + private Comparator datedRevTagComparator() { + return new Comparator() { @Override public int compare(DatedRevTag revTag, DatedRevTag revTag2) { return revTag2.date.compareTo(revTag.date); } - }); + }; + } - List tagNames = Lists.transform(newTags, new Function() { - @Override - public String apply(DatedRevTag input) { - return trimFullTagName(input.tagName); + @VisibleForTesting + protected String trimFullTagName(@NotNull String tagName) { + return tagName.replaceFirst("refs/tags/", ""); + } + + public List findCommitsUntilSomeTag(Repository repo, RevCommit head, @NotNull Map> tagObjectIdToName) { + RevWalk revWalk = new RevWalk(repo); + try { + revWalk.markStart(head); + + for (RevCommit commit : revWalk) { + ObjectId objId = commit.getId(); + if (tagObjectIdToName.size() > 0) { + List maybeList = tagObjectIdToName.get(objId); + if (maybeList != null && maybeList.get(0) != null) { + return Collections.singletonList(commit); + } } - }); + } - commitIdsToTagNames.put(objectIdListEntry.getKey(), tagNames); + return Collections.emptyList(); + } catch (Exception e) { + throw new RuntimeException("Unable to find commits until some tag", e); } - return commitIdsToTagNames; } - @VisibleForTesting - protected String trimFullTagName(@NotNull String tagName) { - return tagName.replaceFirst("refs/tags/", ""); + /** + * Calculates the distance (number of commits) between the given parent and child commits. + * + * @return distance (number of commits) between the given commits + * @see mdonoughe/jgit-describe/blob/master/src/org/mdonoughe/JGitDescribeTask.java + */ + protected int distanceBetween(@NotNull Repository repo, @NotNull RevCommit child, @NotNull RevCommit parent) { + RevWalk revWalk = new RevWalk(repo); + + try { + revWalk.markStart(child); + + Set seena = newHashSet(); + Set seenb = newHashSet(); + Queue q = newLinkedList(); + + q.add(revWalk.parseCommit(child)); + int distance = 0; + ObjectId parentId = parent.getId(); + + while (q.size() > 0) { + RevCommit commit = q.remove(); + ObjectId commitId = commit.getId(); + + if (seena.contains(commitId)) { + continue; + } + seena.add(commitId); + + if (parentId.equals(commitId)) { + // don't consider commits that are included in this commit + seeAllParents(revWalk, commit, seenb); + // remove things we shouldn't have included + for (ObjectId oid : seenb) { + if (seena.contains(oid)) { + distance--; + } + } + seena.addAll(seenb); + continue; + } + + for (ObjectId oid : commit.getParents()) { + if (!seena.contains(oid)) { + q.add(revWalk.parseCommit(oid)); + } + } + distance++; + } + return distance; + } catch (Exception e) { + throw new RuntimeException(String.format("Unable to calculate distance between [%s] and [%s]", child, parent), e); + } finally { + revWalk.dispose(); + } + } + + private void seeAllParents(@NotNull RevWalk revWalk, RevCommit child, @NotNull Set seen) throws IOException { + Queue q = newLinkedList(); + q.add(child); + + while (q.size() > 0) { + RevCommit commit = q.remove(); + for (ObjectId oid : commit.getParents()) { + if (seen.contains(oid)) { + continue; + } + seen.add(oid); + q.add(revWalk.parseCommit(oid)); + } + } } } diff --git a/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java b/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java index 506ee417..ac017a00 100644 --- a/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java +++ b/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java @@ -82,6 +82,8 @@ public class GitCommitIdMojo extends AbstractMojo { public static final String COMMIT_TIME = "commit.time"; public static final String REMOTE_ORIGIN_URL = "remote.origin.url"; public static final String TAGS = "tags"; + public static final String CLOSEST_TAG_NAME = "closest.tag.name"; + public static final String CLOSEST_TAG_COMMIT_COUNT = "closest.tag.commit.count"; /** * The maven project. diff --git a/src/main/java/pl/project13/maven/git/GitDataProvider.java b/src/main/java/pl/project13/maven/git/GitDataProvider.java index f21f04d9..ce385937 100644 --- a/src/main/java/pl/project13/maven/git/GitDataProvider.java +++ b/src/main/java/pl/project13/maven/git/GitDataProvider.java @@ -69,6 +69,8 @@ public GitDataProvider setDateFormat(String dateFormat) { protected abstract String getCommitTime(); protected abstract String getRemoteOriginUrl() throws MojoExecutionException; protected abstract String getTags() throws MojoExecutionException; + protected abstract String getClosestTagName() throws MojoExecutionException; + protected abstract String getClosestTagCommitCount() throws MojoExecutionException; protected abstract void finalCleanUp(); public void loadGitData(@NotNull Properties properties) throws IOException, MojoExecutionException{ @@ -107,6 +109,9 @@ public void loadGitData(@NotNull Properties properties) throws IOException, Mojo // put(properties, GitCommitIdMojo.TAGS, getTags()); + + put(properties,GitCommitIdMojo.CLOSEST_TAG_NAME, getClosestTagName()); + put(properties,GitCommitIdMojo.CLOSEST_TAG_COMMIT_COUNT, getClosestTagCommitCount()); } finally { finalCleanUp(); } diff --git a/src/main/java/pl/project13/maven/git/JGitProvider.java b/src/main/java/pl/project13/maven/git/JGitProvider.java index 07159904..2b0913ef 100644 --- a/src/main/java/pl/project13/maven/git/JGitProvider.java +++ b/src/main/java/pl/project13/maven/git/JGitProvider.java @@ -187,6 +187,28 @@ protected String getTags() throws MojoExecutionException { } } + @Override + protected String getClosestTagName() throws MojoExecutionException { + Repository repo = getGitRepository(); + try { + return new JGitCommon().getClosestTagName(loggerBridge,repo); + } catch (Throwable t) { + // could not find any tags to describe + } + return ""; + } + + @Override + protected String getClosestTagCommitCount() throws MojoExecutionException { + Repository repo = getGitRepository(); + try { + return new JGitCommon().getClosestTagCommitCount(loggerBridge,repo,headCommit); + } catch (Throwable t) { + // could not find any tags to describe + } + return ""; + } + @Override protected void finalCleanUp() { if (revWalk != null) { diff --git a/src/main/java/pl/project13/maven/git/NativeGitProvider.java b/src/main/java/pl/project13/maven/git/NativeGitProvider.java index 3cfdd6e9..2ee3e5a9 100644 --- a/src/main/java/pl/project13/maven/git/NativeGitProvider.java +++ b/src/main/java/pl/project13/maven/git/NativeGitProvider.java @@ -204,6 +204,25 @@ protected String getTags() { protected String getRemoteOriginUrl() throws MojoExecutionException { return getOriginRemote(canonical); } + + @Override + protected String getClosestTagName(){ + try { + return runGitCommand(canonical, "describe --abbrev=0 --tags"); + } catch (NativeCommandException ignore) { + // could not find any tags to describe + } + return ""; + } + + @Override + protected String getClosestTagCommitCount(){ + String closestTagName = getClosestTagName(); + if(closestTagName != null && !closestTagName.trim().isEmpty()){ + return runQuietGitCommand(canonical, "rev-list "+closestTagName+"..HEAD --count"); + } + return ""; + } @Override protected void finalCleanUp() { diff --git a/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java b/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java index b08a8c3f..03ae115c 100644 --- a/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java +++ b/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java @@ -657,6 +657,95 @@ public void runGitDescribeWithMatchOption(boolean useNativeGit) throws Exception } } + @Test + @Parameters(method = "useNativeGit") + public void shouldGenerateClosestTagInformationWhenOnATag(boolean useNativeGit) throws Exception { + // given + mavenSandbox.withParentProject("my-pom-project", "pom") + .withChildProject("my-jar-module", "jar") + .withGitRepoInChild(AvailableGitTestRepo.ON_A_TAG) + .create(CleanUp.CLEANUP_FIRST); + + MavenProject targetProject = mavenSandbox.getChildProject(); + + setProjectToExecuteMojoIn(targetProject); + GitDescribeConfig gitDescribeConfig = createGitDescribeConfig(false, 7); + gitDescribeConfig.setDirty("-dirty"); // checking if dirty works as expected + + alterMojoSettings("gitDescribe", gitDescribeConfig); + alterMojoSettings("useNativeGit", useNativeGit); + + // when + mojo.execute(); + + // then + assertThat(targetProject.getProperties().stringPropertyNames()).contains("git.closest.tag.name"); + assertThat(targetProject.getProperties().getProperty("git.closest.tag.name")).isEqualTo("v1.0.0"); + + assertThat(targetProject.getProperties().stringPropertyNames()).contains("git.closest.tag.commit.count"); + assertThat(targetProject.getProperties().getProperty("git.closest.tag.commit.count")).isEqualTo("0"); + } + + @Test + @Parameters(method = "useNativeGit") + public void shouldGenerateClosestTagInformationWhenOnATagAndDirty(boolean useNativeGit) throws Exception { + // given + mavenSandbox.withParentProject("my-pom-project", "pom") + .withChildProject("my-jar-module", "jar") + .withGitRepoInChild(AvailableGitTestRepo.ON_A_TAG_DIRTY) + .create(CleanUp.CLEANUP_FIRST); + MavenProject targetProject = mavenSandbox.getChildProject(); + + setProjectToExecuteMojoIn(targetProject); + + GitDescribeConfig gitDescribeConfig = createGitDescribeConfig(true, 7); + String dirtySuffix = "-dirtyTest"; + gitDescribeConfig.setDirty(dirtySuffix); + alterMojoSettings("gitDescribe", gitDescribeConfig); + alterMojoSettings("useNativeGit", useNativeGit); + + // when + mojo.execute(); + + // then + assertThat(targetProject.getProperties().stringPropertyNames()).contains("git.closest.tag.name"); + assertThat(targetProject.getProperties().getProperty("git.closest.tag.name")).isEqualTo("v1.0.0"); + + assertThat(targetProject.getProperties().stringPropertyNames()).contains("git.closest.tag.commit.count"); + assertThat(targetProject.getProperties().getProperty("git.closest.tag.commit.count")).isEqualTo("0"); + } + + + @Test + @Parameters(method = "useNativeGit") + public void shouldGenerateClosestTagInformationWhenCommitHasTwoTags(boolean useNativeGit) throws Exception { + // given + mavenSandbox + .withParentProject("my-jar-project", "jar") + .withNoChildProject() + .withGitRepoInParent(AvailableGitTestRepo.WITH_COMMIT_THAT_HAS_TWO_TAGS) + .create(CleanUp.CLEANUP_FIRST); + + git("my-jar-project").reset().setMode(ResetCommand.ResetType.HARD).setRef("d37a598").call(); + + MavenProject targetProject = mavenSandbox.getParentProject(); + setProjectToExecuteMojoIn(targetProject); + + alterMojoSettings("gitDescribe", null); + alterMojoSettings("useNativeGit", useNativeGit); + + // when + mojo.execute(); + + // then + // AvailableGitTestRepo.WITH_COMMIT_THAT_HAS_TWO_TAGS ==> Where the newest-tag was created latest + assertThat(targetProject.getProperties().stringPropertyNames()).contains("git.closest.tag.name"); + assertThat(targetProject.getProperties().getProperty("git.closest.tag.name")).isEqualTo("newest-tag"); + + assertThat(targetProject.getProperties().stringPropertyNames()).contains("git.closest.tag.commit.count"); + assertThat(targetProject.getProperties().getProperty("git.closest.tag.commit.count")).isEqualTo("0"); + } + private GitDescribeConfig createGitDescribeConfig(boolean forceLongFormat, int abbrev) { GitDescribeConfig gitDescribeConfig = new GitDescribeConfig(); gitDescribeConfig.setTags(true); @@ -685,5 +774,8 @@ private void assertGitPropertiesPresentInProject(Properties properties) { assertThat(properties).satisfies(new ContainsKeyCondition("git.commit.message.short")); assertThat(properties).satisfies(new ContainsKeyCondition("git.commit.time")); assertThat(properties).satisfies(new ContainsKeyCondition("git.remote.origin.url")); + assertThat(properties).satisfies(new ContainsKeyCondition("git.closest.tag.name")); + assertThat(properties).satisfies(new ContainsKeyCondition("git.closest.tag.commit.count")); + } } From 81aab5cccfa8c2b099c5ebf08cd365196d6c8369 Mon Sep 17 00:00:00 2001 From: S L Date: Sun, 24 May 2015 16:54:26 +0200 Subject: [PATCH 5/9] adjust license header --- .../pl/project13/jgit/DescribeCommand.java | 2 +- .../pl/project13/jgit/DescribeResult.java | 2 +- .../java/pl/project13/jgit/JGitCommon.java | 2 +- .../pl/project13/jgit/dummy/DatedRevTag.java | 17 +++++++++++++++++ .../project13/maven/git/GitCommitIdMojo.java | 2 +- .../project13/maven/git/GitDataProvider.java | 17 +++++++++++++++++ .../maven/git/GitDescribeConfig.java | 2 +- .../pl/project13/maven/git/GitDirLocator.java | 2 +- .../maven/git/GitRepositoryState.java | 3 +-- .../pl/project13/maven/git/JGitProvider.java | 17 +++++++++++++++++ .../maven/git/NativeGitProvider.java | 16 ++++++++++++++++ .../project13/maven/git/log/LoggerBridge.java | 2 +- .../maven/git/log/MavenLoggerBridge.java | 3 +-- .../maven/git/log/StdOutLoggerBridge.java | 2 +- .../pl/project13/maven/git/util/Pair.java | 2 +- .../maven/git/util/PropertyManager.java | 17 +++++++++++++++++ .../DescribeCommandAbbrevIntegrationTest.java | 19 +------------------ .../jgit/DescribeCommandIntegrationTest.java | 2 +- .../jgit/DescribeCommandOptionsTest.java | 19 +------------------ .../DescribeCommandTagsIntegrationTest.java | 19 +------------------ .../pl/project13/jgit/DescribeResultTest.java | 2 +- .../jgit/JGitCommonIntegrationTest.java | 2 +- .../maven/git/AvailableGitTestRepo.java | 2 +- .../maven/git/ContainsKeyCondition.java | 2 +- .../maven/git/DoesNotContainKeyCondition.java | 2 +- .../maven/git/FileSystemMavenSandbox.java | 4 ++-- .../git/GitCommitIdMojoDirtyFilesTest.java | 2 +- .../git/GitCommitIdMojoIntegrationTest.java | 2 +- .../maven/git/GitCommitIdMojoTest.java | 2 +- .../maven/git/GitDirLocatorTest.java | 2 +- .../maven/git/GitIntegrationTest.java | 2 +- .../maven/git/GitSubmodulesTest.java | 19 +------------------ .../maven/git/NaivePerformanceTest.java | 2 +- .../maven/git/NativeAndJGitProviderTest.java | 2 +- .../maven/git/log/MavenLoggerBridgeTest.java | 17 +++++++++++++++++ .../maven/git/log/StdOutLoggerBridgeTest.java | 17 +++++++++++++++++ .../project13/test/utils/AssertException.java | 4 ++-- 37 files changed, 150 insertions(+), 102 deletions(-) diff --git a/src/main/java/pl/project13/jgit/DescribeCommand.java b/src/main/java/pl/project13/jgit/DescribeCommand.java index db3b1346..86a44794 100644 --- a/src/main/java/pl/project13/jgit/DescribeCommand.java +++ b/src/main/java/pl/project13/jgit/DescribeCommand.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/pl/project13/jgit/DescribeResult.java b/src/main/java/pl/project13/jgit/DescribeResult.java index 169ec604..ba3f0647 100644 --- a/src/main/java/pl/project13/jgit/DescribeResult.java +++ b/src/main/java/pl/project13/jgit/DescribeResult.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/pl/project13/jgit/JGitCommon.java b/src/main/java/pl/project13/jgit/JGitCommon.java index 6cdf3afa..cbe245ed 100644 --- a/src/main/java/pl/project13/jgit/JGitCommon.java +++ b/src/main/java/pl/project13/jgit/JGitCommon.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/pl/project13/jgit/dummy/DatedRevTag.java b/src/main/java/pl/project13/jgit/dummy/DatedRevTag.java index 7beb7add..9f532b84 100644 --- a/src/main/java/pl/project13/jgit/dummy/DatedRevTag.java +++ b/src/main/java/pl/project13/jgit/dummy/DatedRevTag.java @@ -1,3 +1,20 @@ +/* + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski + * + * git-commit-id-plugin is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * git-commit-id-plugin is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with git-commit-id-plugin. If not, see . + */ + package pl.project13.jgit.dummy; import org.eclipse.jgit.lib.AnyObjectId; diff --git a/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java b/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java index ac017a00..a011ecf7 100644 --- a/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java +++ b/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/pl/project13/maven/git/GitDataProvider.java b/src/main/java/pl/project13/maven/git/GitDataProvider.java index ce385937..b5cee9ac 100644 --- a/src/main/java/pl/project13/maven/git/GitDataProvider.java +++ b/src/main/java/pl/project13/maven/git/GitDataProvider.java @@ -1,3 +1,20 @@ +/* + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski + * + * git-commit-id-plugin is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * git-commit-id-plugin is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with git-commit-id-plugin. If not, see . + */ + package pl.project13.maven.git; import org.apache.maven.plugin.MojoExecutionException; diff --git a/src/main/java/pl/project13/maven/git/GitDescribeConfig.java b/src/main/java/pl/project13/maven/git/GitDescribeConfig.java index c12d3fb6..34bf4581 100644 --- a/src/main/java/pl/project13/maven/git/GitDescribeConfig.java +++ b/src/main/java/pl/project13/maven/git/GitDescribeConfig.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/pl/project13/maven/git/GitDirLocator.java b/src/main/java/pl/project13/maven/git/GitDirLocator.java index 03eb6f6b..b64233e6 100644 --- a/src/main/java/pl/project13/maven/git/GitDirLocator.java +++ b/src/main/java/pl/project13/maven/git/GitDirLocator.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/pl/project13/maven/git/GitRepositoryState.java b/src/main/java/pl/project13/maven/git/GitRepositoryState.java index f981ad41..fb9b1d94 100644 --- a/src/main/java/pl/project13/maven/git/GitRepositoryState.java +++ b/src/main/java/pl/project13/maven/git/GitRepositoryState.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -14,7 +14,6 @@ * You should have received a copy of the GNU Lesser General Public License * along with git-commit-id-plugin. If not, see . */ - package pl.project13.maven.git; //import org.codehaus.jackson.annotate.JsonWriteNullProperties; diff --git a/src/main/java/pl/project13/maven/git/JGitProvider.java b/src/main/java/pl/project13/maven/git/JGitProvider.java index 2b0913ef..572d4a74 100644 --- a/src/main/java/pl/project13/maven/git/JGitProvider.java +++ b/src/main/java/pl/project13/maven/git/JGitProvider.java @@ -1,3 +1,20 @@ +/* + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski + * + * git-commit-id-plugin is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * git-commit-id-plugin is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with git-commit-id-plugin. If not, see . + */ + package pl.project13.maven.git; import com.google.common.annotations.VisibleForTesting; diff --git a/src/main/java/pl/project13/maven/git/NativeGitProvider.java b/src/main/java/pl/project13/maven/git/NativeGitProvider.java index 2ee3e5a9..0ffd1ebb 100644 --- a/src/main/java/pl/project13/maven/git/NativeGitProvider.java +++ b/src/main/java/pl/project13/maven/git/NativeGitProvider.java @@ -1,3 +1,19 @@ +/* + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski + * + * git-commit-id-plugin is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * git-commit-id-plugin is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with git-commit-id-plugin. If not, see . + */ package pl.project13.maven.git; import static java.lang.String.format; diff --git a/src/main/java/pl/project13/maven/git/log/LoggerBridge.java b/src/main/java/pl/project13/maven/git/log/LoggerBridge.java index 403bee67..f205ecfc 100644 --- a/src/main/java/pl/project13/maven/git/log/LoggerBridge.java +++ b/src/main/java/pl/project13/maven/git/log/LoggerBridge.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/pl/project13/maven/git/log/MavenLoggerBridge.java b/src/main/java/pl/project13/maven/git/log/MavenLoggerBridge.java index bcb9a37f..bb5c3661 100644 --- a/src/main/java/pl/project13/maven/git/log/MavenLoggerBridge.java +++ b/src/main/java/pl/project13/maven/git/log/MavenLoggerBridge.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -15,7 +15,6 @@ * along with git-commit-id-plugin. If not, see . */ - package pl.project13.maven.git.log; import java.util.Properties; diff --git a/src/main/java/pl/project13/maven/git/log/StdOutLoggerBridge.java b/src/main/java/pl/project13/maven/git/log/StdOutLoggerBridge.java index b8fafb46..8d813905 100644 --- a/src/main/java/pl/project13/maven/git/log/StdOutLoggerBridge.java +++ b/src/main/java/pl/project13/maven/git/log/StdOutLoggerBridge.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/pl/project13/maven/git/util/Pair.java b/src/main/java/pl/project13/maven/git/util/Pair.java index fe0cbf18..1af4ab1e 100644 --- a/src/main/java/pl/project13/maven/git/util/Pair.java +++ b/src/main/java/pl/project13/maven/git/util/Pair.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/main/java/pl/project13/maven/git/util/PropertyManager.java b/src/main/java/pl/project13/maven/git/util/PropertyManager.java index 34314ebc..b1289356 100644 --- a/src/main/java/pl/project13/maven/git/util/PropertyManager.java +++ b/src/main/java/pl/project13/maven/git/util/PropertyManager.java @@ -1,3 +1,20 @@ +/* + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski + * + * git-commit-id-plugin is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * git-commit-id-plugin is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with git-commit-id-plugin. If not, see . + */ + package pl.project13.maven.git.util; import java.util.Properties; diff --git a/src/test/java/pl/project13/jgit/DescribeCommandAbbrevIntegrationTest.java b/src/test/java/pl/project13/jgit/DescribeCommandAbbrevIntegrationTest.java index 8e06e4d1..19644530 100644 --- a/src/test/java/pl/project13/jgit/DescribeCommandAbbrevIntegrationTest.java +++ b/src/test/java/pl/project13/jgit/DescribeCommandAbbrevIntegrationTest.java @@ -1,22 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski - * - * git-commit-id-plugin is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * git-commit-id-plugin is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with git-commit-id-plugin. If not, see . - */ - -/* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/jgit/DescribeCommandIntegrationTest.java b/src/test/java/pl/project13/jgit/DescribeCommandIntegrationTest.java index eb5160f0..4a41391b 100644 --- a/src/test/java/pl/project13/jgit/DescribeCommandIntegrationTest.java +++ b/src/test/java/pl/project13/jgit/DescribeCommandIntegrationTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/jgit/DescribeCommandOptionsTest.java b/src/test/java/pl/project13/jgit/DescribeCommandOptionsTest.java index 67b313c3..9fe0e90d 100644 --- a/src/test/java/pl/project13/jgit/DescribeCommandOptionsTest.java +++ b/src/test/java/pl/project13/jgit/DescribeCommandOptionsTest.java @@ -1,22 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski - * - * git-commit-id-plugin is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * git-commit-id-plugin is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with git-commit-id-plugin. If not, see . - */ - -/* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/jgit/DescribeCommandTagsIntegrationTest.java b/src/test/java/pl/project13/jgit/DescribeCommandTagsIntegrationTest.java index c9309804..50fa3473 100644 --- a/src/test/java/pl/project13/jgit/DescribeCommandTagsIntegrationTest.java +++ b/src/test/java/pl/project13/jgit/DescribeCommandTagsIntegrationTest.java @@ -1,22 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski - * - * git-commit-id-plugin is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * git-commit-id-plugin is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with git-commit-id-plugin. If not, see . - */ - -/* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/jgit/DescribeResultTest.java b/src/test/java/pl/project13/jgit/DescribeResultTest.java index 974e5a09..060c70ea 100644 --- a/src/test/java/pl/project13/jgit/DescribeResultTest.java +++ b/src/test/java/pl/project13/jgit/DescribeResultTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/jgit/JGitCommonIntegrationTest.java b/src/test/java/pl/project13/jgit/JGitCommonIntegrationTest.java index ff7970a5..cb88b636 100644 --- a/src/test/java/pl/project13/jgit/JGitCommonIntegrationTest.java +++ b/src/test/java/pl/project13/jgit/JGitCommonIntegrationTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/AvailableGitTestRepo.java b/src/test/java/pl/project13/maven/git/AvailableGitTestRepo.java index 7c07b05b..06149c6f 100644 --- a/src/test/java/pl/project13/maven/git/AvailableGitTestRepo.java +++ b/src/test/java/pl/project13/maven/git/AvailableGitTestRepo.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/ContainsKeyCondition.java b/src/test/java/pl/project13/maven/git/ContainsKeyCondition.java index 45f4ad88..252fbe89 100644 --- a/src/test/java/pl/project13/maven/git/ContainsKeyCondition.java +++ b/src/test/java/pl/project13/maven/git/ContainsKeyCondition.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/DoesNotContainKeyCondition.java b/src/test/java/pl/project13/maven/git/DoesNotContainKeyCondition.java index ae198c78..fd149280 100644 --- a/src/test/java/pl/project13/maven/git/DoesNotContainKeyCondition.java +++ b/src/test/java/pl/project13/maven/git/DoesNotContainKeyCondition.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/FileSystemMavenSandbox.java b/src/test/java/pl/project13/maven/git/FileSystemMavenSandbox.java index 48130abb..b5e1120b 100644 --- a/src/test/java/pl/project13/maven/git/FileSystemMavenSandbox.java +++ b/src/test/java/pl/project13/maven/git/FileSystemMavenSandbox.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -186,4 +186,4 @@ public String toString() { ", rootSandboxPath='" + rootSandboxPath + '\'' + '}'; } -} \ No newline at end of file +} diff --git a/src/test/java/pl/project13/maven/git/GitCommitIdMojoDirtyFilesTest.java b/src/test/java/pl/project13/maven/git/GitCommitIdMojoDirtyFilesTest.java index c96c12e2..9f58a821 100644 --- a/src/test/java/pl/project13/maven/git/GitCommitIdMojoDirtyFilesTest.java +++ b/src/test/java/pl/project13/maven/git/GitCommitIdMojoDirtyFilesTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java b/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java index 03ae115c..a7f60756 100644 --- a/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java +++ b/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java b/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java index 8d9bb93a..4524b8bb 100644 --- a/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java +++ b/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/GitDirLocatorTest.java b/src/test/java/pl/project13/maven/git/GitDirLocatorTest.java index 6799dd61..a2b913c4 100644 --- a/src/test/java/pl/project13/maven/git/GitDirLocatorTest.java +++ b/src/test/java/pl/project13/maven/git/GitDirLocatorTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/GitIntegrationTest.java b/src/test/java/pl/project13/maven/git/GitIntegrationTest.java index d6753b1e..f048418d 100644 --- a/src/test/java/pl/project13/maven/git/GitIntegrationTest.java +++ b/src/test/java/pl/project13/maven/git/GitIntegrationTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/GitSubmodulesTest.java b/src/test/java/pl/project13/maven/git/GitSubmodulesTest.java index 84802e7d..8d2dff97 100644 --- a/src/test/java/pl/project13/maven/git/GitSubmodulesTest.java +++ b/src/test/java/pl/project13/maven/git/GitSubmodulesTest.java @@ -1,22 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski - * - * git-commit-id-plugin is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * git-commit-id-plugin is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with git-commit-id-plugin. If not, see . - */ - -/* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/NaivePerformanceTest.java b/src/test/java/pl/project13/maven/git/NaivePerformanceTest.java index e8fadb34..f86c069c 100644 --- a/src/test/java/pl/project13/maven/git/NaivePerformanceTest.java +++ b/src/test/java/pl/project13/maven/git/NaivePerformanceTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/NativeAndJGitProviderTest.java b/src/test/java/pl/project13/maven/git/NativeAndJGitProviderTest.java index d2f7cf97..f04b5fdb 100644 --- a/src/test/java/pl/project13/maven/git/NativeAndJGitProviderTest.java +++ b/src/test/java/pl/project13/maven/git/NativeAndJGitProviderTest.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by diff --git a/src/test/java/pl/project13/maven/git/log/MavenLoggerBridgeTest.java b/src/test/java/pl/project13/maven/git/log/MavenLoggerBridgeTest.java index 3234a66d..0603f010 100644 --- a/src/test/java/pl/project13/maven/git/log/MavenLoggerBridgeTest.java +++ b/src/test/java/pl/project13/maven/git/log/MavenLoggerBridgeTest.java @@ -1,3 +1,20 @@ +/* + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski + * + * git-commit-id-plugin is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * git-commit-id-plugin is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with git-commit-id-plugin. If not, see . + */ + package pl.project13.maven.git.log; import org.junit.Test; diff --git a/src/test/java/pl/project13/maven/git/log/StdOutLoggerBridgeTest.java b/src/test/java/pl/project13/maven/git/log/StdOutLoggerBridgeTest.java index 85a45990..952094d8 100644 --- a/src/test/java/pl/project13/maven/git/log/StdOutLoggerBridgeTest.java +++ b/src/test/java/pl/project13/maven/git/log/StdOutLoggerBridgeTest.java @@ -1,3 +1,20 @@ +/* + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski + * + * git-commit-id-plugin is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * git-commit-id-plugin is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with git-commit-id-plugin. If not, see . + */ + package pl.project13.maven.git.log; import org.junit.Test; diff --git a/src/test/java/pl/project13/test/utils/AssertException.java b/src/test/java/pl/project13/test/utils/AssertException.java index 9ff3b3a2..bffc4e26 100644 --- a/src/test/java/pl/project13/test/utils/AssertException.java +++ b/src/test/java/pl/project13/test/utils/AssertException.java @@ -1,5 +1,5 @@ /* - * This file is part of git-commit-id-plugin by Konrad Malawski + * This file is part of git-commit-id-plugin by Konrad 'ktoso' Malawski * * git-commit-id-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -145,4 +145,4 @@ private static void failWithExpectedButGotNothing(@NotNull Class expected) { Assert.fail(String.format("Expected [%s] to be thrown but no exception was thrown.", expected.getSimpleName())); } -} \ No newline at end of file +} From f3a80e74c9b9ca6acbe1f79403f31c7a41d1042b Mon Sep 17 00:00:00 2001 From: S L Date: Sun, 24 May 2015 17:11:13 +0200 Subject: [PATCH 6/9] adding Properties git.closest.tag.name, git.closest.tag.commit.count and git.build.version to the README --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6cb96c27..2dab21fb 100644 --- a/README.md +++ b/README.md @@ -306,11 +306,14 @@ git.commit.user.email=${git.commit.user.email} git.commit.message.full=${git.commit.message.full} git.commit.message.short=${git.commit.message.short} git.commit.time=${git.commit.time} +git.closest.tag.name=${git.closest.tag.name} +git.closest.tag.commit.count=${git.closest.tag.commit.count} git.build.user.name=${git.build.user.name} git.build.user.email=${git.build.user.email} git.build.time=${git.build.time} git.build.host=${git.build.host} +git.build.version=${git.build.version} ``` The `git` prefix may be configured in the plugin declaration above. @@ -341,11 +344,14 @@ Start out with with adding the above steps to your project, next paste this **gi + + + ``` @@ -378,12 +384,15 @@ public class GitRepositoryState { String commitMessageFull; // =${git.commit.message.full} String commitMessageShort; // =${git.commit.message.short} String commitTime; // =${git.commit.time} + String closestTagName; // =${git.closest.tag.name} + String closestTagCommitCount; // =${git.closest.tag.commit.count} String buildUserName; // =${git.build.user.name} String buildUserEmail; // =${git.build.user.email} String buildTime; // =${git.build.time} String buildHost; // =${git.build.host} - + String buildVersion // =${git.build.version} + public GitRepositoryState() { } /* Generate setters and getters here */ @@ -438,11 +447,14 @@ In the end *this is what this service would return*: + added license etc", "commitMessageShort" : "releasing my fun plugin :-)", "commitTime" : "06.01.1970 @ 16:16:26 CET", + "closestTagName" : "v2.1.0", + "closestTagCommitCount" : "2", "buildUserName" : "Konrad Malawski", "buildUserEmail" : "konrad.malawski@java.pl", "buildTime" : "06.01.1970 @ 16:17:53 CET", - "buildHost" : "github.com" + "buildHost" : "github.com", + "buildVersion" : "v2.1.0-SNAPSHOT" } ``` @@ -503,11 +515,14 @@ public GitRepositoryState(Properties properties) this.commitMessageFull = properties.get("git.commit.message.full").toString(); this.commitMessageShort = properties.get("git.commit.message.short").toString(); this.commitTime = properties.get("git.commit.time").toString(); + this.closestTagName = properties.get("git.closest.tag.name").toString(); + this.closestTagCommitCount = properties.get("git.closest.tag.commit.count").toString(); this.buildUserName = properties.get("git.build.user.name").toString(); this.buildUserEmail = properties.get("git.build.user.email").toString(); this.buildTime = properties.get("git.build.time").toString(); this.buildHost = properties.get("git.build.host").toString(); + this.buildVersion = properties.get("git.build.version").toString(); } ``` From 877afe0ee6e853c04118d4c0ed90c17b548ea122 Mon Sep 17 00:00:00 2001 From: S L Date: Mon, 25 May 2015 09:43:17 +0200 Subject: [PATCH 7/9] Remove all @author tags, to make feel collective ownership about the code, also remove unused imports --- src/main/java/pl/project13/jgit/DescribeCommand.java | 9 --------- src/main/java/pl/project13/jgit/JGitCommon.java | 4 ---- .../java/pl/project13/maven/git/GitCommitIdMojo.java | 1 - .../java/pl/project13/maven/git/GitDataProvider.java | 3 --- .../java/pl/project13/maven/git/GitDirLocator.java | 1 - .../pl/project13/maven/git/GitRepositoryState.java | 2 -- src/main/java/pl/project13/maven/git/JGitProvider.java | 7 ------- .../pl/project13/maven/git/FileSystemMavenSandbox.java | 1 - .../maven/git/GitCommitIdMojoDirtyFilesTest.java | 10 +--------- .../pl/project13/maven/git/GitCommitIdMojoTest.java | 1 - .../java/pl/project13/test/utils/AssertException.java | 1 - 11 files changed, 1 insertion(+), 39 deletions(-) diff --git a/src/main/java/pl/project13/jgit/DescribeCommand.java b/src/main/java/pl/project13/jgit/DescribeCommand.java index 86a44794..9b349e2d 100644 --- a/src/main/java/pl/project13/jgit/DescribeCommand.java +++ b/src/main/java/pl/project13/jgit/DescribeCommand.java @@ -18,23 +18,17 @@ package pl.project13.jgit; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.base.Preconditions; -import com.google.common.base.Throwables; -import com.google.common.collect.Lists; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.GitCommand; import org.eclipse.jgit.api.Status; import org.eclipse.jgit.api.errors.GitAPIException; -import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectReader; -import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevCommit; -import org.eclipse.jgit.revwalk.RevTag; import org.eclipse.jgit.revwalk.RevWalk; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -47,12 +41,9 @@ import java.io.IOException; import java.util.*; -import java.util.regex.Pattern; /** * Implements git's
describe
command. - * - * @author Konrad Malawski */ public class DescribeCommand extends GitCommand { diff --git a/src/main/java/pl/project13/jgit/JGitCommon.java b/src/main/java/pl/project13/jgit/JGitCommon.java index cbe245ed..ac8905fb 100644 --- a/src/main/java/pl/project13/jgit/JGitCommon.java +++ b/src/main/java/pl/project13/jgit/JGitCommon.java @@ -59,10 +59,6 @@ import static com.google.common.collect.Maps.newHashMap; import static com.google.common.collect.Sets.newHashSet; - -/** - * @author Konrad 'ktoso' Malawski - */ public class JGitCommon { public Collection getTags(Repository repo, final ObjectId headId) throws GitAPIException{ RevWalk walk = null; diff --git a/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java b/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java index a011ecf7..8b21b458 100644 --- a/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java +++ b/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java @@ -53,7 +53,6 @@ /** * Goal which puts git build-time information into property files or maven's properties. * - * @author Konrad 'ktoso' Malawski * @goal revision * @phase initialize * @requiresProject diff --git a/src/main/java/pl/project13/maven/git/GitDataProvider.java b/src/main/java/pl/project13/maven/git/GitDataProvider.java index b5cee9ac..75f0551a 100644 --- a/src/main/java/pl/project13/maven/git/GitDataProvider.java +++ b/src/main/java/pl/project13/maven/git/GitDataProvider.java @@ -28,9 +28,6 @@ import static com.google.common.base.Strings.isNullOrEmpty; -/** - * @author Konrad 'ktoso' Malawski - */ public abstract class GitDataProvider { @NotNull diff --git a/src/main/java/pl/project13/maven/git/GitDirLocator.java b/src/main/java/pl/project13/maven/git/GitDirLocator.java index b64233e6..d707c582 100644 --- a/src/main/java/pl/project13/maven/git/GitDirLocator.java +++ b/src/main/java/pl/project13/maven/git/GitDirLocator.java @@ -28,7 +28,6 @@ /** * Encapsulates logic to locate a valid .git directory. * - * @author Konrad 'ktoso' Malawski */ public class GitDirLocator { final MavenProject mavenProject; diff --git a/src/main/java/pl/project13/maven/git/GitRepositoryState.java b/src/main/java/pl/project13/maven/git/GitRepositoryState.java index fb9b1d94..43c52fb6 100644 --- a/src/main/java/pl/project13/maven/git/GitRepositoryState.java +++ b/src/main/java/pl/project13/maven/git/GitRepositoryState.java @@ -21,7 +21,6 @@ import com.google.common.base.Joiner; import org.jetbrains.annotations.NotNull; -import java.util.List; import java.util.Set; /** @@ -29,7 +28,6 @@ * with properties about the repository state at build time. * This information is supplied by my plugin - pl.project13.maven.git-commit-id-plugin * - * @author Konrad 'ktoso' Malawski * @since 1.0 */ //@JsonWriteNullProperties(true) diff --git a/src/main/java/pl/project13/maven/git/JGitProvider.java b/src/main/java/pl/project13/maven/git/JGitProvider.java index 572d4a74..9a79f48d 100644 --- a/src/main/java/pl/project13/maven/git/JGitProvider.java +++ b/src/main/java/pl/project13/maven/git/JGitProvider.java @@ -18,12 +18,8 @@ package pl.project13.maven.git; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.base.MoreObjects; -import com.google.common.base.Objects; -import com.google.common.base.Predicate; -import com.google.common.collect.Collections2; import org.apache.maven.plugin.MojoExecutionException; import org.eclipse.jgit.api.Git; @@ -51,9 +47,6 @@ import java.util.Date; import java.util.List; -/** - * @author Konrad 'ktoso' Malawski - */ public class JGitProvider extends GitDataProvider { private File dotGitDirectory; diff --git a/src/test/java/pl/project13/maven/git/FileSystemMavenSandbox.java b/src/test/java/pl/project13/maven/git/FileSystemMavenSandbox.java index b5e1120b..6883dad4 100644 --- a/src/test/java/pl/project13/maven/git/FileSystemMavenSandbox.java +++ b/src/test/java/pl/project13/maven/git/FileSystemMavenSandbox.java @@ -33,7 +33,6 @@ * Copies sample git repository from prototype location to newly created project * Has ability to set target project for storing git repository * - * @author mostr */ public class FileSystemMavenSandbox { diff --git a/src/test/java/pl/project13/maven/git/GitCommitIdMojoDirtyFilesTest.java b/src/test/java/pl/project13/maven/git/GitCommitIdMojoDirtyFilesTest.java index 9f58a821..28ffd613 100644 --- a/src/test/java/pl/project13/maven/git/GitCommitIdMojoDirtyFilesTest.java +++ b/src/test/java/pl/project13/maven/git/GitCommitIdMojoDirtyFilesTest.java @@ -17,24 +17,16 @@ package pl.project13.maven.git; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Maps; + import org.apache.maven.project.MavenProject; -import org.eclipse.jgit.lib.Repository; -import org.junit.Before; import org.junit.Test; import java.io.File; -import java.io.IOException; -import java.util.Map; import java.util.Properties; import static org.fest.assertions.Assertions.assertThat; import static org.mockito.Mockito.*; -/** - * @author Adam Batkin - */ public class GitCommitIdMojoDirtyFilesTest { @Test diff --git a/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java b/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java index 4524b8bb..caa7a39d 100644 --- a/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java +++ b/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java @@ -36,7 +36,6 @@ /** * I'm not a big fan of this test - let's move to integration test from now on. * - * @author Konrad 'ktoso' Malawski */ // todo remove this test in favor of complete intgration tests public class GitCommitIdMojoTest { diff --git a/src/test/java/pl/project13/test/utils/AssertException.java b/src/test/java/pl/project13/test/utils/AssertException.java index bffc4e26..ef0ee59c 100644 --- a/src/test/java/pl/project13/test/utils/AssertException.java +++ b/src/test/java/pl/project13/test/utils/AssertException.java @@ -30,7 +30,6 @@ * * SoftwareBirr 02.2012 * - * @author Konrad Malawski (konrad.malawski@java.pl) * @see AssertException in softwaremill-common/softwaremill-test-util */ public class AssertException { From 3778f3ab4bb90a26908fcbbb86dc461a3c8179f9 Mon Sep 17 00:00:00 2001 From: S L Date: Mon, 25 May 2015 14:06:48 +0200 Subject: [PATCH 8/9] Use a single instance of JGitCommon --- .../java/pl/project13/jgit/DescribeCommand.java | 15 +++++++++++---- .../java/pl/project13/maven/git/JGitProvider.java | 9 ++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/pl/project13/jgit/DescribeCommand.java b/src/main/java/pl/project13/jgit/DescribeCommand.java index 9b349e2d..b04cd5a7 100644 --- a/src/main/java/pl/project13/jgit/DescribeCommand.java +++ b/src/main/java/pl/project13/jgit/DescribeCommand.java @@ -48,6 +48,7 @@ public class DescribeCommand extends GitCommand { private LoggerBridge loggerBridge; + private JGitCommon jGitCommon; // TODO not yet implemented options: // private boolean containsFlag = false; @@ -122,6 +123,12 @@ public DescribeCommand withLoggerBridge(LoggerBridge bridge) { return this; } + @NotNull + public DescribeCommand withJGitCommon(JGitCommon jGitCommon) { + this.jGitCommon = jGitCommon; + return this; + } + /** *
--always
* @@ -293,7 +300,7 @@ public DescribeResult call() throws GitAPIException { } // get commits, up until the nearest tag - List commits = new JGitCommon().findCommitsUntilSomeTag(repo, headCommit, tagObjectIdToName); + List commits = jGitCommon.findCommitsUntilSomeTag(repo, headCommit, tagObjectIdToName); // if there is no tags or any tag is not on that branch then return generic describe if (foundZeroTags(tagObjectIdToName) || commits.isEmpty()) { @@ -303,7 +310,7 @@ public DescribeResult call() throws GitAPIException { // check how far away from a tag we are - int distance = new JGitCommon().distanceBetween(repo, headCommit, commits.get(0)); + int distance = jGitCommon.distanceBetween(repo, headCommit, commits.get(0)); String tagName = tagObjectIdToName.get(commits.get(0)).iterator().next(); Pair howFarFromWhichTag = Pair.of(distance, tagName); @@ -387,8 +394,8 @@ RevCommit findHeadObjectId(@NotNull Repository repo) throws RuntimeException { // git commit id -> its tag (or tags) private Map> findTagObjectIds(@NotNull Repository repo, boolean tagsFlag) { String matchPattern = createMatchPattern(); - Map> commitIdsToTags = new JGitCommon().getCommitIdsToTags(loggerBridge, repo, tagsFlag, matchPattern); - Map> commitIdsToTagNames = new JGitCommon().transformRevTagsMapToDateSortedTagNames(commitIdsToTags); + Map> commitIdsToTags = jGitCommon.getCommitIdsToTags(loggerBridge, repo, tagsFlag, matchPattern); + Map> commitIdsToTagNames = jGitCommon.transformRevTagsMapToDateSortedTagNames(commitIdsToTags); log("Created map: [",commitIdsToTagNames,"] "); return commitIdsToTagNames; diff --git a/src/main/java/pl/project13/maven/git/JGitProvider.java b/src/main/java/pl/project13/maven/git/JGitProvider.java index 9a79f48d..253393e2 100644 --- a/src/main/java/pl/project13/maven/git/JGitProvider.java +++ b/src/main/java/pl/project13/maven/git/JGitProvider.java @@ -54,6 +54,7 @@ public class JGitProvider extends GitDataProvider { private ObjectReader objectReader; private RevWalk revWalk; private RevCommit headCommit; + private JGitCommon jGitCommon; @NotNull public static JGitProvider on(@NotNull File dotGitDirectory, @NotNull LoggerBridge loggerBridge) { @@ -63,6 +64,7 @@ public static JGitProvider on(@NotNull File dotGitDirectory, @NotNull LoggerBrid JGitProvider(@NotNull File dotGitDirectory, @NotNull LoggerBridge loggerBridge) { super(loggerBridge); this.dotGitDirectory = dotGitDirectory; + this.jGitCommon = new JGitCommon(); } @NotNull @@ -189,7 +191,7 @@ protected String getTags() throws MojoExecutionException { try { Repository repo = getGitRepository(); ObjectId headId = headCommit.toObjectId(); - Collection tags = new JGitCommon().getTags(repo,headId); + Collection tags = jGitCommon.getTags(repo,headId); return Joiner.on(",").join(tags); } catch (GitAPIException e) { loggerBridge.error("Unable to extract tags from commit: " + headCommit.getName() + " (" + e.getClass().getName() + ")"); @@ -201,7 +203,7 @@ protected String getTags() throws MojoExecutionException { protected String getClosestTagName() throws MojoExecutionException { Repository repo = getGitRepository(); try { - return new JGitCommon().getClosestTagName(loggerBridge,repo); + return jGitCommon.getClosestTagName(loggerBridge,repo); } catch (Throwable t) { // could not find any tags to describe } @@ -212,7 +214,7 @@ protected String getClosestTagName() throws MojoExecutionException { protected String getClosestTagCommitCount() throws MojoExecutionException { Repository repo = getGitRepository(); try { - return new JGitCommon().getClosestTagCommitCount(loggerBridge,repo,headCommit); + return jGitCommon.getClosestTagCommitCount(loggerBridge,repo,headCommit); } catch (Throwable t) { // could not find any tags to describe } @@ -232,6 +234,7 @@ protected void finalCleanUp() { DescribeResult describeResult = DescribeCommand .on(repository) .withLoggerBridge(super.loggerBridge) + .withJGitCommon(jGitCommon) .setVerbose(super.verbose) .apply(super.gitDescribe) .call(); From 52a53758d73f1e09e37025cb3f022f8a8228c3f1 Mon Sep 17 00:00:00 2001 From: S L Date: Mon, 25 May 2015 14:18:06 +0200 Subject: [PATCH 9/9] make it simple and just let each class have a single instance of the jGitCommon --- src/main/java/pl/project13/jgit/DescribeCommand.java | 7 +------ src/main/java/pl/project13/maven/git/JGitProvider.java | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/pl/project13/jgit/DescribeCommand.java b/src/main/java/pl/project13/jgit/DescribeCommand.java index b04cd5a7..a9fd2ee0 100644 --- a/src/main/java/pl/project13/jgit/DescribeCommand.java +++ b/src/main/java/pl/project13/jgit/DescribeCommand.java @@ -105,6 +105,7 @@ private DescribeCommand(Repository repo, boolean verbose) { super(repo); initDefaultLoggerBridge(verbose); setVerbose(verbose); + this.jGitCommon = new JGitCommon(); } private void initDefaultLoggerBridge(boolean verbose) { @@ -123,12 +124,6 @@ public DescribeCommand withLoggerBridge(LoggerBridge bridge) { return this; } - @NotNull - public DescribeCommand withJGitCommon(JGitCommon jGitCommon) { - this.jGitCommon = jGitCommon; - return this; - } - /** *
--always
* diff --git a/src/main/java/pl/project13/maven/git/JGitProvider.java b/src/main/java/pl/project13/maven/git/JGitProvider.java index 253393e2..811f327b 100644 --- a/src/main/java/pl/project13/maven/git/JGitProvider.java +++ b/src/main/java/pl/project13/maven/git/JGitProvider.java @@ -234,7 +234,6 @@ protected void finalCleanUp() { DescribeResult describeResult = DescribeCommand .on(repository) .withLoggerBridge(super.loggerBridge) - .withJGitCommon(jGitCommon) .setVerbose(super.verbose) .apply(super.gitDescribe) .call();