Created
          November 24, 2017 08:10 
        
      - 
      
- 
        Save wreulicke/b3c0b00140e69246057eb447c68403e6 to your computer and use it in GitHub Desktop. 
    git-describe
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | @Grapes([ | |
| @Grab(group= 'org.eclipse.jgit', module= 'org.eclipse.jgit', version= '4.9.0.201710071750-r'), | |
| //@Grab(group= 'org.eclipse.jgit', module= 'org.eclipse.jgit', version= '4.3.1.201605051710-r'), | |
| ]) | |
| import org.eclipse.jgit.api.Git | |
| import org.eclipse.jgit.api.DescribeCommand | |
| import org.eclipse.jgit.storage.file.FileRepositoryBuilder | |
| def repo = FileRepositoryBuilder.create(new File(".", ".git")) | |
| def git = new Git(repo) | |
| println(git.describe().call()) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment