Skip to content

Commit

Permalink
Merge pull request #201 from ajoberstar/bump
Browse files Browse the repository at this point in the history
Bump
  • Loading branch information
ajoberstar authored Oct 22, 2017
2 parents 635b98b + dcc4872 commit 7523d4e
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 40 deletions.
8 changes: 2 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.ajoberstar.defaults' version '0.8.0'
id 'org.ajoberstar.defaults' version '0.8.1'
id 'org.jbake.site' version '1.0.0'
id 'java-gradle-plugin'
id 'groovy'
Expand Down Expand Up @@ -97,7 +97,7 @@ test {
}

stutter {
supports '3.0', '3.1', '3.2', '3.2.1', '3.3', '3.4', '3.5', '3.5.1', '4.0', '4.0.1', '4.0.2', '4.1-rc-1'
supports '3.0', '3.1', '3.2', '3.2.1', '3.3', '3.4', '3.5', '3.5.1', '4.0', '4.0.1', '4.0.2', '4.1', '4.2', '4.2.1'
}

model {
Expand Down Expand Up @@ -125,7 +125,3 @@ pluginBundle {
version = project.version
}
}

wrapper {
gradleVersion = '4.0.2'
}
4 changes: 3 additions & 1 deletion docs/content/grgit-describe.ad
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ grgit.describe()

[source, groovy]
----
grgit.describe(commit: <commit>, longDescr: <boolean>)
grgit.describe(commit: <commit>, longDescr: <boolean>, match: [<string>])
----

[source, groovy]
----
grgit.describe {
commit = <commit>
longDescr = <boolean>
match = [<string>]
}
----

Expand All @@ -37,6 +38,7 @@ Describe only shows annotated tags. For more information about creating annotate

commit:: (`Object`, default `null`) Commit-ish object names to describe. Defaults to HEAD if omitted. For a more complete list of ways to spell commit names, see link:grgit-resolve.html[grgit-resolve] (specifically the `toCommit` method).
longDescr:: (`boolean`, default `false`) 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…​.).
match:: (`List<String>`, default `[]`) Only consider tags matching the given glob(7) pattern, excluding the "refs/tags/" prefix. This can be used to avoid leaking private tags from the repository. If multiple patterns are given they will be accumulated, and tags matching any of the patterns will be considered.

== Examples

Expand Down
52 changes: 26 additions & 26 deletions global.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"requested": "4.12"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -83,11 +83,11 @@
"requested": "4.12"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -133,11 +133,11 @@
"requested": "4.12"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -183,11 +183,11 @@
"requested": "4.12"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -229,11 +229,11 @@
"requested": "[0.0.9,)"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -275,11 +275,11 @@
"requested": "[2.4.0, 3.0.0)"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -323,11 +323,11 @@
"requested": "[0.0.9,)"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -405,11 +405,11 @@
"requested": "[0.0.9,)"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -447,11 +447,11 @@
"requested": "[0.0.9,)"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -493,11 +493,11 @@
"requested": "4.12"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -543,11 +543,11 @@
"requested": "4.12"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -593,11 +593,11 @@
"requested": "4.12"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down Expand Up @@ -647,11 +647,11 @@
"requested": "4.12"
},
"org.eclipse.jgit:org.eclipse.jgit": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.eclipse.jgit:org.eclipse.jgit.ui": {
"locked": "4.8.0.201706111038-r",
"locked": "4.9.0.201710071750-r",
"requested": "[4.8.0.201706111038-r,)"
},
"org.slf4j:slf4j-api": {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Aug 06 14:40:27 CDT 2017
#Sun Oct 22 15:45:23 CDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,20 @@ class DescribeOp implements Callable<String> {
*/
boolean longDescr

/**
* glob patterns to match tags against before they are considered
*/
List<String> match = []

String call(){
DescribeCommand cmd = repo.jgit.describe()
if (commit) {
cmd.setTarget(new ResolveService(repo).toRevisionString(commit))
}
cmd.setLong(longDescr)
if (match) {
cmd.setMatch(match as String[])
}
return cmd.call()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class MultiGitOpSpec extends Specification {
protected Grgit init(String name) {
File repoDir = tempDir.newFolder(name).canonicalFile
Git git = Git.init().setDirectory(repoDir).call()

// Don't want the user's git config to conflict with test expectations
git.repo.FS.userHome = null

git.repo.config.with {
setString('user', null, 'name', person.name)
setString('user', null, 'email', person.email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class SimpleGitOpSpec extends Specification {
def setup() {
File repoDir = tempDir.newFolder('repo')
Git git = Git.init().setDirectory(repoDir).call()

// Don't want the user's git config to conflict with test expectations
git.repo.FS.userHome = null

git.repo.config.with {
setString('user', null, 'name', person.name)
setString('user', null, 'email', person.email)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ class DescribeOpSpec extends SimpleGitOpSpec {
def setup() {
grgit.commit(message:"initial commit")
grgit.tag.add(name:"initial")
grgit.commit(message:"another commit")
grgit.tag.add(name:"another")
}

def 'with initial tag'() {
def 'with tag'() {
expect:
grgit.describe() == "initial"
grgit.describe() == "another"
}

def 'with additional commit'(){
Expand All @@ -34,7 +36,7 @@ class DescribeOpSpec extends SimpleGitOpSpec {
grgit.add(patterns:['1.txt'])
grgit.commit(message: "another commit")
then:
grgit.describe().startsWith("initial-1-")
grgit.describe().startsWith("another-1-")
}

def 'from differnt commit'(){
Expand All @@ -43,11 +45,16 @@ class DescribeOpSpec extends SimpleGitOpSpec {
grgit.add(patterns:['1.txt'])
grgit.commit(message: "another commit")
then:
grgit.describe(commit: 'HEAD^') == "initial"
grgit.describe(commit: 'HEAD~2') == "initial"
}

def 'with long description'() {
expect:
grgit.describe(longDescr: true).startsWith("initial-0-")
grgit.describe(longDescr: true).startsWith("another-0-")
}

def 'with match'() {
expect:
grgit.describe(match: ['initial*']).startsWith("initial-1-")
}
}

0 comments on commit 7523d4e

Please sign in to comment.