]> git.cameronkatri.com Git - cgit.git/commitdiff
snapshot: support special value 'all' to enable all formats
authorChristian Hesse <mail@eworm.de>
Thu, 7 Jun 2018 20:01:50 +0000 (22:01 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 27 Jun 2018 16:11:19 +0000 (18:11 +0200)
Signed-off-by: Christian Hesse <mail@eworm.de>
Reviewed-by: John Keeping <john@keeping.me.uk>
cgitrc.5.txt
shared.c

index a9d3d0a4052a93e59c220208adf503314a867d5e..3bfacfa0e0a8829f8d1d0a7cd1c14f43015b387d 100644 (file)
@@ -429,6 +429,7 @@ snapshots::
        Text which specifies the default set of snapshot formats that cgit
        generates links for. The value is a space-separated list of zero or
        more of the values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip".
+       The special value "all" enables all snapshot formats.
        Default value: none.
 
 source-filter::
index 21ac8f4e68ea34b9ff0d95eb80612ed38404d21b..0a11e68aae4981cf9f972a0913ac2522014fe41a 100644 (file)
--- a/shared.c
+++ b/shared.c
@@ -390,6 +390,9 @@ int cgit_parse_snapshots_mask(const char *str)
        if (atoi(str))
                return 1;
 
+       if (strcmp(str, "all") == 0)
+               return INT_MAX;
+
        string_list_split(&tokens, str, ' ', -1);
        string_list_remove_empty_items(&tokens, 0);