Compare commits
3 Commits
0.0.1.post
...
0.0.1.post
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be9ef684e4 | ||
|
|
792666c6ec | ||
|
|
2951e70c47 |
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@@ -148,7 +148,8 @@ pipeline {
|
||||
{
|
||||
if(sh(returnStdout: true, script: "git tag --points-at HEAD").trim().isEmpty())
|
||||
{
|
||||
error("master push/merge must have an explicit tag release number")
|
||||
currentBuild.getRawBuild().getExecutor().doStop()
|
||||
//error("master push/merge must have an explicit tag release number")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
the commit message
|
||||
"""
|
||||
current_commit_id=cls.getLast(**kwargs)
|
||||
tag_commit_id=cls.getFromTag(tag,**kwargs)
|
||||
tag_commit_id=cls.getFromTag(tag)
|
||||
|
||||
if ((cls.__OptDict["same_branch"] in kwargs) and (kwargs[cls.__OptDict["same_branch"]] is True)):
|
||||
commits = _exec(f"git rev-list --first-parent --ancestry-path {tag_commit_id}..{current_commit_id}")
|
||||
@@ -147,7 +147,7 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
commits = _exec(f"git rev-list --ancestry-path {tag_commit_id}..{current_commit_id}")
|
||||
result=[]
|
||||
for commit in commits:
|
||||
result.append(cls.getMessage(commit,**kwargs))
|
||||
result.append(cls.getMessage(commit))
|
||||
|
||||
if ((cls.__OptDict["merged_output"] in kwargs) and (kwargs[cls.__OptDict["merged_output"]] is True)):
|
||||
print("JOIN")
|
||||
@@ -155,16 +155,16 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
return result
|
||||
|
||||
@classmethod
|
||||
def getMessage(cls, hash:str) -> str:
|
||||
def getMessage(cls, commit_hash:str) -> str:
|
||||
"""
|
||||
retrieve a commit message from repository
|
||||
Args:
|
||||
hash: id of the commit
|
||||
commit_hash: id of the commit
|
||||
Returns:
|
||||
the commit message
|
||||
"""
|
||||
try:
|
||||
res=_exec(f"git log -z --pretty=tformat:%B%-C() -n 1 {hash}",None,True).rstrip('\x00')
|
||||
res=_exec(f"git log -z --pretty=\"tformat:%B%-C()\" -n 1 {commit_hash}",None,True).rstrip('\x00')
|
||||
except gitversionhelper.unknownGITFatalError as _e:
|
||||
raise cls.commitNotFound("no commit found in commit history") from _e
|
||||
|
||||
@@ -202,7 +202,7 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
except gitversionhelper.unknownGITFatalError as _e:
|
||||
raise cls.commitNotFound("no commit found in commit history") from _e
|
||||
else:
|
||||
res = _exec("git for-each-ref --sort=-committerdate refs/heads/ --count 1 --format=%(objectname)")
|
||||
res = _exec("git for-each-ref --sort=-committerdate refs/heads/ --count 1 --format=\"%(objectname)\"")
|
||||
|
||||
if len(res)==0:
|
||||
raise cls.commitNotFound("no commit found in commit history")
|
||||
|
||||
Reference in New Issue
Block a user