:p
atchew
Login
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 XXXXXXX..XXXXXXX 100755 --- a/patchew-cli +++ b/patchew-cli @@ -XXX,XX +XXX,XX @@ 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
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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/patchew-cli b/patchew-cli index XXXXXXX..XXXXXXX 100755 --- a/patchew-cli +++ b/patchew-cli @@ -XXX,XX +XXX,XX @@ class ProjectCommand(SubCommand): if old_head == new_head: logging.info("no change since last update") return + commit_range = "%s..%s" % (old_head, new_head) except: - old_head = "%s~100" % new_head + commit_range = 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", commit_range, "^%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