diff options
author | Mike Frysinger <vapier@google.com> | 2022-08-19 02:16:19 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2022-08-22 19:38:32 +0000 |
commit | 8a54a7eac38070abf948524805b11e91471de401 (patch) | |
tree | 53ec44a3ff805dbd7606576d0cd978e8352a991e | |
parent | 63a5657ecfe1585ceda3231bfe8a6c8d9c3dafad (diff) | |
download | git-repo-8a54a7eac38070abf948524805b11e91471de401.tar.gz |
cherry-pick: tighten up output
If stdout or stderr are empty, don't print empty lines.
Also trim any trailing lines so we don't show excess ones.
Change-Id: I65fcea191e1f725be03c064cb510578632466013
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/343516
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: LaMont Jones <lamontjones@google.com>
-rw-r--r-- | subcmds/cherry_pick.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/subcmds/cherry_pick.py b/subcmds/cherry_pick.py index 7bd858bf..eecf4e17 100644 --- a/subcmds/cherry_pick.py +++ b/subcmds/cherry_pick.py | |||
@@ -60,8 +60,10 @@ change id will be added. | |||
60 | capture_stderr=True) | 60 | capture_stderr=True) |
61 | status = p.Wait() | 61 | status = p.Wait() |
62 | 62 | ||
63 | print(p.stdout, file=sys.stdout) | 63 | if p.stdout: |
64 | print(p.stderr, file=sys.stderr) | 64 | print(p.stdout.strip(), file=sys.stdout) |
65 | if p.stderr: | ||
66 | print(p.stderr.strip(), file=sys.stderr) | ||
65 | 67 | ||
66 | if status == 0: | 68 | if status == 0: |
67 | # The cherry-pick was applied correctly. We just need to edit the | 69 | # The cherry-pick was applied correctly. We just need to edit the |