Skip to content

Commit 487cf69

Browse files
author
TheSnoozer
committed
improve docs
1 parent bd19445 commit 487cf69

File tree

1 file changed

+60
-4
lines changed

1 file changed

+60
-4
lines changed

src/main/java/pl/project13/core/GitCommitPropertyConstant.java

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,31 @@
2323
public class GitCommitPropertyConstant {
2424
/**
2525
* Represents the current branch name. Falls back to commit-id for detached HEAD.
26+
*
27+
* Note: When an user uses the {@code evaluateOnCommit} property to gather the
28+
* branch for an arbitrary commit (really anything besides the default {@code HEAD})
29+
* this plugin will perform a {@code git branch --points-at} which might
30+
* return a comma separated list of branch names that points to the specified commit.
2631
*/
2732
public static final String BRANCH = "branch";
2833
/**
2934
* Represents the count of commits that your local branch is ahead in perspective to the remote branch
3035
* (usually the case when your local branch has committed changes that are not pushed yet to the remote branch).
36+
*
37+
* <p>
38+
*
39+
* Note: To obtain the right value for this property this plugin should operate in online mode
40+
* ({@code <offline>false</offline>}) so a {@code git fetch} will be performed before retrieval.
3141
*/
3242
public static final String LOCAL_BRANCH_AHEAD = "local.branch.ahead";
3343
/**
3444
* Represents the count of commits that your local branch is behind in perspective to the remote branch
3545
* (usually the case when there are commits in the remote branch that are not yet integrated into your local branch).
46+
*
47+
* <p>
48+
*
49+
* Note: To obtain the right value for this property this plugin should operate in online mode
50+
* ({@code <offline>false</offline>}) so a {@code git fetch} will be performed before retrieval.
3651
*/
3752
public static final String LOCAL_BRANCH_BEHIND = "local.branch.behind";
3853
/**
@@ -55,12 +70,13 @@ public class GitCommitPropertyConstant {
5570
*/
5671
public static final String COMMIT_ID_ABBREV = "commit.id.abbrev";
5772
/**
58-
* Represents an object a human readable name based on a the commit (provides git describe for the given commit).
73+
* Represents an object a human readable name based on a the commit
74+
* (provides {@code git describe} for the given commit).
5975
*/
6076
public static final String COMMIT_DESCRIBE = "commit.id.describe";
6177
/**
6278
* Represents the same value as git.commit.id.describe,
63-
* just with the git hash part removed (the g2414721 part from git describe).
79+
* just with the git hash part removed (the {@code g2414721} part from {@code git describe}).
6480
*/
6581
public static final String COMMIT_SHORT_DESCRIBE = "commit.id.describe-short";
6682
/**
@@ -77,7 +93,7 @@ public class GitCommitPropertyConstant {
7793
*/
7894
public static final String BUILD_TIME = "build.time";
7995
/**
80-
* Represents the project version of the current maven project.
96+
* Represents the project version of the current project.
8197
*/
8298
public static final String BUILD_VERSION = "build.version";
8399
/**
@@ -87,11 +103,35 @@ public class GitCommitPropertyConstant {
87103
/**
88104
* The git.build.number* variables are available on some hosted CIs and can be used to identify the
89105
* "number" of the build. This represents a project specific build number.
106+
*
107+
* <p>
108+
*
109+
* Currently supported CIs:
110+
* <ul>
111+
* <li>Bamboo</li>
112+
* <li>Hudson/Jenkins</li>
113+
* <li>TeamCity</li>
114+
* <li>Travis</li>
115+
* <li>Gitlab CI (Gitlab >8.10 & Gitlab CI >0.5)</li>
116+
* <li>Azure DevOps</li>
117+
* <li>AWS CodeBuild</li>
118+
* <li>Bitbucket Pipelines</li>
119+
* </ul>
90120
*/
91121
public static final String BUILD_NUMBER = "build.number";
92122
/**
93123
* The git.build.number* variables are available on some hosted CIs and can be used to identify the
94124
* "number" of the build. This represents a system wide unique build number.
125+
*
126+
* <p>
127+
*
128+
* Currently supported CIs:
129+
* <ul>
130+
* <li>TeamCity</li>
131+
* <li>Travis</li>
132+
* <li>Gitlab CI (Gitlab >11.0)</li>
133+
* <li>AWS CodeBuild</li>
134+
* </ul>
95135
*/
96136
public static final String BUILD_NUMBER_UNIQUE = "build.number.unique";
97137
/**
@@ -104,10 +144,18 @@ public class GitCommitPropertyConstant {
104144
public static final String COMMIT_AUTHOR_EMAIL = "commit.user.email";
105145
/**
106146
* Represents the raw body (unwrapped subject and body) of the commit message.
147+
* Similar to running
148+
* <pre>
149+
* git log -1 --pretty=format:%B
150+
* </pre>
107151
*/
108152
public static final String COMMIT_MESSAGE_FULL = "commit.message.full";
109153
/**
110-
* Represents the subject of the commit message - may not be suitable for filenames.
154+
* Represents the subject of the commit message - may <b>not</b> be suitable for filenames.
155+
* Similar to running
156+
* <pre>
157+
* git log -1 --pretty=format:%s
158+
* </pre>
111159
*/
112160
public static final String COMMIT_MESSAGE_SHORT = "commit.message.short";
113161
/**
@@ -128,6 +176,10 @@ public class GitCommitPropertyConstant {
128176
public static final String REMOTE_ORIGIN_URL = "remote.origin.url";
129177
/**
130178
* Represents a list of tags which contain the specified commit.
179+
* Similar to running
180+
* <pre>
181+
* git tag --contains
182+
* </pre>
131183
*/
132184
public static final String TAGS = "tags";
133185
/**
@@ -142,6 +194,10 @@ public class GitCommitPropertyConstant {
142194
public static final String CLOSEST_TAG_COMMIT_COUNT = "closest.tag.commit.count";
143195
/**
144196
* Represents the total count of all commits in the current repository.
197+
* Similar to running
198+
* <pre>
199+
* git rev-list HEAD --count
200+
* </pre>
145201
*/
146202
public static final String TOTAL_COMMIT_COUNT = "total.commit.count";
147203

0 commit comments

Comments
 (0)