Compare commits
1 Commits
1.1.0.post
...
1.1.0.post
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3bf6ddaa6 |
@@ -158,6 +158,7 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
Keyword Arguments:
|
||||
kwargs/merged_output (bool): Output one single merged string
|
||||
kwargs/same_branch (bool): Force searching only in the same branch
|
||||
kwargs/ignore_merged (bool): ignore merged commits
|
||||
Returns:
|
||||
the commit message
|
||||
"""
|
||||
@@ -166,10 +167,20 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
tag_commit_id = cls.getFromTag(tag)
|
||||
print(f"tag_commit_id = {tag_commit_id}")
|
||||
|
||||
str_cmd: str
|
||||
if ("same_branch" in kwargs) and (kwargs["same_branch"] is True):
|
||||
commits = _exec(f"git rev-list --first-parent --ancestry-path {tag_commit_id}..{current_commit_id}")
|
||||
str_cmd = f"git rev-list --first-parent --ancestry-path {tag_commit_id}..{current_commit_id}"
|
||||
else:
|
||||
commits = _exec(f"git rev-list --ancestry-path {tag_commit_id}..{current_commit_id}")
|
||||
str_cmd = f"git rev-list --ancestry-path {tag_commit_id}..{current_commit_id}"
|
||||
|
||||
if ("ignore_merged" in kwargs) and (kwargs["ignore_merged"] is True):
|
||||
str_cmd = str_cmd + " --no-merges" # ok
|
||||
|
||||
try:
|
||||
commits = _exec(str_cmd)
|
||||
except gitversionhelper.unknownGITFatalError as _e:
|
||||
raise cls.commitNotFound("no commit found in commit history") from _e
|
||||
|
||||
result = []
|
||||
for commit in commits:
|
||||
result.append(cls.getMessage(commit))
|
||||
@@ -188,7 +199,7 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
"""
|
||||
try:
|
||||
res = _exec(
|
||||
f'git log -z --pretty="tformat:%B%-C()" -n 1 {commit_hash}',
|
||||
f'git log -z --pretty="tformat:%B%-C()" -n 1 {commit_hash}', # ok
|
||||
None,
|
||||
True,
|
||||
)
|
||||
@@ -207,9 +218,10 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
the commit Id
|
||||
"""
|
||||
try:
|
||||
res = _exec(f"git rev-list -n 1 {tag}")
|
||||
res = _exec(f"git rev-list -n 1 {tag}") # ok
|
||||
except gitversionhelper.unknownGITFatalError as _e:
|
||||
raise cls.commitNotFound("no commit found in commit history") from _e
|
||||
|
||||
if len(res) == 0:
|
||||
raise cls.commitNotFound("no commit found in commit history")
|
||||
return res[0]
|
||||
@@ -227,7 +239,7 @@ class gitversionhelper: # pylint: disable=too-few-public-methods
|
||||
if ("same_branch" in kwargs) and (kwargs["same_branch"] is True):
|
||||
str_cmd = "git rev-list --max-count=1 --date-order HEAD --first-parent" # ok
|
||||
else:
|
||||
str_cmd = "git log --format=%H --all -n1"
|
||||
str_cmd = "git log --format=%H --all -n1" # ok
|
||||
|
||||
if ("ignore_merged" in kwargs) and (kwargs["ignore_merged"] is True):
|
||||
str_cmd = str_cmd + " --no-merges" # ok
|
||||
|
||||
Reference in New Issue
Block a user