Age | Commit message (Collapse) | Author |
|
Add a funtion cache_safe_filename() which replaces possibly bad filename
characters with '_'.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
This moves some cgit-specific stuff away from cache.c
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Just to be really, really sure about embarrasing overflow settings
Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
|
|
In nocace mode an uninitialized ttl-setting was used to generate http-Expires
header. Fix it.
Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
|
|
Convert valid %xx expressions in querystring to ascii, ignore invalid
expressions (i.e. eat the three characters %xx).
Signed-off-by: Lars Hjemli <larsh@hal-2004.(none)>
|
|
Translate '+' to ' ' in querystring parser (still doesn't handle %xx)
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
This enables case-insensitive grep on logentris using the new search box
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
This adds the ability to show a search box in any pageheader with correct href and
hidden form data, but does not enable the box on any pages.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Gaah.
This should have been a part of 36aba00273e7af1b94bf8c5dd5068709d983d01e
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
With a working diff, it really has all the basics.
Next steps will be to make it more usable and less ugly :)
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Finally, xdiff is used to show per-file diffs via commit view.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
No reason to show "100644" when we can show "-rw-r--r--"
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Replace the call to lookup_commit() with a call to lookup_commit_reference,
since it handles reading and parsing of the commit object internally.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Use the extra info found in commitinfo struct when generating commit
view.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
We want all four of these when showing a commit, so save them in the
commitinfo struct.
Btw: There's probably no good reason to save committer timestamp since
it's already available in commit->date. But it doesn't hurt us either,
and it makes the parser look more complete, so we just do it.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Make sure we chdir(2) back to the original getcwd(2) when a page
has been generated. Also, if the cgit_cache_root do not exist,
try to create it.
This is a feature intended to ease testing/debugging.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Somehow, this option was forgotten when parsing the configfile.
Add it.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
This adds support for the following options to cgit:
--root=<path>
--cache=<path>
--nocache
--query=<querystring>
--repo=<reponame>
--page=<pagename>
--head=<branchname>
--sha1=<sha1>
--ofs=<number>
On startup, /etc/cgitrc is parsed, followed by argument parsing and
finally querystring parsing.
If --nocache is specified (or set in /etc/gitrc), caching is disabled and
cgit instead generates pages to stdout.
The combined effect of these two changes makes testing/debugging a lot
less painfull.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Make a better commit parser, replacing the ugly one in ui-log.c
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Let README describe the "bigger picture" instead.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Since fmt() uses 8 alternating static buffers, and cache_lock might call
cache_create_dirs() multiple times, which in turn might call fmt() twice,
after four iterations lockfile would be overwritten by a cachedirectory
path.
In worst case, this could cause the cachedirectory to be unlinked and replaced
by a cachefile.
Fix: use xstrdup() on the result from fmt() before assigning to lockfile, and
call free(lockfile) before exit.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
An embarrassing thinko in cgit_check_cache() would truncate valid cachefiles
in the following situation:
1) process A notices a missing/expired cachefile
2) process B gets scheduled, locks, fills and unlocks the cachefile
3) process A gets scheduled, locks the cachefile, notices that the cachefile
now exist/is not expired anymore, and continues to overwrite it with an
empty lockfile.
Thanks to Linus for noticing (again).
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
While at it, replace the cgit_[lib_]error constants with a proper function
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Add a global variable, cgit_max_lock_attemps, to avoid the possibility of
infinite loops when failing to acquire a lockfile. This could happen on
broken setups or under crazy server load.
Incidentally, this also fixes a lurking bug in cache_lock() where an
uninitialized returnvalue was used.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|
|
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
|