From c18f9d36eaeb825874a2fd5a1c794d684cf7b0e5 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Wed, 5 Apr 2023 15:38:12 -0700 Subject: [PATCH] Fetch git notes correctly --- README.md | 2 +- git-sig | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9282bd2..6ca4830 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The simple multisig toolchain for git repos. Consider using the following one liner which is much faster to review: ``` - git fetch origin refs/notes/signatures + git fetch origin refs/notes/signatures:refs/notes/signatures while read -r line; do \ gpg --verify \ <(printf "$line" | sed 's/.*pgp://g'| openssl base64 -d -A) \ diff --git a/git-sig b/git-sig index 46d4c01..e3329f9 100755 --- a/git-sig +++ b/git-sig @@ -467,6 +467,7 @@ cmd_verify() { --) shift; break ;; esac done + git fetch "$remote" refs/notes/signatures:refs/notes/signatures local -r head=$(git rev-parse --short HEAD) if [ -n "$diff" ] && [ -z "$ref" ]; then while read -r commit; do @@ -556,7 +557,7 @@ cmd_push() { -r|--remote) remote="$2"; shift 2 ;; --) shift; break ;; esac done - git fetch "$remote" refs/notes/signatures:refs/notes/"${remote}"/signatures + git fetch "$remote" refs/notes/signatures:refs/notes/signatures git notes --ref signatures merge -s cat_sort_uniq "${remote}"/signatures git push --tags "$remote" refs/notes/signatures }