]> granicus.if.org Git - cgit/log
cgit
16 years agoRemove global and obsolete cgit_cmd
Lars Hjemli [Tue, 25 Mar 2008 01:00:09 +0000 (02:00 +0100)]
Remove global and obsolete cgit_cmd

This variable was obsoleted by cmd.c.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: copy the QUIET constructs from the Makefile in git.git
Lars Hjemli [Tue, 25 Mar 2008 00:41:10 +0000 (01:41 +0100)]
Makefile: copy the QUIET constructs from the Makefile in git.git

These constructs were introduced by Shawn O. Pearce in commit
74f2b2a8d006a49e1be7e30731c2f7365d2741d1.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMove cgit_version from shared.c to cgit.c
Lars Hjemli [Mon, 24 Mar 2008 22:10:59 +0000 (23:10 +0100)]
Move cgit_version from shared.c to cgit.c

With the matching Makefile change, this makes sure that only cgit.o and cgit
proper needs to be rebuildt when VERSION has been modified.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMakefile: autobuild dependency rules
Lars Hjemli [Mon, 24 Mar 2008 22:01:44 +0000 (23:01 +0100)]
Makefile: autobuild dependency rules

This uses gcc to generate dependency rules for each `.o` file, based on the
corresponding `.c` file, into a new set of `.d` files (which are also defined
to depend on the same set of source files as their `.o` files).

Result:
* all objectfile dependencies are correctly calculated
* only the necessary dependencies are recalculated when a sourcefile is updated

Inspiration for the build rules:
* http://www.gnu.org/software/make/manual/make.html#Automatic-Prerequisites
* http://make.paulandlesley.org/autodep.html

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoInitial Makefile cleanup
Lars Hjemli [Mon, 24 Mar 2008 19:49:41 +0000 (20:49 +0100)]
Initial Makefile cleanup

Sort the list of object files to improve readability/mergeability and remove
manual dependency information which will soon be generated automatically.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMove non-generic functions from shared.c to cgit.c
Lars Hjemli [Mon, 24 Mar 2008 16:26:08 +0000 (17:26 +0100)]
Move non-generic functions from shared.c to cgit.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd ui-shared.h
Lars Hjemli [Mon, 24 Mar 2008 15:50:57 +0000 (16:50 +0100)]
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>
16 years agoAdd separate header-files for each page/view
Lars Hjemli [Mon, 24 Mar 2008 15:38:47 +0000 (16:38 +0100)]
Add separate header-files for each page/view

Yet another step towards removing cgit.h.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoRefactor snapshot support
Lars Hjemli [Mon, 24 Mar 2008 15:00:27 +0000 (16:00 +0100)]
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>
16 years agoAdd command dispatcher
Lars Hjemli [Mon, 24 Mar 2008 00:09:39 +0000 (01:09 +0100)]
Add command dispatcher

This simplifies the code in cgit.c and makes it easier to extend cgit with
new pages/commands.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoRemove obsolete cacheitem parameter to ui-functions
Lars Hjemli [Mon, 24 Mar 2008 00:00:36 +0000 (01:00 +0100)]
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>
16 years agoAdd struct cgit_page to cgit_context
Lars Hjemli [Sun, 23 Mar 2008 23:51:19 +0000 (00:51 +0100)]
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>
16 years agoIntroduce html.h
Lars Hjemli [Sat, 23 Feb 2008 21:45:33 +0000 (22:45 +0100)]
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>
16 years agoImprove initialization of git directory
Lars Hjemli [Sat, 16 Feb 2008 20:16:53 +0000 (21:16 +0100)]
Improve initialization of git directory

Using the functions offered by libgit feels like the right thing to do. Also,
make sure that config errors gets properly reported.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoMove cgit_repo into cgit_context
Lars Hjemli [Sat, 16 Feb 2008 12:56:09 +0000 (13:56 +0100)]
Move cgit_repo into cgit_context

This removes the global variable which is used to keep track of the
currently selected repository, and adds a new variable in the cgit_context
structure.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoAdd all config variables into struct cgit_context
Lars Hjemli [Sat, 16 Feb 2008 12:07:13 +0000 (13:07 +0100)]
Add all config variables into struct cgit_context

This removes another big set of global variables, and introduces the
cgit_prepare_context() function which populates a context-variable with
compile-time default values.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoIntroduce struct cgit_context
Lars Hjemli [Sat, 16 Feb 2008 10:53:40 +0000 (11:53 +0100)]
Introduce struct cgit_context

This struct will hold all the cgit runtime information currently found in
a multitude of global variables.

The first cleanup removes all querystring-related variables.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
16 years agoUse GIT-1.5.4.1
Lars Hjemli [Sat, 16 Feb 2008 10:22:06 +0000 (11:22 +0100)]
Use GIT-1.5.4.1

16 years agoUse GIT-1.5.4
Lars Hjemli [Sat, 2 Feb 2008 07:55:09 +0000 (08:55 +0100)]
Use GIT-1.5.4

16 years agoUse GIT-1.5.4.rc5
Lars Hjemli [Mon, 28 Jan 2008 20:18:28 +0000 (21:18 +0100)]
Use GIT-1.5.4.rc5

16 years agoUse GIT-1.5.4.rc4
Lars Hjemli [Sun, 13 Jan 2008 18:16:23 +0000 (19:16 +0100)]
Use GIT-1.5.4.rc4

17 years agoMerge branch 'stable'
Lars Hjemli [Sun, 13 Jan 2008 17:34:37 +0000 (18:34 +0100)]
Merge branch 'stable'

* stable:
  CGIT 0.7.2
  Use GIT-1.5.3.8
  Compare string lengths when parsing the snapshot mask
  Default repo description to "[no description]"

17 years agoCGIT 0.7.2 v0.7.2
Lars Hjemli [Thu, 10 Jan 2008 12:50:22 +0000 (13:50 +0100)]
CGIT 0.7.2

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUse GIT-1.5.3.8
Lars Hjemli [Thu, 10 Jan 2008 12:47:18 +0000 (13:47 +0100)]
Use GIT-1.5.3.8

17 years agoCheck for NULL-subject in patch view
Lars Hjemli [Tue, 18 Dec 2007 08:26:50 +0000 (08:26 +0000)]
Check for NULL-subject in patch view

While at it, make sure the commit message ends with a '\n'.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoHandle missing default branch and error out on invalid branch names
Lars Hjemli [Fri, 4 Jan 2008 12:43:40 +0000 (13:43 +0100)]
Handle missing default branch and error out on invalid branch names

When no branch is specified and the repository does not have a default branch,
use the first branch.

Also, print sensible errormessages when the repository does not contain any
branches and when invalid branchnames are specified.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd plain patch view
Lars Hjemli [Mon, 10 Dec 2007 20:47:29 +0000 (21:47 +0100)]
Add plain patch view

The new view mimics the output from `git format-patch`, making it possible
to cherry-pick directly from cgit with something like `curl $url | git am`.

Inspired by a patch to `git-apply` by Mike Hommey:
  http://thread.gmane.org/gmane.comp.version-control.git/67611/focus=67610

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for automatic and custom clone urls
Lars Hjemli [Mon, 3 Dec 2007 00:49:38 +0000 (01:49 +0100)]
Add support for automatic and custom clone urls

This adds support for two new parameters to cgitrc: clone-prefix and
repo.clone-url.

If clone-prefix is specified, all repos will get a clone url printed in the
sidebar; the url is generated by clone-prefix + repo.url.

Additionally, each repo can specify repo.clone-url which will override any
such auto-generated url.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoCompare string lengths when parsing the snapshot mask
Lars Hjemli [Sun, 2 Dec 2007 23:39:20 +0000 (00:39 +0100)]
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>
17 years agoDefault repo description to "[no description]"
Evan Martin [Sun, 2 Dec 2007 22:39:30 +0000 (14:39 -0800)]
Default repo description to "[no description]"

Otherwise, when you leave out a description for a repository, the NULL
default causes cgit to print out titles like "cgit - (null)".

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMerge branch 'stable'
Lars Hjemli [Sun, 2 Dec 2007 21:28:37 +0000 (22:28 +0100)]
Merge branch 'stable'

* stable:
  Handle missing timestamp in commit/tag objects
  Set commit date on snapshot contents

17 years agoHandle missing timestamp in commit/tag objects
Lars Hjemli [Sun, 2 Dec 2007 21:11:35 +0000 (22:11 +0100)]
Handle missing timestamp in commit/tag objects

When a commit or tag lacks author/committer/tagger timestamp, do not skip
the next line in the commit/tag object.

Also, do not bother to print timestamps with value 0 as it is close to certain
to be bogus.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd cell-spacing in html
Lars Hjemli [Fri, 16 Nov 2007 09:28:29 +0000 (10:28 +0100)]
Add cell-spacing in html

There are some browsers which don't support the border-spacing property

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUse tables for page layout
Lars Hjemli [Fri, 16 Nov 2007 08:52:03 +0000 (09:52 +0100)]
Use tables for page layout

It feels like the Right Thing, and it fixes some rendering problems in a
much used webbrowser.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoGimp my logo
Lars Hjemli [Fri, 16 Nov 2007 08:51:35 +0000 (09:51 +0100)]
Gimp my logo

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for "robots" meta-tag
Lars Hjemli [Sun, 11 Nov 2007 20:57:21 +0000 (21:57 +0100)]
Add support for "robots" meta-tag

With this change, cgit will start to generate the "robots" meta-tag, using
a default value of "index, nofollow".

The default value can be modified with a new cgitrc variable, "robots".

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoGenerate valid html for "downloads" menu header
Lars Hjemli [Sun, 11 Nov 2007 12:44:39 +0000 (13:44 +0100)]
Generate valid html for "downloads" menu header

Noticed-by: http://validator.w3.org
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMerge branch 'lh/testsuite'
Lars Hjemli [Sun, 11 Nov 2007 12:17:13 +0000 (13:17 +0100)]
Merge branch 'lh/testsuite'

* lh/testsuite:
  Set commit date on snapshot contents
  Fix html error detected by test-suite
  Create initial testsuite

17 years agoSet commit date on snapshot contents
Lars Hjemli [Sun, 11 Nov 2007 12:14:15 +0000 (13:14 +0100)]
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>
17 years agoSet commit date on snapshot contents
Lars Hjemli [Sun, 11 Nov 2007 12:14:15 +0000 (13:14 +0100)]
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.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoFix html error detected by test-suite
Lars Hjemli [Sun, 11 Nov 2007 12:04:28 +0000 (13:04 +0100)]
Fix html error detected by test-suite

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoCreate initial testsuite
Lars Hjemli [Sat, 10 Nov 2007 23:40:58 +0000 (00:40 +0100)]
Create initial testsuite

This creates a simple testsuite, heavily inspired by the testsuite in git.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMerge branch 'stable'
Lars Hjemli [Fri, 9 Nov 2007 12:52:48 +0000 (13:52 +0100)]
Merge branch 'stable'

* stable:
  CGIT 0.7.1
  Makefile install: include cgit.png, do not empty cache

Conflicts:

Makefile

17 years agoCGIT 0.7.1 v0.7.1
Lars Hjemli [Fri, 9 Nov 2007 12:51:00 +0000 (13:51 +0100)]
CGIT 0.7.1

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMakefile install: include cgit.png, do not empty cache
Lars Hjemli [Fri, 9 Nov 2007 12:47:58 +0000 (13:47 +0100)]
Makefile install: include cgit.png, do not empty cache

The cache-cleaning is potentially dangerous, so lets move it away from the
install target. A special emptycache target can be used to run the rm -rf.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMinor css tweaks
Lars Hjemli [Fri, 9 Nov 2007 12:19:56 +0000 (13:19 +0100)]
Minor css tweaks

Don't specify border and background color for input controls, reduce font-
size of heading in sidebar.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMerge branch 'stable'
Lars Hjemli [Thu, 8 Nov 2007 11:22:39 +0000 (12:22 +0100)]
Merge branch 'stable'

* stable:
  Support "/" as virtual-root

17 years agoSupport "/" as virtual-root
Lars Hjemli [Thu, 8 Nov 2007 11:20:05 +0000 (12:20 +0100)]
Support "/" as virtual-root

When the virtual-root was a single "/", it would be normalized to NULL due
to removal of trailing slashes, which in turn would fool us to belive that
we shouldn't generate virtual urls.

This makes the "/" normalize to "", effectively allowing virtual urls like
http://example.com/projectname to be generated without specifying the
full domain name as the virtual root.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMakefile: link with libiconv if NEEDS_LIBICONV is defined
Lars Hjemli [Tue, 6 Nov 2007 08:35:07 +0000 (09:35 +0100)]
Makefile: link with libiconv if NEEDS_LIBICONV is defined

This seems to be needed to compile on cygwin.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMerge branch 'iconv-rebased' of http://x2a.org/pub/git/cgit
Lars Hjemli [Mon, 5 Nov 2007 23:38:18 +0000 (00:38 +0100)]
Merge branch 'iconv-rebased' of http://x2a.org/pub/git/cgit

* 'iconv-rebased' of http://x2a.org/pub/git/cgit:
  Use utf8::reencode_string from git
  Convert subject and message with iconv_msg.
  Add iconv_msg function.
  Set msg_encoding according to the header.
  Add commit->msg_encoding, allocate msg dynamicly.

17 years agoShow lines changed as -n/+m in shortlogs
Lars Hjemli [Mon, 5 Nov 2007 23:35:12 +0000 (00:35 +0100)]
Show lines changed as -n/+m in shortlogs

This is way more informative than the total number of changed lines.

Suggested-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUse utf8::reencode_string from git
Lars Hjemli [Mon, 5 Nov 2007 21:27:43 +0000 (22:27 +0100)]
Use utf8::reencode_string from git

This replaces the iconv-support in cgit with similar functions already
existing in git.

Signed-off-by: Lars Hjemli <hjemli@gmai.com>
17 years agoConvert subject and message with iconv_msg.
Jonathan Bastien-Filiatrault [Fri, 26 Oct 2007 22:13:41 +0000 (18:13 -0400)]
Convert subject and message with iconv_msg.

17 years agoAdd iconv_msg function.
Jonathan Bastien-Filiatrault [Fri, 26 Oct 2007 22:11:26 +0000 (18:11 -0400)]
Add iconv_msg function.

17 years agoSet msg_encoding according to the header.
Jonathan Bastien-Filiatrault [Fri, 26 Oct 2007 22:10:26 +0000 (18:10 -0400)]
Set msg_encoding according to the header.

17 years agoAdd commit->msg_encoding, allocate msg dynamicly.
Jonathan Bastien-Filiatrault [Fri, 26 Oct 2007 22:09:06 +0000 (18:09 -0400)]
Add commit->msg_encoding, allocate msg dynamicly.

17 years agoDon't show the the branch selector button if javascript is enabled
Lars Hjemli [Sat, 3 Nov 2007 13:17:58 +0000 (14:17 +0100)]
Don't show the the branch selector button if javascript is enabled

Suggested-by: Olivier Ramonat <olivier@ramonat.fr>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoDo not require javascript-enabled clients
Lars Hjemli [Sat, 3 Nov 2007 13:05:12 +0000 (14:05 +0100)]
Do not require javascript-enabled clients

A simple submit-button is all that's required to make the branch selector
drop-down work on any client, so lets add one.

Noticed-by: Olivier Ramonat <olivier@ramonat.fr>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoCGIT 0.7 v0.7
Lars Hjemli [Sat, 3 Nov 2007 10:35:55 +0000 (11:35 +0100)]
CGIT 0.7

17 years agoUse GIT-1.5.3.5
Lars Hjemli [Sat, 3 Nov 2007 10:33:54 +0000 (11:33 +0100)]
Use GIT-1.5.3.5

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoDon't include current SHA1 in 'log' menu-item
Lars Hjemli [Sat, 3 Nov 2007 10:33:28 +0000 (11:33 +0100)]
Don't include current SHA1 in 'log' menu-item

This ensures that the menu-item always prints the log for the active branch.
Predictability is good.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoDon't include current path in menu links
Lars Hjemli [Sat, 3 Nov 2007 10:23:47 +0000 (11:23 +0100)]
Don't include current path in menu links

The menu-links are a lot more predictable this way.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoFix search form action/hidden fields
Lars Hjemli [Sat, 3 Nov 2007 10:15:56 +0000 (11:15 +0100)]
Fix search form action/hidden fields

The search form didn't properly honor the current path, so this commit
fixes cgit_fileurl() and add_hidden_formfields() to make the issue go
away.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd search parameters to cgit_log_link
Lars Hjemli [Sat, 3 Nov 2007 09:42:37 +0000 (10:42 +0100)]
Add search parameters to cgit_log_link

This makes the [prev] and [next] links work correctly on search results.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoFix typo in css
Shunichi Fuji [Sat, 3 Nov 2007 08:36:09 +0000 (09:36 +0100)]
Fix typo in css

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoChange the cgit layout
Lars Hjemli [Tue, 30 Oct 2007 09:47:38 +0000 (10:47 +0100)]
Change the cgit layout

This modifies and hopefully improves the layout of all cgit pages:

  * Remove the header from all pages and replace it with a sidebar;
    most pages have sufficient width but many needs more height.

  * Add a dropdown-box to switch between branches, using a one-liner
    javascript to reload the current page in context of the selected branch.

  * Include refs found below refs/archives in the sidebar, appearing as a
    set of menuitems below a 'download' heading.

  * Include the brand new cgit logo

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd config param 'index-info'
Lars Hjemli [Tue, 30 Oct 2007 09:39:59 +0000 (10:39 +0100)]
Add config param 'index-info'

This parameter will be used to include a html file in the upcoming sidebar
on the index page.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoTeach cgit_object_link() about tag objects
Lars Hjemli [Sun, 28 Oct 2007 14:40:47 +0000 (15:40 +0100)]
Teach cgit_object_link() about tag objects

This makes random tag links more helpfull, e.g. when a branch head references
a tag object, link to the tag page.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMake print_branch() handle refs not pointing at commits
Lars Hjemli [Sun, 28 Oct 2007 14:36:18 +0000 (15:36 +0100)]
Make print_branch() handle refs not pointing at commits

The master branch of stable/linux-2.6.20 currently references a tag
object, which makes print_branch() die with a segfault. This teaches
print_branch() to handle such cases more gracefully.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoTeach log search about --grep, --author and --committer
Lars Hjemli [Sun, 28 Oct 2007 14:23:00 +0000 (15:23 +0100)]
Teach log search about --grep, --author and --committer

This makes the log searching more explicit, using a dropdown box to specify
the commit field to match against.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd html_option() function
Lars Hjemli [Sun, 28 Oct 2007 11:08:45 +0000 (12:08 +0100)]
Add html_option() function

This is a generic function used to output html "option" tags.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMerge branch 'stable'
Lars Hjemli [Sat, 27 Oct 2007 11:55:44 +0000 (13:55 +0200)]
Merge branch 'stable'

* stable:
  cgit_parse_commit(): Add missing call to xstrdup()

17 years agocgit_parse_commit(): Add missing call to xstrdup()
Lars Hjemli [Sat, 27 Oct 2007 11:50:18 +0000 (13:50 +0200)]
cgit_parse_commit(): Add missing call to xstrdup()

It's rather silly to point into random memory-locations. Also, remove a
call to strdup() used on a literal char *.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoCleanup code introduced by the filter-refs topic
Lars Hjemli [Sat, 27 Oct 2007 11:34:17 +0000 (13:34 +0200)]
Cleanup code introduced by the filter-refs topic

The functions used to print branches and tags were only half-done and
somewhat confused. Fix it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMerge branch 'filter-refs'
Lars Hjemli [Sat, 27 Oct 2007 08:55:10 +0000 (10:55 +0200)]
Merge branch 'filter-refs'

* filter-refs:
  Add links to the new refs page from summary page
  Add support for refs view
  Make cgit_print_branches()/cgit_print_tags() external
  Add descriptions of summary-branches and summary-tags to cgitrc
  Add support for config param summary-branches
  Move logic for age comparision from cmp_tag_age into cmp_age()
  Add support for config param summary-tags
  Sort tags by age
  Use reflist to print tag info
  Use reflist to print branch info
  Add functions and types for ref lists

17 years agoAdd links to the new refs page from summary page
Lars Hjemli [Sat, 27 Oct 2007 08:47:44 +0000 (10:47 +0200)]
Add links to the new refs page from summary page

If either branches or tags are filtered on the summary page, add a link to
refs/heads and/or refs/tags right below the last branch/tag.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for refs view
Lars Hjemli [Sat, 27 Oct 2007 08:36:53 +0000 (10:36 +0200)]
Add support for refs view

This enables the new urls $repo/refs, $repo/refs/heads and $repo/refs/tags,
which can be used to print _all_ branches and/or tags.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMake cgit_print_branches()/cgit_print_tags() external
Lars Hjemli [Sat, 27 Oct 2007 08:25:40 +0000 (10:25 +0200)]
Make cgit_print_branches()/cgit_print_tags() external

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd descriptions of summary-branches and summary-tags to cgitrc
Lars Hjemli [Sat, 27 Oct 2007 08:15:54 +0000 (10:15 +0200)]
Add descriptions of summary-branches and summary-tags to cgitrc

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for config param summary-branches
Lars Hjemli [Sat, 27 Oct 2007 08:13:42 +0000 (10:13 +0200)]
Add support for config param summary-branches

This parameter can be used to specify max number of branches to show
on the summary page (if not all branches will be displayed, the "most
idle" branches are the ones to be pruned). The default value for this
parameter is 0, which disables the pruning.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMove logic for age comparision from cmp_tag_age into cmp_age()
Lars Hjemli [Sat, 27 Oct 2007 08:06:03 +0000 (10:06 +0200)]
Move logic for age comparision from cmp_tag_age into cmp_age()

Simple refactoring to enable later filtering of branches based on age.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for config param summary-tags
Lars Hjemli [Thu, 25 Oct 2007 08:40:16 +0000 (10:40 +0200)]
Add support for config param summary-tags

This parameter can be used to specify max number of tags to show on
the summary page. If not specified, all tags are printed.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoSort tags by age
Lars Hjemli [Thu, 25 Oct 2007 18:33:04 +0000 (20:33 +0200)]
Sort tags by age

This adds a function to compare timestamps and then uses it as callback
for qsort() before printing out tags.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUse reflist to print tag info
Lars Hjemli [Thu, 25 Oct 2007 08:28:15 +0000 (10:28 +0200)]
Use reflist to print tag info

This updates ui-summary.c to use a reflist instead of for_each_tag_ref(),
as a step towards more flexible tag handling (filtering/sorting).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoUse reflist to print branch info
Lars Hjemli [Thu, 25 Oct 2007 08:13:25 +0000 (10:13 +0200)]
Use reflist to print branch info

This updates ui-summary.c to use a reflist instead of for_each_branch_ref(),
as a step towards more flexible branch handling (filtering/sorting).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd functions and types for ref lists
Lars Hjemli [Thu, 25 Oct 2007 07:30:06 +0000 (09:30 +0200)]
Add functions and types for ref lists

This adds two structs, refinfo and reflist, and functions for building
a list of refs.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMerge branch 'stable'
Lars Hjemli [Sat, 27 Oct 2007 07:15:41 +0000 (09:15 +0200)]
Merge branch 'stable'

* stable:
  Skip unknown header fields when parsing tags and commits

17 years agoSkip unknown header fields when parsing tags and commits
Lars Hjemli [Wed, 24 Oct 2007 19:14:44 +0000 (21:14 +0200)]
Skip unknown header fields when parsing tags and commits

Both the commit- and tagparser failed to handle unexpected header fields.
This adds futureproofing by simply skipping any header we don't know/care
about.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoMerge branch 'stable'
Lars Hjemli [Fri, 5 Oct 2007 14:20:13 +0000 (16:20 +0200)]
Merge branch 'stable'

* stable:
  correct typo in CSS

17 years agocorrect typo in CSS
Michael Krelin [Thu, 4 Oct 2007 22:21:30 +0000 (00:21 +0200)]
correct typo in CSS

17 years agoMerge branch 'stable'
Lars Hjemli [Mon, 1 Oct 2007 10:51:04 +0000 (12:51 +0200)]
Merge branch 'stable'

* stable:
  Use git-1.5.3.3

17 years agoUse git-1.5.3.3
Lars Hjemli [Mon, 1 Oct 2007 10:50:07 +0000 (12:50 +0200)]
Use git-1.5.3.3

17 years agocgit.css: make diff headers more visible
Lars Hjemli [Mon, 1 Oct 2007 10:41:29 +0000 (12:41 +0200)]
cgit.css: make diff headers more visible

This modifies the background color of diff headers to make them easier to
spot.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoui-diff: add links to pre- and postversion of blobs
Lars Hjemli [Mon, 1 Oct 2007 10:30:29 +0000 (12:30 +0200)]
ui-diff: add links to pre- and postversion of blobs

Each diff header now links to the old and new version of each file

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agogen-version.sh: don't sed the output from git describe
Lars Hjemli [Mon, 1 Oct 2007 10:01:51 +0000 (12:01 +0200)]
gen-version.sh: don't sed the output from git describe

Replacing '-' with '.' makes the version name slightly confusing, so lets
stick with the unmodified output of git describe.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agocss: remove the annoying tr:hover rule for diffstat
Lars Hjemli [Mon, 1 Oct 2007 10:09:07 +0000 (12:09 +0200)]
css: remove the annoying tr:hover rule for diffstat

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoui-commit.c: link to diff instead of tree from diffstat
Lars Hjemli [Mon, 1 Oct 2007 09:54:01 +0000 (11:54 +0200)]
ui-commit.c: link to diff instead of tree from diffstat

This makes each entry in the diffstat link to a path-restricted diff.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd prefix parameter to cgit_print_diff()
Lars Hjemli [Mon, 1 Oct 2007 09:46:38 +0000 (11:46 +0200)]
Add prefix parameter to cgit_print_diff()

This allows a diff to be restricted to the path prefix specified in the url.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd prefix parameter to cgit_diff_tree()
Lars Hjemli [Mon, 1 Oct 2007 09:42:19 +0000 (11:42 +0200)]
Add prefix parameter to cgit_diff_tree()

This paramter can be used to restrict a diff to the specified path prefix.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years agoAdd support for a renamelimit option in cgitrc
Lars Hjemli [Mon, 24 Sep 2007 21:52:30 +0000 (23:52 +0200)]
Add support for a renamelimit option in cgitrc

This option can be used to override the default rename-limit in git.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>