diff options
author | Mark Johnston <markj@FreeBSD.org> | 2021-02-12 20:58:17 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2021-02-12 20:58:17 +0000 |
commit | 62374dfa0f0dba4fcb4cb6106af3c2019b8447c7 (patch) | |
tree | 4bb84149bbc80ad8c4f9bbfa988718129ac9d9af | |
parent | 8ca99aecf749dd088310f81f3c5364a462f1e332 (diff) | |
download | src-62374dfa0f0dba4fcb4cb6106af3c2019b8447c7.tar.gz src-62374dfa0f0dba4fcb4cb6106af3c2019b8447c7.zip |
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
-rw-r--r-- | tools/tools/git/git-arc.sh | 10 |
1 files changed, 4 insertions, 6 deletions
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 } |