Commit Graph

73 Commits (2c9f56f3e1c754f60ccffbc6c745b9d5a81ea005)

Author SHA1 Message Date
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>
16 years ago
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>
16 years ago
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>
16 years ago
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>
16 years ago
Lars Hjemli 2915483ef6 Fix html error detected by test-suite
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
Lars Hjemli e238ebe187 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 ago
Lars Hjemli 1a6025b7a5 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 ago
Lars Hjemli f527a57c8a 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 ago
Lars Hjemli ff13396926 Merge branch 'jo/dirlink'
* jo/dirlink:
  Rename dirlink to gitlink.

Conflicts:

	ui-tree.c

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
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>
17 years ago
Lars Hjemli c83db796a1 ui-diff: close td/tr/table properly
The previous commit fixed the diff-view when two trees where specified on
the querystring (sha1/sha2) but made the generated html invalid when only
a commit sha1 is specified. This fixes it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
Lars Hjemli 4a6201e318 ui-diff: emit table/tr/td at better locations
This fixes a bug which made the diff-link for each parent of a commit
output a diff without correct styles.

It also adds an error-message if the head commit specified on the querystring
isn't a valid commit object.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
Jeffrey C. Ollie e651cb0d2d Rename dirlink to gitlink.
Git changed from dirlink to gitlink in
302b9282c9ddfcc704ca759bdc98c1d5f75eba2f.

Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>
17 years ago
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>
17 years ago
Lars Hjemli f4f1339fe6 Don't die when diffing trees with subprojects
The subprojects needs special handling, since they refer to objects
which normally won't exist in the refering repository.

Fix some extended header bugs and missing features while at it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
Lars Hjemli f9ff7df613 Add support for commitdiff via h parameter
The commitdiff will be generated against the first parent, and the
diff page also gets the benefit of repo.defbranch.

Cleaned up some bad whitespace in cgit.h while at it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
Lars Hjemli c94afaacf4 ui-diff: show /dev/null as filename for add/delete
The diff headers showed an invalid filename when a patch created or
deleted a file. Fix it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
Lars Hjemli a342ac6b4d cgit.css: try to make diffs look a little bit nicer
This makes the diffview look more like 'git-diff' in a terminal.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
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>
17 years ago
Lars Hjemli 38a0f9cd89 Simplify ui-diff.c using the new file-level diff interface
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
Lars Hjemli 61c3ca978c Update to libgit 1.5.2-rc2
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 years ago
Lars Hjemli 66cacd053b Layout update 17 years ago
Lars Hjemli 36aba00273 Add basic diff view
Finally, xdiff is used to show per-file diffs via commit view.

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