This requires a small change to how we handle notes, but otherwise just
works.
Note that we can't use anything from v1.8.0 until v1.8.2.1 because some
of the symbols that we need for graph drawing were made private in
v1.8.0 and this was not reverted until v1.8.2.1.
Signed-off-by: John Keeping <john@keeping.me.uk>
Git does quite a lot of platform-specific detection in its Makefile,
which can result in it defining preprocessor variables that are used in
its header files. If CGit does not define the same variables it can
result in different sizes of some structures in different places in the
same application.
For example, on Solaris Git uses it's "compat" regex library which has a
different sized regex_t structure than that available in the platform
regex.h. This has a knock-on effect on the size of "struct rev_info"
and leads to hard to diagnose runtime issues.
In order to avoid all of this, introduce a "cgit.mk" file that includes
Git's Makefile and make all of the existing logic apply to CGit's
objects as well. This is slightly complicated because Git's Makefile
must run in Git's directory, so all references to CGit files need to be
prefixed with "../".
In addition, OBJECTS is a simply expanded variable in Git's Makefile so
we cannot just add our objects to it. Instead we must copy the two
applicable rules into "cgit.mk". This has the advantage that we can
split CGit-specific CFLAGS from Git's CFLAGS and hence avoid rebuilding
all of Git whenever a CGit-specific value changes.
Signed-off-by: John Keeping <john@keeping.me.uk>
Acked-by: Jamie Couture <jamie.couture@gmail.com>
Newer libgit versions depend on the libintl library. However, we
currently do not link against libintl which breaks compilation under
OpenBSD:
git/libgit.a(commit.o)(.text+0x1d1b): In function `lookup_commit_or_die':
git/gettext.h:47: undefined reference to `libintl_gettext'
[...]
Since we do not support i18n in cgit, just disable gettext in the Git
submodule to fix this.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Makefile target generation would always be included for any makefile
target that was not clean. Only care to include the '.deps' directory
when building cgit, rather than generating and including dependencies
when calling other makefile targets.
Heavily borrowed from git's Makefile, but without definitions to test
for the compiler's header dependency feature. Previous Makefile
implementation never checked for this compiler feature anyway.
- Removed makecmdgoal 'clean' check
- Grouped like .PHONY target definitions
- Place build dependency targets under .SUFFIXES
- Re-arranged location of library inclusion definitions
- Use google code mirror instead of github
Signed-off-by: Jamie Couture <jamie.couture@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Enhancements:
- path-selected submodule links
- intelligent default branch guessing
- /etc/mime.types lookup
- gitweb.* and cgit.* git-config support
- case insensitive sorting and age sorting
- commit, repository, and section sorting
- bold currently viewed page in pagination
- support BSDs in makefile
Security:
- CVE-2012-4465: heap-buffer overflow in parsing.c
- CVE-2012-4548: syntax highlighting command injection
Bug Fixes:
- transition maintainer to Jason Donenfeld (zx2c4)
- download git snapshot from github instead of Lars' old server
- css fixes
- stablization of tests
- more compatible default highlight script
- suppress gzip timestamp so that tarballs only use tar timestamps
- treat ctags as target in makefile
- do not let global variables override certain local repo settings
- print ampersand as proper html entity
- use placeholder for empty commit subject
- format diff view for addition and removal of files
- point links at correct blob from ssdiff
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
The git tarballs are currently not available from kernel.org, so for now
the makefile will download autogenerated tarballs from cgit.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
OpenBSD tar(1) defaults to read from "/dev/rst0" when not specifying an
filename and thus fails to extract the Git sourcecode when not passing
stdin as input file descriptor explicitly.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Work around errors `make` gives when header files are removed without
the Makefile being updated.
Signed-off-by: Lynn Lin <Lynn.Lin@emc.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
The syntax-highlighting.sh script is quite useful without any changes.
Installing it by default makes it easier to use and package.
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This borrows from the git Documentation/Makefile. The goal is to make
it easier to add new man pages and other documentation as well as to
prevent make from re-generating the documentation needlessly.
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
There were many places where the arguments to a printf-like function did
not match the format string. Mostly, these were a missing 'l' flag, but
there were three exceptions:
- In ui-stats.c, a size_t argument must be printed. C99 has the "%zu"
flag for this purpose, but not all compilers support this. Therefore,
we mimic what git does - use a NO_C99_FORMAT Makefile variable.
- In ui-stats.c, cgit_print_error() was called with a pointer instead of
a character.
- In ui-log.c, the "columns" argument was never used.
Signed-off-by: Mark Lodato <lodatom@gmail.com>
Linking with OpenSSL is not always desirable. Add NO_OPENSSL option
to use SHA-1 code bundled with Git.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
This constitutes the first prototype of a side-by-side diff. It is not
possible to switch between unidiff and side-by-side diff at all at this
stage.
Signed-off-by: Ragnar Ouchterlony <ragnar@lysator.liu.se>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
CGIT_DATA_PATH defaults to CGIT_SCRIPT_PATH, but allows users to
install the cgi and the data files in different locations.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
We don't need support for fetching/pushing in libgit.a, hence we don't need
to link with libcurl.
Noticed-by: Robin Redeker <elmex@ta-sa.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This new page, which is disabled by default, can be used to print some
statistics about the number of commits per period in the repository,
where period can be either weeks, months, quarters or years.
The function can be activated globally by setting 'enable-stats=1' in
cgitrc and disabled for individual repos by setting 'repo.enable-stats=0'.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
If the makefile doesn't automatically define the correct build variables
it is nice to be able to define them explicitly.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This will allow for creating static builds which is useful for chrooted
environments.
Signed-off-by: Harley Laue <losinggeneration@gmail.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This option makes cgit scan a directory tree looking for git repositories,
generating suitable definitions for a cgitrc file on stdout.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
In commit a1266edfe the build instructions for the git libs where moved
to their real targets, which in turn depended on the phony target `git`.
But since `git` is an actual directory in cgit the git libs wouldn't be
recompiled when needed.
So with this patch (third time lucky), cgit is declared to depend on the
really phony target `libgit` and the build instructions for `libgit` is
to unconditionally rebuild git/libgit.a and git/xdiff/lib.a.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This patch implements basic support for cloning over http, based on the
work on git-http-backend by Shawn O. Pearce.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This enables a page which generates atom feeds for the current branch and
path, heavily inspired by the atom-support in gitweb.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
When building cgit we depend on xdiff/lib.a and libgit.a in the git
directory, but the previous attempt on describing this dependency
failed since the build instructions for the libs was placed under the
phony `git` target.
This patch fixes the issue by moving the build instructions to their
real targets. It also makes it clear that only the `cgit` target
depends on the git binaries (since they're only used during linking).
And while at it, the patch also cleans up the list of phony targets.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
The objectfiles depends unconditionally on some specific git binaries while
those git binaries depends on the phony `git` target and this patch seems to
get these dependencies spelled out correctly.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* lh/cleanup: (21 commits)
Reset ctx.repo to NULL when the config parser is finished
Move cgit_parse_query() from parsing.c to html.c as http_parse_querystring()
Move function for configfile parsing into configfile.[ch]
Add cache.h
Remove global and obsolete cgit_cmd
Makefile: copy the QUIET constructs from the Makefile in git.git
Move cgit_version from shared.c to cgit.c
Makefile: autobuild dependency rules
Initial Makefile cleanup
Move non-generic functions from shared.c to cgit.c
Add ui-shared.h
Add separate header-files for each page/view
Refactor snapshot support
Add command dispatcher
Remove obsolete cacheitem parameter to ui-functions
Add struct cgit_page to cgit_context
Introduce html.h
Improve initialization of git directory
Move cgit_repo into cgit_context
Add all config variables into struct cgit_context
...
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>