-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented #133 tags on current commit in jgit and native
It's hacky as in native... oh well, <3 jgit. Resolves #133
- Loading branch information
Showing
14 changed files
with
276 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,12 @@ | |
<groupId>pl.project13.maven</groupId> | ||
<artifactId>git-commit-id-plugin</artifactId> | ||
<packaging>maven-plugin</packaging> | ||
<version>2.1.11-SNAPSHOT</version> | ||
<version>2.1.10-SNAPSHOT</version> | ||
<name>Git Commit Id Plugin Maven Mojo</name> | ||
<description> | ||
git-commit-id-plugin is a plugin quite similar to | ||
https://fisheye.codehaus.org/browse/mojo/tags/buildnumber-maven-plugin-1.0-beta-4 for example but as buildnumber | ||
only supports svn (which is very sad) and cvs (which is even more sad). | ||
https://fisheye.codehaus.org/browse/mojo/tags/buildnumber-maven-plugin-1.0-beta-4 for example but as buildnumber at | ||
the time when I started this plugin only supported CVS and SVN, something had to be done. | ||
This plugin makes basic repository information available through maven resources. This can be used to display | ||
"what version is this?" or "who has deployed this and when, from which branch?" information at runtime - making | ||
it easy to find things like "oh, that isn't deployed yet, I'll test it tomorrow" and making both testers and | ||
|
@@ -46,7 +46,7 @@ | |
<id>ktoso</id> | ||
<name>Konrad Malawski</name> | ||
<email>[email protected]</email> | ||
<organization>Project13.pl</organization> | ||
<organization>project13.pl</organization> | ||
<url>http://blog.project13.pl</url> | ||
</developer> | ||
</developers> | ||
|
@@ -100,12 +100,6 @@ | |
<version>2.2.3</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.inject</groupId> | ||
<artifactId>guice</artifactId> | ||
<version>2.0</version> | ||
</dependency> | ||
|
||
<!-- Joda Time --> | ||
<dependency> | ||
<groupId>joda-time</groupId> | ||
|
@@ -165,7 +159,7 @@ | |
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>1.3.2</version> | ||
<type>jar</type> | ||
|
@@ -247,22 +241,22 @@ | |
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-plugin-plugin</artifactId> | ||
<version>3.2</version> | ||
<executions> | ||
<execution> | ||
<id>generated-helpmojo</id> | ||
<goals> | ||
<goal>helpmojo</goal> | ||
</goals> | ||
<configuration> | ||
<goalPrefix>git-commit-id</goalPrefix> | ||
<helpPackageName>pl.project13.maven</helpPackageName> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<!--<plugin>--> | ||
<!--<artifactId>maven-plugin-plugin</artifactId>--> | ||
<!--<version>${maven-plugin-api.version}</version>--> | ||
<!--<executions>--> | ||
<!--<execution>--> | ||
<!--<id>generated-helpmojo</id>--> | ||
<!--<goals>--> | ||
<!--<goal>helpmojo</goal>--> | ||
<!--</goals>--> | ||
<!--<configuration>--> | ||
<!--<goalPrefix>git-commit-id</goalPrefix>--> | ||
<!--<helpPackageName>pl.project13.maven</helpPackageName>--> | ||
<!--</configuration>--> | ||
<!--</execution>--> | ||
<!--</executions>--> | ||
<!--</plugin>--> | ||
</plugins> | ||
</build> | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,25 +54,8 @@ | |
|
||
/** | ||
* Implements git's <pre>describe</pre> command. | ||
* <p/> | ||
* <code><pre> | ||
* usage: git describe [options] <committish>* | ||
* or: git describe [options] --dirty | ||
* <p/> | ||
* --contains find the tag that comes after the commit | ||
* --debug debug search strategy on stderr | ||
* --all use any ref in .git/refs | ||
* --tags use any tag in .git/refs/tags | ||
* --long always use long format | ||
* --abbrev[=<n>] use <n> digits to display SHA-1s | ||
* --exact-match only output exact matches | ||
* --candidates <n> consider <n> most recent tags (default: 10) | ||
* --match <pattern> only consider tags matching <pattern> | ||
* --always show abbreviated commit object as fallback | ||
* --dirty[=<mark>] append <mark> on dirty working tree (default: "-dirty") | ||
* </pre></code> | ||
* | ||
* @author <a href="mailto:[email protected]">Konrad 'ktoso' Malawski</a> | ||
* @author Konrad Malawski | ||
*/ | ||
public class DescribeCommand extends GitCommand<DescribeResult> { | ||
|
||
|
@@ -153,9 +136,9 @@ public DescribeCommand withLoggerBridge(LoggerBridge bridge) { | |
|
||
/** | ||
* <pre>--always</pre> | ||
* <p/> | ||
* | ||
* Show uniquely abbreviated commit object as fallback. | ||
* <p/> | ||
* | ||
* <pre>true</pre> by default. | ||
*/ | ||
@NotNull | ||
|
@@ -167,13 +150,13 @@ public DescribeCommand always(boolean always) { | |
|
||
/** | ||
* <pre>--long</pre> | ||
* <p/> | ||
* | ||
* Always output the long format (the tag, the number of commits and the abbreviated commit name) | ||
* even when it matches a tag. This is useful when you want to see parts of the commit object name | ||
* in "describe" output, even when the commit in question happens to be a tagged version. Instead | ||
* of just emitting the tag name, it will describe such a commit as v1.2-0-gdeadbee (0th commit | ||
* since tag v1.2 that points at object deadbee....). | ||
* <p/> | ||
* | ||
* <pre>false</pre> by default. | ||
*/ | ||
@NotNull | ||
|
@@ -187,11 +170,11 @@ public DescribeCommand forceLongFormat(@Nullable Boolean forceLongFormat) { | |
|
||
/** | ||
* <pre>--abbrev=N</pre> | ||
* <p/> | ||
* | ||
* Instead of using the default <em>7 hexadecimal digits</em> as the abbreviated object name, | ||
* use <b>N</b> digits, or as many digits as needed to form a unique object name. | ||
* <p/> | ||
* An <n> of 0 will suppress long format, only showing the closest tag. | ||
* | ||
* An `n` of 0 will suppress long format, only showing the closest tag. | ||
*/ | ||
@NotNull | ||
public DescribeCommand abbrev(@Nullable Integer n) { | ||
|
@@ -210,22 +193,22 @@ public DescribeCommand abbrev(@Nullable Integer n) { | |
* Instead of using only the annotated tags, use any tag found in .git/refs/tags. | ||
* This option enables matching a lightweight (non-annotated) tag. | ||
* </p> | ||
* <p/> | ||
* | ||
* <p>Searching for lightweight tags is <b>false</b> by default.</p> | ||
* <p/> | ||
* | ||
* Example: | ||
* <pre> | ||
* b6a73ed - (HEAD, master) | ||
* d37a598 - (v1.0-fixed-stuff) - a lightweight tag (with no message) | ||
* 9597545 - (v1.0) - an annotated tag | ||
* | ||
* > git describe | ||
* $ git describe | ||
* annotated-tag-2-gb6a73ed # the nearest "annotated" tag is found | ||
* | ||
* > git describe --tags | ||
* $ git describe --tags | ||
* lightweight-tag-1-gb6a73ed # the nearest tag (including lightweights) is found | ||
* </pre> | ||
* <p/> | ||
* | ||
* <p> | ||
* Using only annotated tags to mark builds may be useful if you're using tags to help yourself with annotating | ||
* things like "i'll get back to that" etc - you don't need such tags to be exposed. But if you want lightweight | ||
|
@@ -249,7 +232,7 @@ public DescribeCommand tags() { | |
} | ||
|
||
/** | ||
* Apply all configuration options passed in with {@param config}. | ||
* Apply all configuration options passed in with `config`. | ||
* If a setting is null, it will not be applied - so for abbrev for example, the default 7 would be used. | ||
* | ||
* @return itself, after applying the settings | ||
|
@@ -342,7 +325,7 @@ public DescribeResult call() throws GitAPIException { | |
* Prepares the final result of this command. | ||
* It tries to put as much information as possible into the result, | ||
* and will fallback to a plain commit hash if nothing better is returnable. | ||
* <p/> | ||
* | ||
* The exact logic is following what <pre>git-describe</pre> would do. | ||
*/ | ||
private DescribeResult createDescribeResult(ObjectReader objectReader, ObjectId headCommitId, boolean dirty, @Nullable Pair<Integer, String> howFarFromWhichTag) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.