git: 62374dfa0f0d - main - git-arc: Use a separate message file

Mark Johnston markj at FreeBSD.org
Fri Feb 12 20:58:27 UTC 2021


The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=62374dfa0f0dba4fcb4cb6106af3c2019b8447c7

commit 62374dfa0f0dba4fcb4cb6106af3c2019b8447c7
Author:     Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-02-12 20:58:17 +0000
Commit:     Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-02-12 20:58:17 +0000

    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(-)

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
 }
 


More information about the dev-commits-src-main mailing list