From 62374dfa0f0dba4fcb4cb6106af3c2019b8447c7 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 12 Feb 2021 15:58:17 -0500 Subject: git-arc: Use a separate message file Rather than putting revision metadata in .git/arc/create-message, create a tmpfile and use that. Otherwise arc diff always prompts about it and in some cases complains because its standard input is piped. Reported by: imp Differential Revision: https://reviews.freebsd.org/D28614 --- tools/tools/git/git-arc.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index 3b85d851319f..e8c84ea672f7 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -217,7 +217,7 @@ commit2diff() create_one_review() { - local childphid commit dir doprompt msg parent parentphid reviewers + local childphid commit doprompt msg parent parentphid reviewers local subscribers commit=$1 @@ -232,10 +232,7 @@ create_one_review() git checkout -q $commit - dir=$(git rev-parse --git-dir)/arc - mkdir -p "$dir" - - msg=${dir}/create-message + msg=$(mktemp) git show -s --format='%B' $commit > $msg printf "\nTest Plan:\n" >> $msg printf "\nReviewers:\n" >> $msg @@ -244,7 +241,7 @@ create_one_review() printf "${subscribers}\n" >> $msg yes | env EDITOR=true \ - arc diff --never-apply-patches --create --allow-untracked $BROWSE HEAD~ + arc diff --message-file $msg --never-apply-patches --create --allow-untracked $BROWSE HEAD~ [ $? -eq 0 ] || err "could not create Phabricator diff" if [ -n "$parent" ]; then @@ -263,6 +260,7 @@ create_one_review() ]}' | arc call-conduit -- differential.revision.edit >&3 fi + rm -f $msg return 0 } -- cgit v1.2.3