Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ Worth pointing out is, that git-commit-id tries to be 1-to-1 compatible with git

* **abbrev** - `(default: 7)` in the describe output, the object id of the hash is always abbreviated to N letters, by default 7. The typical describe output you'll see therefore is: `v2.1.0-1-gf5cd254`, where `-1-` means the number of commits away from the mentioned tag and the `-gf5cd254` part means the first 7 chars of the current commit's id `f5cd254`. **Please note that the `g` prefix is included to notify you that it's a commit id, it is NOT part of the commit's object id** - *this is default git bevaviour, so we're doing the same*. You can set this to any value between 0 and 40 (inclusive).
* **abbrev = 0** is a special case. Setting *abbrev* to `0` has the effect of hiding the "distance from tag" and "object id" parts of the output, so you endup with just the "nearest tag" (that is, instead `tag-12-gaaaaaaa` with `abbrev = 0` you'd get `tag`).
* **dirty** - `(default: "")` when you run describe on a repository that's in "dirty state" (has uncommited changes), the describe output will contain an additional suffix, such as "-devel" in this example: `v3.5-3-g2222222-devel`. You can configure that suffix to be anything you want, "-DEV" being a nice example. The "-" sign should be inclided in the configuration parameter, as it will not be added automatically. If in doubt run `git describe --dirty=-my_thing` to see how the end result will look like.
* **dirty** - `(default: "-dirty")` when you run describe on a repository that's in "dirty state" (has uncommited changes), the describe output will contain an additional suffix, such as "-devel" in this example: `v3.5-3-g2222222-devel`. You can configure that suffix to be anything you want, "-DEV" being a nice example. The "-" sign should be inclided in the configuration parameter, as it will not be added automatically. If in doubt run `git describe --dirty=-my_thing` to see how the end result will look like.
* **tags** - `(default: false)` if true this option enables matching a lightweight (non-annotated) tag.
* **match** - `(default: *)` only consider tags matching the given pattern (can be used to avoid leaking private tags made from the repository)
* **long** - `(default: false)` git-describe, by default, returns just the tag name, if the current commit is tagged. Use this option to force it to format the output using the typical describe format. An example would be: `tagname-0-gc0ffebabe` - notice that the distance from the tag is 0 here, if you don't use **forceLongFormat** mode, the describe for such commit would look like this: `tagname`.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/pl/project13/maven/git/GitDescribeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public class GitDescribeConfig {
* Describe the working tree. It means describe HEAD and appends mark (<pre>-dirty</pre> by default) if the
* working tree is dirty.
*
* <b>empty</b> by default, following git's behaviour.
* <b>-dirty</b> by default, following git's behaviour.
*
* @parameter default-value=""
* @parameter default-value="-dirty"
*/
private String dirty = "";
private String dirty = "-dirty";

/**
*<pre>--match glob-pattern</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ public void runGitDescribeWithMatchOption(boolean useNativeGit) throws Exception
setProjectToExecuteMojoIn(targetProject);

Map<String,String> gitTagMap = new HashMap<String,String>();
gitTagMap.put("v2.1.8", "4f787aa37d5d9c06780278f0cf92553d304820a2");
gitTagMap.put("v2.1.9", "a9dba4a25b64ab288d90cd503785b830d2e189a2");
gitTagMap.put("v2.1.11", "4308260db9582682a686b473390a5261ccacd6ef");
gitTagMap.put("v2.1.12", "42a0a939e6d5cd17389640170c969d519c14b302");

for (Map.Entry<String,String> entry : gitTagMap.entrySet()) {
String gitDescribeMatchNeedle = entry.getKey();
Expand Down Expand Up @@ -662,6 +662,7 @@ private GitDescribeConfig createGitDescribeConfig(boolean forceLongFormat, int a
gitDescribeConfig.setTags(true);
gitDescribeConfig.setForceLongFormat(forceLongFormat);
gitDescribeConfig.setAbbrev(abbrev);
gitDescribeConfig.setDirty("");
return gitDescribeConfig;
}

Expand Down