Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149772703
D46767.1790883472.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D46767.1790883472.diff
View Options
diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -548,32 +548,32 @@
diff=$1
reviewid=$(diff2phid "$diff")
# Get the author phid for this patch
- review_data=$(echo '{
- "constraints": {"phids": ["'"$reviewid"'"]}
- }' |
- arc_call_conduit -- differential.revision.search)
- authorid=$(echo "$review_data" | jq -r '.response.data[].fields.authorPHID' )
+ review_data=$(mktemp)
+ echo '{"constraints": {"phids": ["'"$reviewid"'"]}}' | \
+ arc_call_conduit -- differential.revision.search > "$review_data"
+ authorid=$(jq -r '.response.data[].fields.authorPHID' "$review_data")
# Get metadata about the user that submitted this patch
- user_data=$(echo '{
- "constraints": {"phids": ["'"$authorid"'"]}
- }' |
- arc call-conduit -- user.search | grep -v ^Warning: |
- jq -r '.response.data[].fields')
- user_addr=$(echo "$user_data" | jq -r '.username')
- user_name=$(echo "$user_data" | jq -r '.realName')
+ user_data=$(mktemp)
+ echo '{"constraints": {"phids": ["'"$authorid"'"]}}' | \
+ arc_call_conduit -- user.search | \
+ jq -r '.response.data[].fields' > "$user_data"
+ user_addr=$(jq -r '.username' "$user_data")
+ user_name=$(jq -r '.realName' "$user_data")
+ rm "$user_data"
# Dig the data out of querydiffs api endpoint, although it's deprecated,
# since it's one of the few places we can get email addresses. It's unclear
# if we can expect multiple difference ones of these. Some records don't
# have this data, so we remove all the 'null's. We sort the results and
# remove duplicates 'just to be sure' since we've not seen multiple
# records that match.
- diff_data=$(echo '{
- "revisionIDs": [ '"${diff#D}"' ]
- }' | arc_call_conduit -- differential.querydiffs |
- jq -r '.response | flatten | .[]')
- author_addr=$(echo "$diff_data" | jq -r ".authorEmail?" | sort -u)
- author_name=$(echo "$diff_data" | jq -r ".authorName?" | sort -u)
+ diff_data=$(mktemp)
+ echo '{"revisionIDs": [ '"${diff#D}"' ]}' | \
+ arc_call_conduit -- differential.querydiffs |
+ jq -r '.response | flatten | .[]' > "$diff_data"
+ author_addr=$(jq -r ".authorEmail?" "$diff_data" | sort -u)
+ author_name=$(jq -r ".authorName?" "$diff_data" | sort -u)
author=$(find_author "$user_addr" "$user_name" "$author_addr" "$author_name")
+ rm "$diff_data"
# If we had to guess, and the user didn't want to guess, abort
if [ "${author}" = "ABORT" ]; then
@@ -582,10 +582,11 @@
fi
tmp=$(mktemp)
- echo "$review_data" | jq -r '.response.data[].fields.title' > $tmp
+ jq -r '.response.data[].fields.title' "$review_data" > $tmp
echo >> $tmp
- echo "$review_data" | jq -r '.response.data[].fields.summary' >> $tmp
+ jq -r '.response.data[].fields.summary' "$review_data" >> $tmp
echo >> $tmp
+ rm "$review_data"
# XXX this leaves an extra newline in some cases.
reviewers=$(diff2reviewers "$diff" | sed '/^$/d' | paste -sd ',' - | sed 's/,/, /g')
if [ -n "$reviewers" ]; then
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 1, 7:37 PM (5 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30077793
Default Alt Text
D46767.1790883472.diff (3 KB)
Attached To
Mode
D46767: git-arc: Do not echo unescaped literals to jq
Attached
Detach File
Event Timeline
Log In to Comment