Skip to content

Commit 0e4a1fd

Browse files
ezequielgarciastephenfin
authored andcommitted
Print git-am output
This commit changes the {series,patch,bundle} apply command to print the git-am output, thus showing the same result as the use of git-am would produce. This is specially useful when applying series. Before this commit, git-pw would show nothing: $ git-pw --project linux-input series apply 87107 $ (nothing printed) After this commit: $ git-pw --project linux-input series apply 87107 Applying: HID: intel-ish-hid: Add match callback to ishtp bus type Applying: HID: intel-ish-hid: Hide members of struct ishtp_cl_device Applying: HID: intel-ish-hid: Simplify ishtp_cl_link() Applying: HID: intel-ish-hid: Move driver registry functions Applying: HID: intel-ish-hid: Store ishtp_cl_device instance in device Applying: HID: intel-ish-hid: Move the common functions from client.h Applying: HID: intel-ish-hid: Add interface functions for struct ishtp_cl Applying: HID: intel-ish-hid: Move functions related to bus and device Applying: HID: intel-ish-hid: Use the new interface functions in HID ish client $ If a patch in a series does not apply cleanly, it's useful to get some output of those that did apply. Also, having a git-am-like output improves the user experience, by providing a more familiar feeling. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
1 parent 789e2aa commit 0e4a1fd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git_pw/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Utility functions.
33
"""
44

5+
from __future__ import print_function
56
import codecs
67
import os
78
import subprocess
@@ -46,10 +47,12 @@ def git_am(mbox, args):
4647
cmd.append(mbox)
4748

4849
try:
49-
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
50+
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
5051
except subprocess.CalledProcessError as exc:
5152
print(exc.output)
5253
sys.exit(exc.returncode)
54+
else:
55+
print(output, end='')
5356

5457

5558
def _tabulate(output, headers, fmt):

0 commit comments

Comments
 (0)