From db75704bfc12546bfbce96aea0be5c283df18314 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Mon, 1 Jun 2015 11:17:13 -0400 Subject: [PATCH] Fix 'repo cherry-pick' to avoid hanging on commit-msg update. After performing the actual cherry-pick operation, the code in cherry_pick.py opens a pipe to 'git commit -F' to rewrite the commit message, emits the fixed-up commit msg to the pipe, then waits for 'git commit' to complete. The child 'git' process winds up hanging while reading from the pipe, however, since the parent process still has it open. To fix the hang, change the parent process to close its end of the pipe after it has emitted the message. Change-Id: I5929371e69a5b076f09009d00d40a2c72ac8ac33 --- subcmds/cherry_pick.py | 1 + 1 file changed, 1 insertion(+) diff --git a/subcmds/cherry_pick.py b/subcmds/cherry_pick.py index 520e4c32..1f7dffdc 100644 --- a/subcmds/cherry_pick.py +++ b/subcmds/cherry_pick.py @@ -76,6 +76,7 @@ change id will be added. capture_stdout = True, capture_stderr = True) p.stdin.write(new_msg) + p.stdin.close() if p.Wait() != 0: print("error: Failed to update commit message", file=sys.stderr) sys.exit(1)