Gráfico de commits

57 Commits

Autor SHA1 Mensagem Data
Lars Hjemli
37a24e4e39 Merge branch 'jh/path-limit'
Conflicts:
	cgit.h
	ui-commit.c
2010-06-22 16:15:48 +02:00
Johan Herland
685872b770 ui-commit: Preserve path limit in links to commit page
This includes adding a path argument to cgit_commit_link() and updating all
its callers. The callers from within the commit page (i.e. the "commit",
"unidiff"/"side-by-side diff" and "parent" links) all preserve the path
limit of the current commit page. All other callers pass NULL (i.e. no path
limit).

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2010-06-19 10:40:24 +02:00
Johan Herland
34c2331d2c ui-commit: Preserve path limit in links to tree and diff pages
For tree links, the original link is unchanged, but in the case of a path
limit, a subtree link is added to the right of the original tree link.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2010-06-19 10:40:23 +02:00
Johan Herland
eac1b67541 ui-patch: Apply path limit to generated patch
Also indicate in the comment section of the patch that a path limit was
applied, too easily see when a generated patch is only partial.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2010-06-19 10:40:23 +02:00
Johan Herland
ab42741c49 ui-commit: Limit diff based on path limit in qry.path
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2010-06-19 10:40:23 +02:00
Lars Hjemli
581a0c2a54 Optionally generate verbose parent links
The new option 'enable-subject-links' must be used to enable the verbose
parent-links in commit view.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2010-02-27 13:12:55 +01:00
Stefan Naewe
e15842af62 display subject instead of sha1 as link title of parents
Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2010-02-27 12:55:16 +01:00
Ragnar Ouchterlony
c358aa3dfe Add possibility to switch between unidiff and side-by-side-diff.
A new config option side-by-side-diffs added, defaulting to 0,
meaning unidiff. Also a query option (ss) is used toggle this.

In the commit page you can switch between the two diff formats by
clicking on the link on the "commit"-row, to the right of (patch).

In the diff page you can switch by using the link at the start
of the page.

All commit-links and diff-links will remember the choice.

Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-09-16 20:17:56 +02:00
Lars Hjemli
45c49d6cf4 Use GIT-1.6.4.3
Signed-off-by: Lars Hjemli <larsh@slackbox.hjemli.net>
2009-09-13 21:56:45 +02:00
Lars Hjemli
db6303b588 Merge branch 'lh/plugins'
Conflicts:
	cgit.c
	cgit.h
2009-08-09 13:46:01 +02:00
Lars Hjemli
e976df2795 Add support for repo.commit-filter and repo.source-filter
These options can be used to override the default commit- and source-
filter settings per repository.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-08-09 13:22:00 +02:00
Martin Szulecki
2f56e390f0 Introduce noplainemail option to hide email adresses from spambots
Signed-off-by: Martin Szulecki <opensuse@sukimashita.com>
2009-08-08 14:23:28 +02:00
Lars Hjemli
f35db1cd2b ui-commit: add support for 'commit-filter' option
This new option specifies a filter which is executed on the commit
message, i.e. the commit message is written to the filters STDIN and
the filters STDOUT is included verbatim as the commit message.

This can be used to implement commit linking by creating a simple
shell script in e.g. /usr/bin/cgit-commit-filter.sh like this:

#/bin/sh
sed -re 's|\b([0-9a-fA-F]{6,40})\b|<a href="./?id=\1">\1</a>|g'

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2009-07-31 17:42:57 +02:00
Justin Waters
0027e38b40 Add decorations to commit pages
This adds the tag and branch head decorations to the commit pages.  This is
similar to how commits are displayed in the standard gitweb interface.

Signed-off-by: Justin Waters <justin.waters@timesys.com>
2009-01-27 22:45:47 +01:00
Stefan Naewe
0f0ab148c6 Added local-time option to cgitrc
When `local-time` is set, commit, tag and patch timestamps will be printed
in the servers timezone. Also, regardless of the value of `local-time`,
these timestamps will now always show the timezone.

Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2008-08-01 22:09:13 +02:00
Lars Hjemli
502d57596e ui-commit: handle root commits
Both cgit_print_diff() and cgit_diff_tree() handles root commits nicely,
but cgit_print_commit() forgot to check the case of 0 parents.

This fixes it, and adds tests to avoid future regressions.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2008-05-18 21:13:21 +02:00
Lars Hjemli
fe1230dece Integrate diffstat with diff
This creates a generic diffstat function in ui-diff, which then is
invoked from cgit_print_diff with the result that both commit and diff-
view gets a diffstat.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2008-04-24 23:41:32 +02:00
Lars Hjemli
9ec5cd7944 Fix commitdiff annoyance
Someone were a bit sloppy when the commitdiff got included 'inline' in
commit 89aa3c0d0a. This patch deletes a
stray `)` and makes sure the diffstat summary `<div>` is closed before
the full diff is printed.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2008-04-17 18:33:33 +02:00
Lars Hjemli
39912a24ed Remove 'patch' link from tab, add to commit view
It's a bit confusing to enter the patch view from the tab, since it has no
layout. And the commit view has always lacked showing the commit id. Both of
these warts are fixed by this commit, which adds a new header line in the
commit view which shows the commit id as a 'permalink' to the current commit
and also adds a link to the patch view of the current commit.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2008-04-13 12:20:00 +02:00
Lars Hjemli
89aa3c0d0a Include diff in commit view
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2008-04-12 20:00:40 +02:00
Lars Hjemli
a4d1ca1dc6 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>
2008-03-24 16:50:57 +01:00
Lars Hjemli
b1f9b9c145 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>
2008-03-18 08:13:10 +01:00
Lars Hjemli
d1f3bbe9d2 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>
2008-02-16 13:56:09 +01:00
Lars Hjemli
d14d77fe95 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>
2008-02-16 12:07:28 +01:00
Lars Hjemli
2915483ef6 Fix html error detected by test-suite
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-11-11 13:04:28 +01:00
Lars Hjemli
0ec8791ca0 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>
2007-10-01 11:54:01 +02:00
Lars Hjemli
eb45342e73 cgit_print_snapshot_links: use url to specify snapshot name
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-07-23 00:27:32 +02:00
Michael Krelin
dc3c9b5bc4 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>
2007-07-21 18:00:53 +02:00
Michael Krelin
f97c707a3b 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
2007-07-18 14:40:03 +02:00
Lars Hjemli
4a0be58666 Add cgit_diff_link()
This adds a new function used to generate links to the diff page and uses
it everywhere such links appear (expect for single files in the diffstat
displayed on the commit page: this is now a link to the tree page).

The updated diff-page now expects zero, one or two revision specifiers, in
parameters head, id and id2. Id defaults to head unless otherwise specified,
while head (as usual) defaults to repo.defbranch. If id2 isn't specified, it
defaults to the first parent of id1.

The most important change is of course that now all repo pages (summary, log,
tree, commit and diff) has support for passing on the current branch and
revision, i.e. the road is now open for a 'static' menu with links to all
of these pages.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-17 18:12:03 +02:00
Lars Hjemli
faaca447b0 ui-commit: use cgit_commit_link() for parent links
This replaces the old cgit_pageurl() function with the brand new
cgit_commit_link() function, making parent links in commit view preserve
the current branch.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-17 15:44:22 +02:00
Lars Hjemli
42a7eb9c73 Add cgit_commit_link() + support for id=sha1 to commit view
This adds a function to generate links to the commit page and extends said
page to use id from querystring as primary revision specified (fallback to
h).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-17 14:53:02 +02:00
Lars Hjemli
44947bfcdc Add and use cgit_tree_link()
This creates a new function used to generate links to 'tree' page and uses
the function everywhere a link to the 'tree' page is generated.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-06-17 01:39:05 +02:00
Lars Hjemli
ffc69736a6 ui-tree: unify with ui-view, use path to select tree/blob
This teaches ui-tree to show both trees and blobs, thereby making ui-view
superfluous. At the same time, ui-tree is extended to honour the specified
path instead of requiering a tree/blob sha1.
2007-06-16 20:20:42 +02:00
Ondrej Jirman
1a63cfcc3d Use &amp; instead of & in URLs.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-31 10:18:38 +02:00
Ondrej Jirman
0928d8827a Fixed unexpected tags in html output.
At least those that were catched by tidy.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-31 10:18:00 +02:00
Lars Hjemli
5db39170b6 Add cgit_print_age() function
This function can be used to print relative dates, just as in gitweb. Next
step will be to actually use the new function.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-22 23:12:41 +02:00
Lars Hjemli
dff894d129 Add link to commitdiff below diffstat
This link is a lot easier to locate than the links to the right of the
parent entries.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-16 01:16:56 +02:00
Lars Hjemli
a2ddc10479 Change commit-view to expect h parameter, not id
The change makes the commit-page benefit from repo.defbranch.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-16 00:26:23 +02:00
Lars Hjemli
e903011c44 Use tables and css to create the diffstat graph, fix scaling
There was no need to use image-files for the graphs, so lets drop them.
At the same time, fix scaling of the graphs so that the full width is
used only if atleast 100 LOC are changed in one of the files.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-15 09:09:42 +02:00
Lars Hjemli
9927e63f38 Specify static storage class for file-local declarations
Also fix some whitespace issues while at it.

Noticed by Kristian Høgsberg <krh@bitplanet.net>

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-15 00:00:37 +02:00
Lars Hjemli
9fb53af215 Add log filtering by path and link to it from tree view
This enables path-filtering in log-view, and adds a link per entry in
tree-view to show the log for each file/directory.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-14 11:13:18 +02:00
Lars Hjemli
6a8749d3bd Add commitdiff between commit and each of it's parent
A link is added next to each parent of a commit, leading to the new
diff-functionality in ui-diff.c.

Also added support for a path-parameter to filelevel diffs accessed via the
diffstat.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-13 23:27:53 +02:00
Lars Hjemli
8a3685bcf2 Add graphical diffstat to commit view
The diffstat is calculated against the leftmost parent of the commit. This
gives nice information for "normal" merges while octopus merges are less
than optimal, so the diffstat isn't calculated for those merges.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-13 22:31:11 +02:00
Lars Hjemli
ae4c1ee113 Use standard tree-diff function when showing diffstat for single commit
Remove unneeded code from ui-commit.c and replace with call to standard
diff-functions.

Also fix some whitespace issues.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-05-13 11:30:18 +02:00
Lars Hjemli
ac70cb4795 Make snapshot feature configurable
Snapshots can now be enabled/disabled by default for all repositories in
cgitrc with param "snapshots". Additionally, any repo can override the
default setting with param "repo.snapshots".

By default, no snapshotting is enabled.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2007-02-08 14:47:56 +01:00
Lars Hjemli
ab2ab95f09 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>
2007-02-08 13:58:58 +01:00
Lars Hjemli
2efee09abe Add missing diff-link in ui-commit.c
Gaah.

This should have been a part of 36aba00273

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-22 01:38:37 +01:00
Lars Hjemli
fb6e5869dc Don't show new and old filemode for added/removed files
It gives us no extra info whatsoever to show "----------" for either new
or old mode, it's just noise (especially since we now show the "old"
filemode for deleted files)

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-17 23:30:55 +01:00
Lars Hjemli
6cb326c83b Show list of modified files in ui-commit.c
Compare current commit with 1.parent, and for each affected file display
current filemode, old filemode if changed, current filename and source
filename if it was a copy/rename.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
2006-12-17 23:07:28 +01:00