]> granicus.if.org Git - cgit/log
cgit
6 years agoui-blame: Make each column into a single table cell
Jeff Smith [Wed, 18 Oct 2017 04:17:34 +0000 (23:17 -0500)]
ui-blame: Make each column into a single table cell

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: John Keeping <john@keeping.me.uk>
6 years agoui-blame: Break out emit_blame_entry into component methods
Jeff Smith [Wed, 18 Oct 2017 04:17:33 +0000 (23:17 -0500)]
ui-blame: Break out emit_blame_entry into component methods

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: John Keeping <john@keeping.me.uk>
6 years agoui-blame: Distinguish hashes column from lines column
Jeff Smith [Wed, 18 Oct 2017 04:17:32 +0000 (23:17 -0500)]
ui-blame: Distinguish hashes column from lines column

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: John Keeping <john@keeping.me.uk>
6 years agogit: update to v2.16.0
Christian Hesse [Thu, 18 Jan 2018 08:19:31 +0000 (09:19 +0100)]
git: update to v2.16.0

Update to git version v2.16.0:

* refs: convert resolve_ref_unsafe to struct object_id
  (49e61479be913f67e66bb3fdf8de9475c41b58bd)
* diff: remove DIFF_OPT_SET macro
  (23dcf77f48feb49c54bad09210f093a799816334)
* log: add option to choose which refs to decorate
  (65516f586b69307f977cd67cc45513a296cabc25)
* diff: convert flags to be stored in bitfields
  (02f2f56bc377c287c411947d0e1482aac888f8db)

Signed-off-by: Christian Hesse <mail@eworm.de>
7 years agogit: update to v2.15.1
Christian Hesse [Wed, 29 Nov 2017 21:25:42 +0000 (22:25 +0100)]
git: update to v2.15.1

Update to git version v2.15.1: With commit 0abe14f6 prepare_packed_git()
moved to packfile.[ch].

Signed-off-by: Christian Hesse <mail@eworm.de>
Reviewed-by: John Keeping <john@keeping.me.uk>
7 years agoglobal: spelling fixes
Ville Skyttä [Sat, 14 Oct 2017 19:05:51 +0000 (22:05 +0300)]
global: spelling fixes

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
7 years agoui-shared: use type='search' for the search box
Ville Skyttä [Sat, 14 Oct 2017 19:02:16 +0000 (22:02 +0300)]
ui-shared: use type='search' for the search box

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
7 years agofilter: pipe_fh should be local
Jason A. Donenfeld [Sat, 14 Oct 2017 14:13:07 +0000 (16:13 +0200)]
filter: pipe_fh should be local

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agoparsing: don't clear existing state with empty input
John Keeping [Sat, 14 Oct 2017 12:02:53 +0000 (13:02 +0100)]
parsing: don't clear existing state with empty input

Since commit c699866 (parsing: clear query path before starting,
2017-02-19), we clear the "page" variable simply by calling
cgit_parse_url() even if the URL is empty.  This breaks a URL like:

.../cgit?p=about

which is generated when using the "root-readme" configuration option.

This happens because "page" is set to "about" when parsing the query
string before we handle the path (which is empty, but non-null).

It turns out that this is not the only case which is broken, but
specifying repository and page via query options has been broken since
before the commit mentioned above, for example:

.../cgit?r=git&p=log

Fix both of these by allowing the previous state to persist if PATH_INFO
is empty, falling back to the query parameters if no path has been
requested.

Reported-by: Tom Ryder <tom@sanctum.geek.nz>
Signed-off-by: John Keeping <john@keeping.me.uk>
7 years agoui-tree: link to blame UI if enabled
Jeff Smith [Mon, 2 Oct 2017 04:39:09 +0000 (23:39 -0500)]
ui-tree: link to blame UI if enabled

Create links to the blame page.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: John Keeping <john@keeping.me.uk>
7 years agoui-blame: add blame UI
Jeff Smith [Mon, 2 Oct 2017 04:39:08 +0000 (23:39 -0500)]
ui-blame: add blame UI

Implement a page which provides the blame view of a specified file.

This feature is controlled by a new config variable, "enable-blame",
which is disabled by default.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: John Keeping <john@keeping.me.uk>
7 years agoui-shared: make a char* parameter const
Jeff Smith [Mon, 2 Oct 2017 04:39:07 +0000 (23:39 -0500)]
ui-shared: make a char* parameter const

All cgit_xxx_link functions take const char* for the 'name' parameter,
except for cgit_commit_link, which takes a char* and subsequently
modifies the contents.  Avoiding the content changes, and making it
const char* will avoid the need to make copies of const char* strings
being passed to cgit_commit_link.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: John Keeping <john@keeping.me.uk>
7 years agoui-tree: move set_title_from_path to ui-shared
Jeff Smith [Mon, 2 Oct 2017 04:39:06 +0000 (23:39 -0500)]
ui-tree: move set_title_from_path to ui-shared

The ui-blame code will also need to call set_title_from_path, so go
ahead and move it to ui-shared.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: John Keeping <john@keeping.me.uk>
7 years agohtml: html_ntxt with no ellipsis
Jeff Smith [Mon, 2 Oct 2017 04:39:05 +0000 (23:39 -0500)]
html: html_ntxt with no ellipsis

For implementing a ui-blame page, there is need for a function that
outputs a selection from a block of text, transformed for HTML output,
but with no further modifications or additions.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Reviewed-by: John Keeping <john@keeping.me.uk>
7 years agocache: flush stdio before restoring FDs
John Keeping [Mon, 24 Apr 2017 18:38:34 +0000 (19:38 +0100)]
cache: flush stdio before restoring FDs

As described in commit 2efb59e (ui-patch: Flush stdout after outputting
data, 2014-06-11), we need to ensure that stdout is flushed before
restoring the file descriptor when writing to the cache.  It turns out
that it's not just ui-patch that is affected by this but also raw diff
which writes to stdout internally.

Let's avoid risking more places doing this by ensuring that stdout is
flushed after writing in fill_slot().

Signed-off-by: John Keeping <john@keeping.me.uk>
7 years agoUse https for submodule
Daniel M. Weeks [Wed, 20 Sep 2017 15:17:29 +0000 (11:17 -0400)]
Use https for submodule

The git protocol provides no transport security. https does provide
transport security and should be preferred by default. https is also
more likely than git to be permitted by firewalls in restricted
environments.

Signed-off-by: Daniel M. Weeks <dan@danweeks.net>
7 years agoui-plain: print symlink content
John Keeping [Mon, 6 Mar 2017 23:27:23 +0000 (23:27 +0000)]
ui-plain: print symlink content

We currently ignore symlinks in ui-plain, leading to a 404.  In ui-tree
we print the content of the blob (that is, the path to the target of the
link), so it makes sense to do the same here.

Signed-off-by: John Keeping <john@keeping.me.uk>
7 years agocgit: don't set vpath unless repo is set
John Keeping [Sun, 19 Feb 2017 12:02:37 +0000 (12:02 +0000)]
cgit: don't set vpath unless repo is set

After the previous two patches, this can be classified as a tidy up
rather than a bug fix, but I think it makes sense to group all of the
tests together before setting up the environment for the command to
execute.

Signed-off-by: John Keeping <john@keeping.me.uk>
7 years agoparsing: clear query path before starting
John Keeping [Sun, 19 Feb 2017 12:17:05 +0000 (12:17 +0000)]
parsing: clear query path before starting

By specifying the "url" query parameter multiple times it is possible to
end up with ctx.qry.vpath set while ctx.repo is null, which triggers an
invalid code path from cgit_print_pageheader() while printing path
crumbs, resulting in a null dereference.

The previous patch fixed this segfault, but it makes no sense for us to
clear ctx.repo while leaving ctx.qry.path set to the previous value, so
let's just clear it here so that the last "url" parameter given takes
full effect rather than partially overriding the effect of the previous
value.

Signed-off-by: John Keeping <john@keeping.me.uk>
7 years agoui-shared: don't print path crumbs without a repo
John Keeping [Sun, 19 Feb 2017 12:27:48 +0000 (12:27 +0000)]
ui-shared: don't print path crumbs without a repo

cgit_print_path_crumbs() can call repolink() which assumes that ctx.repo
is non-null.  Currently we don't have any commands that set want_vpath
without also setting want_repo so it shouldn't be possible to fail this
test, but the check in cgit.c is in the wrong order so it is possible to
specify a query string like "?p=log&path=foo/bar" to end up here without
a valid repository.

This was found by American fuzzy lop [0].

[0] http://lcamtuf.coredump.cx/afl/

Signed-off-by: John Keeping <john@keeping.me.uk>
7 years agoui-atom: properly escape delimiter in page link
John Keeping [Sun, 15 Jan 2017 12:29:38 +0000 (12:29 +0000)]
ui-atom: properly escape delimiter in page link

If the delimiter here is '&' then it needs to be escaped for inclusion
in an attribute.  Use html_attrf() to ensure that this happens (we know
that hex won't need escaping, but this makes it clearer what's
happening.

Signed-off-by: John Keeping <john@keeping.me.uk>
7 years agogit: update to v2.14
Jeff Smith [Thu, 10 Aug 2017 00:02:56 +0000 (19:02 -0500)]
git: update to v2.14

Numerous changes were made to git functions to use an object_id
structure rather than sending sha1 hashes as raw unsigned character
arrays.  The functions that affect cgit are: parse_object,
lookup_commit_reference, lookup_tag, lookup_tree, parse_tree_indirect,
diff_root_tree_sha1, diff_tree_sha1, and format_display_notes.

Commit b2141fc (config: don't include config.h by default) made it
necessary to that config.h be explicitly included when needed.

Commit 07a3d41 (grep: remove regflags from the public grep_opt API)
removed one way of specifying the ignore-case grep option.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
7 years agogit: update to v2.13.4
Christian Hesse [Mon, 24 Jul 2017 15:22:52 +0000 (17:22 +0200)]
git: update to v2.13.4

Update to git version v2.13.4: With commit 8aee769f (pathspec: copy and free
owned memory) the definition of struct pathspec_item has changed with the
expectation that pathspecs will be managed dynamically. We work around this
a bit by setting up a static structure, but let's allocate the match string
to avoid needing to cast away const.

Updated a patch from John Keeping <john@keeping.me.uk> for git v2.12.1.

7 years agoUpdate .mailmap with my new email address
Lukas Fleischer [Thu, 27 Jul 2017 14:20:15 +0000 (16:20 +0200)]
Update .mailmap with my new email address

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
7 years agoRemove unused variable from sort_section()
Lukas Fleischer [Wed, 5 Apr 2017 04:38:27 +0000 (06:38 +0200)]
Remove unused variable from sort_section()

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
7 years agoui-repolist: properly sort by age
Jason A. Donenfeld [Thu, 30 Mar 2017 11:19:50 +0000 (13:19 +0200)]
ui-repolist: properly sort by age

When empty repos exist, comparing them against an existing repo with a
good mtime might, with particular qsort implementations, not sort
correctly, because of this brokenness:

   if (get_repo_modtime(r1, &t) && get_repo_modtime(r2, &t))

However, sorting by the age column works as expected, so anyway, to tidy
things up, we simply reuse that function.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
7 years agoui-patch: fix crash when using path limit
Lukas Fleischer [Thu, 24 Nov 2016 19:14:54 +0000 (20:14 +0100)]
ui-patch: fix crash when using path limit

The array passed to setup_revisions() must be NULL-terminated. Fixes a
regression introduced in 455b598 (ui-patch.c: Use log_tree_commit() to
generate diffs, 2013-08-20).

Reported-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
7 years agosyntax-highlighting: replace invalid unicode with ?
Jason A. Donenfeld [Sun, 22 Jan 2017 11:44:44 +0000 (12:44 +0100)]
syntax-highlighting: replace invalid unicode with ?

8 years agogit: update to v2.11.0
Christian Hesse [Wed, 30 Nov 2016 09:43:08 +0000 (10:43 +0100)]
git: update to v2.11.0

Update to git version v2.11.0. Function write_archive()
dropped argument (int setup_prefix).

8 years agoLink with -ldl on GNU Hurd
Peter Colberg [Fri, 25 Nov 2016 20:57:11 +0000 (15:57 -0500)]
Link with -ldl on GNU Hurd

Debian GNU/Hurd uses the GNU C library.

Signed-off-by: Peter Colberg <peter@colberg.org>
8 years agogit: update to v2.10.2 again
John Keeping [Thu, 24 Nov 2016 18:59:42 +0000 (18:59 +0000)]
git: update to v2.10.2 again

The submodule was accidentally downgraded in commit 8e9ddd21 (Bump
version, 2016-11-23).  Restore v2.10.2 so it matches the makefile again.

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoBump version. v1.1
Jason A. Donenfeld [Wed, 23 Nov 2016 04:24:26 +0000 (05:24 +0100)]
Bump version.

8 years agocss: highlight even table rows and skip empty rows
Christian Hesse [Wed, 6 Jul 2016 20:42:36 +0000 (22:42 +0200)]
css: highlight even table rows and skip empty rows

This is stolen from kernel.org css [0].

[0] https://git.kernel.org/cgit-korg-0.10.1.css

8 years agogit: update to v2.10.2
Christian Hesse [Sun, 6 Nov 2016 20:47:04 +0000 (21:47 +0100)]
git: update to v2.10.2

Update to git version v2.10.2, no changes required.

8 years agoui-blog: fix oid handling
Christian Hesse [Tue, 11 Oct 2016 06:55:34 +0000 (08:55 +0200)]
ui-blog: fix oid handling

We have to use a pointer for walk_tree_ctx->matched_oid.

This fixes faulty commit 6e4b7b6776eb994e795fa38b2619db6c55e10ecc
(ui-blob: replace 'unsigned char sha1[20]' with 'struct object_id oid').

8 years agoshared: remove unused function strlpart()
Christian Hesse [Mon, 10 Oct 2016 18:33:30 +0000 (20:33 +0200)]
shared: remove unused function strlpart()

8 years agoshared: remove unused function strrpart()
Christian Hesse [Mon, 10 Oct 2016 18:32:17 +0000 (20:32 +0200)]
shared: remove unused function strrpart()

8 years agoui-repolist: fix memory leak
Christian Hesse [Mon, 10 Oct 2016 18:17:51 +0000 (20:17 +0200)]
ui-repolist: fix memory leak

8 years agoUse skip_prefix() to get rid of magic constants
Lukas Fleischer [Sat, 8 Oct 2016 13:45:12 +0000 (15:45 +0200)]
Use skip_prefix() to get rid of magic constants

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
8 years agopatch: reapply path limit
John Keeping [Mon, 14 Mar 2016 22:41:14 +0000 (22:41 +0000)]
patch: reapply path limit

This was originally applied added in commit eac1b67 (ui-patch: Apply
path limit to generated patch, 2010-06-10) but the ability to limit
patches to particular paths was lost in commit 455b598 (ui-patch.c: Use
log_tree_commit() to generate diffs, 2013-08-20).

The new output is slightly different from the original because Git's
diff infrastructure doesn't give us a way to insert an annotation
immediately after the "---" separator, so the commit has moved below the
diff stat.

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoui-repolist: fix memory leak
Christian Hesse [Fri, 7 Oct 2016 13:08:53 +0000 (15:08 +0200)]
ui-repolist: fix memory leak

8 years agogit: update to v2.10.1
Christian Hesse [Tue, 4 Oct 2016 06:51:05 +0000 (08:51 +0200)]
git: update to v2.10.1

Update to git version v2.10.1, no changes required.

8 years agoui-tree: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Christian Hesse [Thu, 29 Sep 2016 20:17:07 +0000 (22:17 +0200)]
ui-tree: replace 'unsigned char sha1[20]' with 'struct object_id oid'

Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...

8 years agoui-tag: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Christian Hesse [Thu, 29 Sep 2016 20:14:28 +0000 (22:14 +0200)]
ui-tag: replace 'unsigned char sha1[20]' with 'struct object_id oid'

Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...

8 years agoui-snapshot: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Christian Hesse [Thu, 29 Sep 2016 20:12:11 +0000 (22:12 +0200)]
ui-snapshot: replace 'unsigned char sha1[20]' with 'struct object_id oid'

Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...

8 years agoui-shared: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Christian Hesse [Thu, 29 Sep 2016 20:10:21 +0000 (22:10 +0200)]
ui-shared: replace 'unsigned char sha1[20]' with 'struct object_id oid'

Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...

8 years agoui-plain: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Christian Hesse [Thu, 29 Sep 2016 20:08:19 +0000 (22:08 +0200)]
ui-plain: replace 'unsigned char sha1[20]' with 'struct object_id oid'

Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...

8 years agoui-patch: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Christian Hesse [Thu, 29 Sep 2016 19:51:41 +0000 (21:51 +0200)]
ui-patch: replace 'unsigned char sha1[20]' with 'struct object_id oid'

Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...

8 years agoui-log: replace get_sha1() with get_oid()
Christian Hesse [Thu, 29 Sep 2016 19:44:41 +0000 (21:44 +0200)]
ui-log: replace get_sha1() with get_oid()

Data structures have been replaced already, so use correct function calls.

8 years agoui-commit: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Christian Hesse [Thu, 29 Sep 2016 19:41:09 +0000 (21:41 +0200)]
ui-commit: replace 'unsigned char sha1[20]' with 'struct object_id oid'

Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...

8 years agoui-blob: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Christian Hesse [Thu, 29 Sep 2016 19:38:49 +0000 (21:38 +0200)]
ui-blob: replace 'unsigned char sha1[20]' with 'struct object_id oid'

Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...

In addition replace memmove() with hashcpy().

8 years agocgit: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Christian Hesse [Thu, 29 Sep 2016 19:16:14 +0000 (21:16 +0200)]
cgit: replace 'unsigned char sha1[20]' with 'struct object_id oid'

Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id
oid'. We have some code that can be changed independent from upstream. So
here we go...

8 years agoMakefile: remove extra space
Jason A. Donenfeld [Sat, 1 Oct 2016 21:35:04 +0000 (23:35 +0200)]
Makefile: remove extra space

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoSimplify http_parse_querystring()
Lukas Fleischer [Thu, 29 Sep 2016 06:38:45 +0000 (08:38 +0200)]
Simplify http_parse_querystring()

Instead of reimplementing URL parameter parsing from scratch, use
url_decode_parameter_name() and url_decode_parameter_value() which are
already provided by Git.

Also, change the return type of http_parse_querystring() to void since
its only caller already ignores the return value.

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
8 years agoui-tree: remove a fixed size buffer
John Keeping [Sat, 13 Aug 2016 10:54:46 +0000 (11:54 +0100)]
ui-tree: remove a fixed size buffer

As libgit.a moves away from using fixed size buffers, there is no
guarantee that PATH_MAX is sufficient for all of the paths in a Git
tree, so we should use a dynamically sized buffer here.

Coverity-Id: 141884
Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoui-tag: clean up taginfo
John Keeping [Sat, 13 Aug 2016 10:53:24 +0000 (11:53 +0100)]
ui-tag: clean up taginfo

Free the taginfo when we're done with it.  Also reduce the scope of a
couple of variables so that it's clear that this is the only path that
uses the taginfo structure.

Coverity-Id: 141883
Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoshared: make cgit_free_taginfo() public
John Keeping [Sat, 13 Aug 2016 10:52:51 +0000 (11:52 +0100)]
shared: make cgit_free_taginfo() public

We will use this function from ui-tag.c in the next patch.

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoshared: remove return value from cgit_free_commitinfo()
John Keeping [Sat, 13 Aug 2016 10:51:58 +0000 (11:51 +0100)]
shared: remove return value from cgit_free_commitinfo()

This return value is never used and the function always returns NULL.

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agotree: allow skipping through single-child trees
John Keeping [Wed, 13 Jul 2016 19:19:42 +0000 (20:19 +0100)]
tree: allow skipping through single-child trees

If we have only a single element in a directory (for example in Java
package paths), display multiple directories in one go so that it is
possible to navigate directly to the first directory that contains
either files or multiple directories.

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoui-ssdiff: fix decl-after-statement warnings
John Keeping [Sun, 7 Aug 2016 15:14:49 +0000 (16:14 +0100)]
ui-ssdiff: fix decl-after-statement warnings

git.git's coding style avoids decl-after-statement and we generally try
to follow it but a few warnings have crept in recently.  Fix the one in
ui-ssdiff.c

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoui-shared: fix decl-after-statement warnings
John Keeping [Sun, 7 Aug 2016 15:13:30 +0000 (16:13 +0100)]
ui-shared: fix decl-after-statement warnings

git.git's coding style avoids decl-after-statement and we generally try
to follow it but a few warnings have crept in recently.  Fix the ones in
ui-shared.c

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoconfigfile: fix EOF handling
John Keeping [Sun, 7 Aug 2016 14:54:14 +0000 (15:54 +0100)]
configfile: fix EOF handling

Currently we can end up passing EOF to isspace(), which is in fact
libgit's sane_isspace which does:

((sane_ctype[(unsigned char)(x)] & (GIT_SPACE)) != 0)

It is very unlikely that EOF cast to "unsigned char" will end up in a
character that has the GIT_SPACE bit set, but the standard only requires
that EOF be a negative integer, so it could access any value in the
sane_ctype array.

If it does end up returning true for isspace() then this loop will never
terminate, so handle EOF as a special value in the same way as the other
loops in this function.

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agogit: update to v2.10.0
Christian Hesse [Sun, 4 Sep 2016 10:38:18 +0000 (12:38 +0200)]
git: update to v2.10.0

Upstream continues to replace unsigned char *sha1 with struct
object_id old_oid. This makes the required changes.

The git lib has its own main function now. Rename our main function
to cmd_main, it is called from main then.

8 years agoFix qry.head leak on error
Richard Maw [Sat, 2 Jul 2016 19:28:10 +0000 (20:28 +0100)]
Fix qry.head leak on error

This is run soon before exiting so it wasn't leaked for long.

Signed-off-by: Richard Maw <richard.maw@gmail.com>
8 years agogit: update to v2.9.1
Christian Hesse [Mon, 11 Jul 2016 22:42:41 +0000 (00:42 +0200)]
git: update to v2.9.1

Update to git version v2.9.1, no changes required.

Signed-off-by: Christian Hesse <mail@eworm.de>
8 years agoLink with -ldl on GNU/kFreeBSD
Peter Colberg [Sat, 2 Jul 2016 02:00:37 +0000 (22:00 -0400)]
Link with -ldl on GNU/kFreeBSD

GNU/kFreeBSD uses the FreeBSD kernel with the GNU C library.

Signed-off-by: Peter Colberg <peter@colberg.org>
8 years agoFix spelling in man page
Peter Colberg [Fri, 10 Jun 2016 14:29:07 +0000 (10:29 -0400)]
Fix spelling in man page

Signed-off-by: Peter Colberg <peter@colberg.org>
8 years agoui-shared: fix segfault when defbranch is NULL
Eric Wong [Wed, 6 Jul 2016 07:08:01 +0000 (07:08 +0000)]
ui-shared: fix segfault when defbranch is NULL

Not sure if there's a better fix for this.  defbranch is
NULL here on my setup when a crawler hit an invalid URL,
causing strcmp to segfault.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
8 years agocss: consistent use of empty lines
Christian Hesse [Wed, 29 Jun 2016 07:37:58 +0000 (09:37 +0200)]
css: consistent use of empty lines

Signed-off-by: Christian Hesse <mail@eworm.de>
8 years agoui-log: color line changes
Christian Hesse [Wed, 29 Jun 2016 07:37:57 +0000 (09:37 +0200)]
ui-log: color line changes

Signed-off-by: Christian Hesse <mail@eworm.de>
8 years agoAvoid ambiguities when prettifying snapshot names
Lukas Fleischer [Tue, 24 May 2016 16:15:18 +0000 (18:15 +0200)]
Avoid ambiguities when prettifying snapshot names

When composing snapshot file names for a tag with a prefix of the form
v[0-9] (resp. V[0-9]), the leading "v" (resp. "V") is stripped. This
leads to conflicts if a tag with the stripped name already exists or if
there are tags only differing in the capitalization of the leading "v".
Make sure we do not strip the "v" in these cases.

Reported-by: Juuso Lapinlampi <wub@partyvan.eu>
Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
8 years agogit: update to v2.9.0
Christian Hesse [Mon, 13 Jun 2016 20:57:12 +0000 (22:57 +0200)]
git: update to v2.9.0

Update to git version v2.9.0, no changes required.

Signed-off-by: Christian Hesse <mail@eworm.de>
8 years agocgit.mk: Use $PKG_CONFIG
Kylie McClain [Tue, 7 Jun 2016 21:22:35 +0000 (17:22 -0400)]
cgit.mk: Use $PKG_CONFIG

PKG_CONFIG is a variable dictated by autoconf standards; it should
be used if set.

8 years agomd2html: use utf-8 and flush output buffer
Jason A. Donenfeld [Fri, 17 Jun 2016 10:27:10 +0000 (12:27 +0200)]
md2html: use utf-8 and flush output buffer

Otherwise we get the classic Python UTF-8 errors, and the text is all
out of order. While we're at it, switch to python3 so we only have to
support one set of oddball semantics.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Suggested-by: Daniel Campbell <dlcampbell@gmx.com>
8 years agoHosted on HTTPS now
Jason A. Donenfeld [Wed, 24 Feb 2016 17:01:42 +0000 (18:01 +0100)]
Hosted on HTTPS now

8 years agoBump version. v1.0
Jason A. Donenfeld [Tue, 7 Jun 2016 12:31:09 +0000 (14:31 +0200)]
Bump version.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agogit: update to v2.8.3
Christian Hesse [Thu, 19 May 2016 21:12:03 +0000 (23:12 +0200)]
git: update to v2.8.3

Update to git version v2.8.3, no changes required.

Signed-off-by: Christian Hesse <mail@eworm.de>
8 years agoui-diff: action='.' is not correct
Jason A. Donenfeld [Thu, 12 May 2016 19:38:59 +0000 (21:38 +0200)]
ui-diff: action='.' is not correct

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoforms: action should not be empty
Jason A. Donenfeld [Thu, 12 May 2016 19:29:40 +0000 (21:29 +0200)]
forms: action should not be empty

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoui-shared: Remove a name attribute with an empty value
Juuso Lapinlampi [Wed, 11 May 2016 18:04:18 +0000 (18:04 +0000)]
ui-shared: Remove a name attribute with an empty value

The name attribute is optional in an input element, but it must not be
an empty value.

See: https://html.spec.whatwg.org/#attr-fe-name
See: https://html.spec.whatwg.org/#the-input-element

8 years agoui-shared: HTML-ize DOCTYPE and <html>
Juuso Lapinlampi [Wed, 11 May 2016 18:04:14 +0000 (18:04 +0000)]
ui-shared: HTML-ize DOCTYPE and <html>

Get rid of the XHTML headers, bringing cgit slowly to the modern age of
HTML.

8 years agoui-shared: Simplify cgit_print_error_page() logic
Juuso Lapinlampi [Wed, 11 May 2016 17:50:09 +0000 (17:50 +0000)]
ui-shared: Simplify cgit_print_error_page() logic

8 years agogit: update to v2.8.2
Christian Hesse [Sat, 30 Apr 2016 14:57:51 +0000 (16:57 +0200)]
git: update to v2.8.2

Update to git version v2.8.2.

* Upstream commit 1a0c8dfd89475d6bb09ddee8c019cf0ae5b3bdc2 (strbuf: give
  strbuf_getline() to the "most text friendly" variant) changed API.

Signed-off-by: Christian Hesse <mail@eworm.de>
8 years agoui-log: Simplify decoration code
Tim Nordell [Fri, 26 Feb 2016 20:58:41 +0000 (14:58 -0600)]
ui-log: Simplify decoration code

The decoration code inside of git returns the decoration type, so
utilize this to create the decoration spans.  Additionally, use
prettify_refname(...) to get the shorter name for the ref.

Signed-off-by: Tim Nordell <tim.nordell@logicpd.com>
8 years agoui-log: Do not always emit decoration span
Tim Nordell [Fri, 26 Feb 2016 20:57:30 +0000 (14:57 -0600)]
ui-log: Do not always emit decoration span

The decoration span does not need to be emited if there aren't
any decorations to show.  This modification saves slightly
on bandwidth.

Signed-off-by: Tim Nordell <tim.nordell@logicpd.com>
8 years agoRenamed repo-specific configuration for enable-html-serving in cgitrc.5.txt
Matt Comben [Tue, 8 Mar 2016 12:05:09 +0000 (12:05 +0000)]
Renamed repo-specific configuration for enable-html-serving in cgitrc.5.txt

8 years agoui-shared: redirect should not exit early for cache
Jason A. Donenfeld [Fri, 26 Feb 2016 12:24:35 +0000 (13:24 +0100)]
ui-shared: redirect should not exit early for cache

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoabout: path_info might not be valid
Jason A. Donenfeld [Fri, 26 Feb 2016 12:14:43 +0000 (13:14 +0100)]
about: path_info might not be valid

8 years agotabs: do not use target=_blank
Jason A. Donenfeld [Tue, 23 Feb 2016 14:35:32 +0000 (15:35 +0100)]
tabs: do not use target=_blank

8 years agocss: fix indentation
Jason A. Donenfeld [Tue, 23 Feb 2016 14:14:06 +0000 (15:14 +0100)]
css: fix indentation

8 years agocss: use less blurry icon for external link
Christian Hesse [Tue, 23 Feb 2016 09:47:25 +0000 (10:47 +0100)]
css: use less blurry icon for external link

Your mileage may vary, but for me the old icon looks blurry. The new
one is character 0xf08e from OTF font awsome in size 10.
The icon color is black, gray level is adjusted via opacity.

Signed-off-by: Christian Hesse <mail@eworm.de>
8 years agomd2html: Do syntax highlighting too
Jason A. Donenfeld [Tue, 23 Feb 2016 05:32:03 +0000 (06:32 +0100)]
md2html: Do syntax highlighting too

8 years agogit: update to v2.7.2
Christian Hesse [Mon, 22 Feb 2016 22:25:28 +0000 (23:25 +0100)]
git: update to v2.7.2

Update to git version v2.7.2, no changes required.

Signed-off-by: Christian Hesse <mail@eworm.de>
8 years agoui-plain: fix to show a repo's root directory listing in plain view
Joe Anakata [Mon, 22 Feb 2016 17:45:53 +0000 (18:45 +0100)]
ui-plain: fix to show a repo's root directory listing in plain view

This is to fix the case of accessing http://host.com/cgit.cgi/repo.git/plain/

There is code here to make this case work (match_baselen is set to -1
for top-of-the-tree views) but the unsigned to signed comparison was
always false in this case, causing an empty directory listing without
this fix.

Signed-off-by: Joe Anakata <jea-signup-github@anakata.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agocmd: redirect empty about/ to homepage or summary
Jason A. Donenfeld [Mon, 22 Feb 2016 15:33:49 +0000 (16:33 +0100)]
cmd: redirect empty about/ to homepage or summary

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoui-shared: add homepage to tabs
Jason A. Donenfeld [Mon, 22 Feb 2016 15:04:15 +0000 (16:04 +0100)]
ui-shared: add homepage to tabs

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
8 years agoui-atom: avoid DATE_STRFTIME
John Keeping [Mon, 8 Feb 2016 15:06:27 +0000 (15:06 +0000)]
ui-atom: avoid DATE_STRFTIME

Git's DATE_STRFTIME ignores the timezone argument and just uses the
local timezone regardless of whether the "local" flag is set.

Since Atom accepts ISO8601 dates [1], we can use Git's
DATE_ISO8601_STRICT instead, which does get this right.  Additionally,
we never use the local timezone here so we can use the
date_mode_from_type() wrapper to simplify the code a bit.

[1] https://tools.ietf.org/html/rfc4287#section-3.3

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoAvoid DATE_STRFTIME for long/short dates
John Keeping [Mon, 8 Feb 2016 15:05:54 +0000 (15:05 +0000)]
Avoid DATE_STRFTIME for long/short dates

Git's DATE_STRFTIME ignores the timezone argument and just uses the
local timezone regardless of whether the "local" flag is set.

Since our existing FMT_LONGDATE and FMT_SHORTDATE are pretty-much
perfect matches to DATE_ISO8601 and DATE_SHORT, switch to taking a
date_mode_type directly in cgit_date_mode().

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoui-stats: cast pointer before checking for zero
John Keeping [Mon, 8 Feb 2016 14:12:35 +0000 (14:12 +0000)]
ui-stats: cast pointer before checking for zero

We abuse the "void *util" field as a counter and recently started to
cast it to a uintptr_t to avoid risking nasal demons by performing
arithmetic on a void pointer.

However, compilers are also known to do "interesting" things if they
know that a pointer is or isn't NULL.  Make this safer by checking if
the counter (after casting) is non-zero rather than checking if the
pointer is non-null.

Signed-off-by: John Keeping <john@keeping.me.uk>
8 years agoui-stats: if we're going to abuse void*, do it safely
Jason A. Donenfeld [Mon, 8 Feb 2016 13:35:47 +0000 (14:35 +0100)]
ui-stats: if we're going to abuse void*, do it safely