From c712d5ac434b9ee8cb4e63a173a2538e1878637f Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sat, 31 Mar 2018 16:15:48 +0100 Subject: snapshot: support archive signatures Read signatures from the notes refs refs/notes/signatures/$FORMAT where FORMAT is one of our archive formats ("tar", "tar.gz", ...). The note is expected to simply contain the signature content to be returned when the snapshot "${filename}.asc" is requested, so the signature for cgit-1.1.tar.xz can be stored against the v1.1 tag with: git notes --ref=refs/notes/signatures/tar.xz add -C "$( gpg --output - --armor --detach-sign cgit-1.1.tar.xz | git hash-object -w --stdin )" v1.1 and then downloaded by simply appending ".asc" to the archive URL. Signed-off-by: John Keeping Reviewed-by: Christian Hesse --- cgit.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index 847cd2e..a686390 100644 --- a/cgit.h +++ b/cgit.h @@ -374,6 +374,8 @@ extern void cgit_parse_url(const char *url); extern const char *cgit_repobasename(const char *reponame); extern int cgit_parse_snapshots_mask(const char *str); +extern const struct object_id *cgit_snapshot_get_sig(const char *ref, + const struct cgit_snapshot_format *f); extern int cgit_open_filter(struct cgit_filter *filter, ...); extern int cgit_close_filter(struct cgit_filter *filter); -- cgit v1.2.3-59-g8ed1b