]> git.cameronkatri.com Git - cgit.git/commitdiff
Add all=1 query param for atom feeds
authorAaron Griffin <agriffin@datalogics.com>
Thu, 4 Feb 2010 00:31:17 +0000 (18:31 -0600)
committerLars Hjemli <hjemli@gmail.com>
Mon, 22 Mar 2010 22:41:38 +0000 (23:41 +0100)
Displays all items from all branches in one feed

Signed-off-by: Aaron Griffin <agriffin@datalogics.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
cgit.c
cgit.h
ui-atom.c

diff --git a/cgit.c b/cgit.c
index 9305d0a873a191e730d622d14067a2eee56003a6..ed2be64cb55b4751a27c3b4c906cb79df2d66ed2 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -250,6 +250,8 @@ static void querystring_cb(const char *name, const char *value)
                ctx.qry.period = xstrdup(value);
        } else if (!strcmp(name, "ss")) {
                ctx.qry.ssdiff = atoi(value);
+       } else if (!strcmp(name, "all")) {
+               ctx.qry.show_all = atoi(value);
        }
 }
 
diff --git a/cgit.h b/cgit.h
index cd4af7247b7c00dd9562917d2df94472d2e1317e..478aebbc0ff87ea2d189f85db18ba52697ac0014 100644 (file)
--- a/cgit.h
+++ b/cgit.h
@@ -145,6 +145,7 @@ struct cgit_query {
        char *sort;
        int showmsg;
        int ssdiff;
+       int show_all;
 };
 
 struct cgit_config {
index 808b2d0abede36fc73c8633ba36044a9d5547c30..9f049aea2c2abde2b18959ab63ac9709967b8873 100644 (file)
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -85,7 +85,9 @@ void cgit_print_atom(char *tip, char *path, int max_count)
        struct rev_info rev;
        int argc = 2;
 
-       if (!tip)
+       if (ctx.qry.show_all)
+               argv[1] = "--all";
+       else if (!tip)
                argv[1] = ctx.qry.head;
 
        if (path) {