From c1572bb5ec4540b5008490cf471cc4a5e65ef728 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sat, 31 Mar 2018 14:20:01 +0100 Subject: Add "snapshot-prefix" repo configuration Allow using a user-specified value for the prefix in snapshot files instead of the repository basename. For example, files downloaded from the linux-stable.git repository should be named linux-$VERSION and not linux-stable-$VERSION, which can be achieved by setting: repo.snapshot-prefix=linux Signed-off-by: John Keeping Reviewed-by: Christian Hesse --- cgit.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index 005ae63..847cd2e 100644 --- a/cgit.h +++ b/cgit.h @@ -88,6 +88,7 @@ struct cgit_repo { char *clone_url; char *logo; char *logo_link; + char *snapshot_prefix; int snapshots; int enable_commit_graph; int enable_log_filecount; -- cgit v1.2.3-24-g4f1b 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-24-g4f1b From 2f8648ff7f5c7119ab035c134504f04eefe068fb Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 11 Jun 2018 08:26:59 +0200 Subject: snapshot: strip bit from struct cgit_snapshot_format We had a static bit value in struct cgit_snapshot_format. We do not rely on it and things can be calculated on the fly. So strip it. Signed-off-by: Christian Hesse --- cgit.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index a686390..0798dc5 100644 --- a/cgit.h +++ b/cgit.h @@ -46,6 +46,8 @@ */ #define PAGE_ENCODING "UTF-8" +#define BIT(x) (1U << (x)) + typedef void (*configfn)(const char *name, const char *value); typedef void (*filepair_fn)(struct diff_filepair *pair); typedef void (*linediff_fn)(char *line, int len); @@ -314,7 +316,6 @@ struct cgit_snapshot_format { const char *suffix; const char *mimetype; write_archive_fn_t write_func; - int bit; }; extern const char *cgit_version; @@ -376,6 +377,7 @@ 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 const unsigned cgit_snapshot_format_bit(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-24-g4f1b From 54d37dc154f5308459df0a90c81dabd0245b6c17 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 18 Jun 2018 11:48:43 +0200 Subject: global: remove functionality we deprecated for cgit v1.0 The man page states these were deprecated for v1.0. We are past v1.1, so remove the functionality. Signed-off-by: Christian Hesse Reviewed-by: John Keeping --- cgit.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index 0798dc5..6feca68 100644 --- a/cgit.h +++ b/cgit.h @@ -197,8 +197,6 @@ struct cgit_config { char *footer; char *head_include; char *header; - char *index_header; - char *index_info; char *logo; char *logo_link; char *mimetype_file; @@ -248,7 +246,6 @@ struct cgit_config { int max_repodesc_len; int max_blob_size; int max_stats; - int nocache; int noplainemail; int noheader; int renamelimit; -- cgit v1.2.3-24-g4f1b From b522a302c9c4fb9fd9e1ea829ee990afc74980ca Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 12 Feb 2018 23:10:06 +0100 Subject: extra-head-content: introduce another option for meta tags This is to support things like go-import meta tags, which are on a per-repo basis. Signed-off-by: Jason A. Donenfeld --- cgit.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index 6feca68..32dfd7a 100644 --- a/cgit.h +++ b/cgit.h @@ -81,6 +81,7 @@ struct cgit_repo { char *name; char *path; char *desc; + char *extra_head_content; char *owner; char *homepage; char *defbranch; -- cgit v1.2.3-24-g4f1b