Use "old_head..new_head ^new_head~100" to go back 100 commits on the first
parent only. This way, merge commits are counted as one.
---
patchew-cli | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/patchew-cli b/patchew-cli
index 9cfdf36..0b53516 100755
--- a/patchew-cli
+++ b/patchew-cli
@@ -361,14 +361,14 @@ class ProjectCommand(SubCommand):
if old_head == new_head:
logging.info("no change since last update")
return
- except:
- old_head = "%s~100" % new_head
try:
# TODO: relax this 100 limit, which probably need an API change.
+ # using -100 would count all commits, while "^HEAD~100" counts merge
+ # commits as one
new_commits = (
subprocess.check_output(
- ["git", "rev-list", "-n", "100", "%s..%s" % (old_head, new_head)], cwd=clone
+ ["git", "rev-list", "%s..%s" % (old_head, new_head), "^%s~100" % new_head], cwd=clone
)
.decode()
.splitlines()
--
2.28.0
_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel