aboutsummaryrefslogtreecommitdiffstats
path: root/ui-snapshot.c
Commit message (Expand)AuthorAgeFilesLines
...
| * return 404 if snapshot is not found•••Signed-off-by: Lars Hjemli <hjemli@gmail.com> Natanael Copa2008-12-281-3/+5
* | ui-snapshot.c: change mime-type for tar.gz and tar.bz2•••The updated mime-types seems to work better than the old ones with both safari and firefox. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-12-261-2/+2
|/
* ui-snapshot: improve extraction of revision from snapshot name•••The modified get_ref_from_filename() supports the following snapshot formats: * $REV.$EXT * $REPO[-_]*v?$REV.$EXT This implies that the following urls will retrieve the expected revision: * http://hjemli.net/git/cgit/snapshot/v0.8.1.tar.gz * http://hjemli.net/git/cgit/snapshot/0.8.1.tar.gz * http://hjemli.net/git/cgit/snapshot/cgit-0.8.1.tar.gz * http://hjemli.net/git/cgit/snapshot/cgit-140012d7a8.tar.gz Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-12-011-43/+37
* Set prefix in snapshots when using dwimmery•••This patch sets the directory prefix in archives to be the filename, excluding the suffix (.tar.gz, .tar.bz2 etc). The patch also removes the prefix parameter in cgit_print_snapshot() as the prefix might differ. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Natanael Copa2008-11-301-2/+12
* ui-snapshot: add dwimmery•••When downloading a snapshot, the snapshot name will often contain the repo name combined with a tag. This patch tries to exploit this so that the correct revision is downloaded even if no specific revision is specified. PS: this only occurs if neither 'h' nor 'id' is specified in the query- string. PPS: this also fixes a bug which occurs when trying to download a filename with an unsupported suffix: it used to try to print an error message to the user but failed since it didn't prepare the output properly. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-10-111-13/+81
* ui-snapshot.c: specify archiver_args.baselen•••The struct member was introduces in git commit d53fe8187c38, but the cgit testsuite failed to detect that cgit always generated archives without prefixes, i.e. the result from cgit_repobasename was ignored. This fixes the bug and the testsuite. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-10-051-1/+7
* Add ui-shared.h•••This is finally a proper headerfile for the shared ui-functions which used to reside in cgit.h Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-03-241-0/+1
* Refactor snapshot support•••The snapshot support needs to be split between output- and config-related functions to get the layering between shared.c and ui-*.c right. There is also some codestyle-issues which needs fixing to make the snapshot functions more similar to the rest of the cgit code. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-03-241-84/+38
* Remove obsolete cacheitem parameter to ui-functions•••This parameter hasn't been used for a very long time... Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-03-241-2/+1
* Add struct cgit_page to cgit_context•••This struct is used when generating http headers, and as such is another small step towards the goal of the whole cleanup series; to invoke each page/view function with a function pointer. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-03-241-1/+3
* Introduce html.h•••All html-functions can be quite easily separated from the rest of cgit, so lets do it; the only issue was html_filemode which uses some git-defined macros so the function is moved into ui-shared.c::cgit_print_filemode(). Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2008-03-181-0/+1
* Compare string lengths when parsing the snapshot mask•••We used to rely on the result from strncmp() without comparing the length of the strings involved. Even worse, any single-character format specifier would enable zip-format due to the optional '.'-prefix since the length of the mask then would become zero. Noticed-by: Evan Martin <sys@neugierig.org> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2007-12-031-3/+4
* Set commit date on snapshot contents•••The testsuite revealed that cgit snapshots don't set any useful timestamp on the files contained in the snapshot. Cherry-picked-from: 2ff33a8a0405b420cd75e0e207c7efeecd6f130b Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2007-11-111-0/+1
* ui-snapshot: whitespace/formatting cleanup•••Introduce a #define for number of snapshot archive entries, move all decls to function entrypoint, remove some trailing whitespace and reformat a few lines. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2007-07-231-23/+23
* cgit_print_snapshot_links: use url to specify snapshot name•••Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2007-07-231-14/+24
* allow selective enabling of snapshots••• snapshot configuration parameter now can be a space/slash/comma/colon/semicolon/pipe-separated list of snaphot suffixes as listed in ui-snapshot.c Signed-off-by: Michael Krelin <hacker@klever.net> Michael Krelin2007-07-211-7/+36
* shorten snapshot names to repo basename•••Signed-off-by: Michael Krelin <hacker@klever.net> Michael Krelin2007-07-211-1/+1
* added snapshot filename to the link••• - changed cgit_pageurl into cgit_fileurl with the filename parameter - rewritten cgit_pageurl as a wrapper around cgit_fileurl Signed-off-by: Michael Krelin <hacker@klever.net> Michael Krelin2007-07-211-1/+1
* add plain uncompressed tar snapshort format•••time to make available snapshots selectable Signed-off-by: Michael Krelin <hacker@klever.net> Michael Krelin2007-07-211-1/+2
* introduced .tar.bz2 snapshots••• - reworked write_tar_gzip_archive to handle arbitrary filter as a write_compressed_tar_archive - reformatted whitespaces in the said function to adhere to common cgit standards - added wrappers around write_compressed_tar_archive for .tar.gz and .tar.bz2 - added a hint for vim to use 8 characters shift width by default Signed-off-by: Michael Krelin <hacker@klever.net> Michael Krelin2007-07-211-31/+42
* compress .tar.gz using gzip as a filterMichael Krelin2007-07-201-1/+37
* add support for snapshot tarballs•••- reworked cgit_print_snapshot to use a list of supported archivers and pick one for the suffix supplied - moved printing of snaphot links into ui-snapshot and make it iterate through the said list Michael Krelin2007-07-181-28/+49
* Add support for snapshots•••Make a link from the commit viewer to a snapshot of the corresponding tree. Currently only zip-format is supported. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Lars Hjemli2007-02-081-0/+47