[Libreoffice-commits] dev-tools.git: scripts/git-cherry-gerrit.py
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 19 08:11:01 UTC 2021
scripts/git-cherry-gerrit.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 1f68bc85ef2e55800d907ed2f01e967fecfcedc2
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Jan 19 09:10:02 2021 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jan 19 09:10:42 2021 +0100
git-cherry-gerrit.py: handle empty output from git rev-list
This didn't matter in bash, but it matters in Python: an empty string is
not the same as a list with one empty string.
Change-Id: I36f4345b8f3760d33f8d8755bb03081893b812a7
diff --git a/scripts/git-cherry-gerrit.py b/scripts/git-cherry-gerrit.py
index 6a0cf9e..df7e0c0 100755
--- a/scripts/git-cherry-gerrit.py
+++ b/scripts/git-cherry-gerrit.py
@@ -62,7 +62,10 @@ def main() -> None:
branch_point = merge_base
to_change_ids = []
- to_hashes = from_pipe(["git", "rev-list", merge_base + ".." + cherry_to]).split("\n")
+ to_hash_string = from_pipe(["git", "rev-list", merge_base + ".." + cherry_to])
+ to_hashes = []
+ if to_hash_string:
+ to_hashes = to_hash_string.split("\n")
git_cat_file = subprocess.Popen(['git', 'cat-file', '--batch'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
for to_hash in to_hashes:
to_change_ids.append(get_change_id(git_cat_file, to_hash))
More information about the Libreoffice-commits
mailing list