Re: [PATCH 1/1] ui-repolist: remove unused variable

2017-07-26 Thread Lukas Fleischer
On Tue, 06 Jun 2017 at 16:14:47, Christian Hesse wrote: > From: Christian Hesse > > Signed-off-by: Christian Hesse > --- > ui-repolist.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/ui-repolist.c b/ui-repolist.c > index 20a4f56..7272e87 100644 > ---

Re: [PATCH] Remove unused variable from sort_section()

2017-04-08 Thread Lukas Fleischer
On Wed, 05 Apr 2017 at 12:28:28, Jason A. Donenfeld wrote: > Looks good to me. Queued on lf/for-jason. ___ CGit mailing list CGit@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/cgit

[PATCH] Remove unused variable from sort_section()

2017-04-04 Thread Lukas Fleischer
Signed-off-by: Lukas Fleischer <lfleisc...@lfos.de> --- ui-repolist.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ui-repolist.c b/ui-repolist.c index 20a4f56..7272e87 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -225,7 +225,6 @@ static int sort_section(const void *a, const v

Re: [PATCH] ui-patch: fix segfault when a path prefix is passed

2017-01-23 Thread Lukas Fleischer
On Sun, 22 Jan 2017 at 23:45:01, Jason A. Donenfeld wrote: > Nice catch, thanks. > > Merged. Note that I had a similar patch submitted to the mailing list about two months ago [1] and queued up in lf/for-jason as you told me back then. Could you check whether the additional changes I have in my

[PATCH] Fix crash when using path limit

2016-11-24 Thread Lukas Fleischer
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 <bluew...@xinu.at> Signed-off-by: Lukas Fleischer <lfleisc...@lfos.de> --- ui

Re: Crash when using path limit in ui-patch.c

2016-11-24 Thread Lukas Fleischer
On Thu, 24 Nov 2016 at 19:49:06, John Keeping wrote: > [...] > diff --git a/ui-patch.c b/ui-patch.c > index ec7f3523..d29f74c7 100644 > --- a/ui-patch.c > +++ b/ui-patch.c > @@ -85,8 +85,7 @@ void cgit_print_patch(const char *new_rev, const char > *old_rev, >

Re: RFC: don't cache objects larger than X

2016-10-17 Thread Lukas Fleischer
On Wed, 12 Oct 2016 at 13:22:34, Jason A. Donenfeld wrote: > I face this same problem, in fact. Unless somebody beats me to it, I'd > be interested in giving this a stab. > > One issue is that cache entries are currently "streamed" into the > cache files, as they're produced. It's not trivially

[PATCH] Use skip_prefix() to get rid of magic constants

2016-10-08 Thread Lukas Fleischer
Signed-off-by: Lukas Fleischer <lfleisc...@lfos.de> --- cgit.c | 56 ++-- scan-tree.c | 6 -- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/cgit.c b/cgit.c index 2f29aa6..bc05f1e 100644 --- a/cgit.c +++ b/

Re: [PATCH] Avoid ambiguities when prettifying snapshot names

2016-07-02 Thread Lukas Fleischer
On Tue, 24 May 2016 at 18:15:18, Lukas Fleischer wrote: > 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 exist

[PATCH] Fix segmentation fault in hc()

2015-12-12 Thread Lukas Fleischer
The ctx.qry.page variable might be unset at this point, e.g. when an invalid command is passed and cgit_print_pageheader() is called to show an error message. Signed-off-by: Lukas Fleischer <lfleisc...@lfos.de> --- ui-shared.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui-shar

Re: Snapshot: Customize filename and remove obligatory folder

2015-11-13 Thread Lukas Fleischer
On Mon, 09 Nov 2015 at 13:11:51, Alexander Nitsche - e-pixler NEW MEDIA GmbH wrote: > It would be nice to be able to > > a) customize the automatically generated snapshot filename. In general > it is {repository_name}-{branch}.zip. I - for integrity reasons - need > to be able to say that the

Re: [PATCH] Customize cgit for the AUR

2015-06-04 Thread Lukas Fleischer
On Thu, 04 Jun 2015 at 13:32:41, Lukas Fleischer wrote: From: Lukas Fleischer lfleisc...@archlinux.org * Mention AUR and the package base in the title. * Remove the branch switch form. * Do not show any commit decorations. * Do not show branches on the summary page. * Drop link to the refs

Re: [PATCH] Add an option to disable the branch switch form

2015-05-31 Thread Lukas Fleischer
On Sat, 07 Feb 2015 at 17:33:36, Lukas Fleischer wrote: Introduce a configuration option enable-switch-form that is enabled by default and can be used to disable the branch quick switch form in the top-right corner of repository pages. Rationale: For repositories with a huge number

Re: [PATCH] Check SHA256 sum of git-$VER.tar.gz after downloading

2015-03-07 Thread Lukas Fleischer
On Sat, 07 Mar 2015 at 18:02:59, John Keeping wrote: [...] I'm not sure what benefit it has if it's optional. Will anyone check? Maybe we could do something like: if type sha256sum /dev/null 21 then sha256sum --check git.sha256sum $(GIT_FILE)

Re: [PATCH] Check SHA256 sum of git-$VER.tar.gz after downloading

2015-03-07 Thread Lukas Fleischer
On Sat, 07 Mar 2015 at 15:46:41, John Keeping wrote: This requires that we save the downloaded file explicitly rather than piping it straight to tar, but that is advisable anyway since it allows us to check the exit status of curl and make sure that we have downloaded the file successfully.

[PATCH] Remove no-op link from submodule entries

2015-03-05 Thread Lukas Fleischer
Instead of linking to the current page (href='#'), do not add a link to a submodule entry at all if the module-link setting is not used. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cgit.css| 2 +- ui-shared.c | 41 - 2 files changed, 25

Re: [PATCH] Support .git/category files

2015-03-05 Thread Lukas Fleischer
On Thu, 05 Mar 2015 at 18:15:04, Jan-Marek Glogowski wrote: Gitweb reads .git/category to set a repository section for grouping. This handles the file in the same way a .git/description file is handled. The file section takes precedence over the ctx.cfg.section_from_path setting. ---

Re: Support for submodules in tree view?

2015-03-05 Thread Lukas Fleischer
On Thu, 05 Mar 2015 at 19:25:53, John Keeping wrote: On Thu, Mar 05, 2015 at 06:19:31PM +, Dunnigan, Terrence J wrote: We are using cgit 0.10.1. Some of our repos have submodules, and when I look at a tree view I see the name of the submodule with its current hash, e.g. m-

[PATCH 2/2] Drop return value from parse_user()

2015-03-05 Thread Lukas Fleischer
-by: Lukas Fleischer c...@cryptocrack.de --- parsing.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/parsing.c b/parsing.c index dcaf2b3..f903c7c 100644 --- a/parsing.c +++ b/parsing.c @@ -69,13 +69,12 @@ static char *substr(const char *head, const char *tail

[PATCH 1/2] Remove leading newline characters from tag messages

2015-03-05 Thread Lukas Fleischer
Fixes a regression introduced in commit 936295c (Simplify commit and tag parsing, 2015-03-03). Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- parsing.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parsing.c b/parsing.c index 0db181b..dcaf2b3 100644 --- a/parsing.c +++ b

[PATCH] Simplify commit and tag parsing

2015-03-03 Thread Lukas Fleischer
* Use skip_prefix to avoid magic numbers in the code. * Use xcalloc() instead of xmalloc(), followed by manual initialization. * Split out line splitting. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- parsing.c | 114 +++--- 1 file

[PATCH] ui-clone.c: Fix starts_with() path check

2015-02-08 Thread Lukas Fleischer
in in corner cases. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- Jason, I stumbled across this when trying to reproduce the bug you reported earlier. Not sure if it is related but it's clearly a bug. One reason why we haven't seen this occur earlier is that it only manifests in a few rare

[PATCH v2] ui-clone.c: Fix path check

2015-02-08 Thread Lukas Fleischer
) but only pops in in corner cases. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- Using skip_prefix() might be even better here :) ui-clone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-clone.c b/ui-clone.c index 50569d6..1e6238d 100644 --- a/ui-clone.c +++ b

[PATCH] Add an option to disable the branch switch form

2015-02-07 Thread Lukas Fleischer
. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- I am not totally happy with the name but I did not come up with anything more expressive that is short enough at the same time. Suggestions welcome! cgit.c | 6 ++ cgit.h | 2 ++ cgitrc.5.txt | 9 + shared.c | 1 + ui

[PATCH] Add repo.hide and repo.ignore

2015-01-29 Thread Lukas Fleischer
These options can be used to hide a repository from the index or completely ignore a repository, respectively. They are particularly useful when used in combination with scan-path. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cgit.c| 6 ++ cgit.h| 2 ++ cgitrc.5

Re: [PATCH v2] Support Git over HTTP using git-http-backend

2014-12-29 Thread Lukas Fleischer
invoking http-backend from cgit without the overhead of execl() seems to be a bit more involved -- almost everything in http-backend.c is marked static: Acked-by: Lukas Fleischer c...@cryptocrack.de ___ CGit mailing list CGit@lists.zx2c4.com http

Re: [PATCH] Use split_ident_line() in parse_user()

2014-12-23 Thread Lukas Fleischer
On Wed, 24 Dec 2014 at 02:57:45, Jason A. Donenfeld wrote: On Wed, Dec 17, 2014 at 5:19 AM, Lukas Fleischer c...@cryptocrack.de wrote: Use Git's built-in ident line splitting algorithm instead of reimplementing it. This does not only simplify the code but also makes sure that cgit

[PATCH v2] Use split_ident_line() in parse_user()

2014-12-23 Thread Lukas Fleischer
Use Git's built-in ident line splitting algorithm instead of reimplementing it. This does not only simplify the code but also makes sure that cgit is consistent with Git when it comes to author parsing. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- parsing.c | 45

[PATCH] Remove trailing slash after remove-suffix

2014-12-13 Thread Lukas Fleischer
When removing the .git suffix of a non-bare repository, also remove the trailing slash for compatibility with cgit_repobasename(). Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- scan-tree.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scan-tree.c b/scan-tree.c

[PATCH v2] Remove trailing slash after remove-suffix

2014-12-13 Thread Lukas Fleischer
When removing the .git suffix of a non-bare repository, also remove the trailing slash for compatibility with cgit_repobasename(). Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- The previous version had a flaw (bogus pointer if there is no .git suffix). This one is much more readable add

Re: Integration with Bugzilla?

2014-10-26 Thread Lukas Fleischer
On Fri, 24 Oct 2014 at 22:25:01, Joey Reid wrote: Yes, rewording the scan-path section of cgitrc.5 and adding an entry to the FAQ would be immensely helpful. The commit-links.sh and the trac script appear to spawn extra process. With servers like FreeDesktop's cgit under a heavy load, is

Re: Integration with Bugzilla?

2014-09-29 Thread Lukas Fleischer
On Mon, 29 Sep 2014 at 20:09:48, Ferry Huberts wrote: [...] #!/bin/bash [...] This is a bit off topic but the script doesn't seem to rely on any bashisms (apart from the double brackets which can be ported easily), so it might be a good idea to use a /bin/sh shebang (and use a shell other than

Re: Integration with Bugzilla?

2014-09-29 Thread Lukas Fleischer
On Mon, 29 Sep 2014 at 20:33:28, Ferry Huberts wrote: [...] my server is guaranteed to have bash, so no need to change it. but thanks for the hint anyway :-) I am not (only) talking about portability here. My main concern is the current spate of bash vulnerabilities. As John pointed out

[PATCH] Always check if README exists in choose_readme()

2014-07-27 Thread Lukas Fleischer
, all repositories are equipped with an about link in the aforementioned scenario, even if there is no about file. Remove the early check for the number of keys and always check whether the file exists instead. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cgit.c | 6 -- 1 file changed, 6

Re: [PATCH 1/1] git: update for git 2.0

2014-05-04 Thread Lukas Fleischer
On Sun, 04 May 2014 at 21:31:39, Christian Hesse wrote: prefixcmp() and suffixcmp() have been remove, functionality is now provided by starts_with() and ends_with(). Retrurn values have been changed, so instead of just renaming we have to fix logic. Everything else looks just fine. ---

Re: kernel.org's libravatar lua script

2014-03-22 Thread Lukas Fleischer
On Fri, 14 Mar 2014 at 16:37:56, Konstantin Ryabitsev wrote: Hi, all: We upgraded to 0.10.1 on kernel.org with libravatar support: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/ As you'll notice, it's slightly different from the default gravatar script, so here are

[PATCH] git: Update to 1.9.0

2014-02-20 Thread Lukas Fleischer
No code changes required, just bump the submodule and Makefile versions. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- Makefile | 2 +- git | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 05b97d7..3ee5f65 100644 --- a/Makefile +++ b

[PATCH] Skip cache slot when time-to-live is zero

2014-02-20 Thread Lukas Fleischer
. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cache.c | 2 +- cgitrc.5.txt | 22 ++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cache.c b/cache.c index 9e7eeb0..801e63f 100644 --- a/cache.c +++ b/cache.c @@ -343,7 +343,7 @@ int cache_process(int

Re: [PATCH] git: Update to 1.9.0

2014-02-20 Thread Lukas Fleischer
On Thu, 20 Feb 2014 at 20:58:13, Lukas Fleischer wrote: No code changes required, just bump the submodule and Makefile versions. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- Makefile | 2 +- git | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Sorry, I really

Re: Intelligent caching

2014-02-20 Thread Lukas Fleischer
On Thu, 06 Feb 2014 at 20:55:14, Jason A. Donenfeld wrote: This could be clever, if it's done properly. It'd have to be something along the lines of this page won't ever change, unless you can create an sha1 hash collision, and we'd have to be certain that such pages then only use information

Re: [PATCH 2/2] Add a cache-snapshot-ttl configuration variable

2014-02-08 Thread Lukas Fleischer
On Wed, 05 Feb 2014 at 16:09:14, Lukas Fleischer wrote: On Wed, 05 Feb 2014 at 15:44:36, Jason A. Donenfeld wrote: [...] Currently it defaults to cache_repo_ttl, which is 5. I'd be willing to compromise for 15 if you prefer. I'm fine with either one. Whatever you prefer. Changed

[PATCH] Remove unused parameter from cgit_print_snapshot()

2014-02-08 Thread Lukas Fleischer
Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cmd.c | 2 +- ui-snapshot.c | 2 +- ui-snapshot.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd.c b/cmd.c index cbd235c..188cd56 100644 --- a/cmd.c +++ b/cmd.c @@ -113,7 +113,7 @@ static void refs_fn(void

Re: [PATCH 1/2] Skip cache slot when time-to-live is zero

2014-02-08 Thread Lukas Fleischer
On Sat, 08 Feb 2014 at 14:41:56, Jason A. Donenfeld wrote: On Feb 6, 2014 10:07 PM, Lukas Fleischer c...@cryptocrack.de wrote: This is different. -1 means never expire. 0 means always expire. Ahh perfect -- this is exactly the type of distinction I was looking for. Do we have

Re: [PATCH 1/2] Skip cache slot when time-to-live is zero

2014-02-06 Thread Lukas Fleischer
On Thu, 06 Feb 2014 at 20:52:46, Jason A. Donenfeld wrote: On Wed, Feb 5, 2014 at 10:46 AM, Lukas Fleischer c...@cryptocrack.dewrote: /* If the cache is disabled, just generate the content */ - if (size = 0) { + if (size = 0 || ttl == 0) { fn

[PATCH 2/2] Add a cache-snapshot-ttl configuration variable

2014-02-05 Thread Lukas Fleischer
the cache for static/dynamic HTML pages (by setting TTL to zero for everything except for snapshot requests). Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cgit.c | 6 ++ cgit.h | 1 + cgitrc.5.txt | 5 + 3 files changed, 12 insertions(+) diff --git a/cgit.c b/cgit.c index

[PATCH 1/2] Skip cache slot when time-to-live is zero

2014-02-05 Thread Lukas Fleischer
. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache.c b/cache.c index 9e7eeb0..801e63f 100644 --- a/cache.c +++ b/cache.c @@ -343,7 +343,7 @@ int cache_process(int size, const char *path, const char *key, int ttl

[PATCH 0/2] Add an option to cache snapshots

2014-02-05 Thread Lukas Fleischer
caching of HTML pages. Lukas Fleischer (2): Skip cache slot when time-to-live is zero Add a cache-snapshot-ttl configuration variable cache.c | 2 +- cgit.c | 6 ++ cgit.h | 1 + cgitrc.5.txt | 5 + 4 files changed, 13 insertions(+), 1 deletion(-) -- 1.8.5.3

Intelligent caching

2014-02-05 Thread Lukas Fleischer
Hi, Reading through our caching code, I wondered why we don't make it a bit more clever. For every dynamically created page, we could just store a fingerprint that can be computed quite fast and indicates whether the cache slot is still up-to-date or not. For example, on the log pages, we could

[PATCH 2/4] Remove context parameter from all commands

2014-01-15 Thread Lukas Fleischer
invocations of these functions accordingly. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cgit.c | 4 +-- cmd.c | 100 ++--- cmd.h | 4 +-- ui-clone.c | 42 +- ui-clone.h | 6 ++-- ui-plain.c

[PATCH 0/4] Remove references to the global context variable

2014-01-15 Thread Lukas Fleischer
-diff-regex='[a-zA-Z_]+|-|\.' Comments welcome! Lukas Fleischer (4): Remove context parameter from cgit_print_*() Remove context parameter from all commands cgit.c: Remove context parameter from initializations Remove callback data parameter for cache slots cache.c | 14 ++- cache.h

[PATCH 3/4] cgit.c: Remove context parameter from initializations

2014-01-15 Thread Lukas Fleischer
In initialization routines, use the global context variable instead of passing a pointer around locally. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cgit.c | 207 - 1 file changed, 103 insertions(+), 104 deletions

[PATCH 4/4] Remove callback data parameter for cache slots

2014-01-15 Thread Lukas Fleischer
This is no longer needed since the context is always read from the global context variable. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cache.c | 14 ++ cache.h | 5 ++--- cgit.c | 4 ++-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/cache.c b

[PATCH 1/2] parsing.c: Remove leading space from committer

2014-01-15 Thread Lukas Fleischer
This did not really break anything in the past since spaces are ignored when rendering HTML. Remove the preceding space anyway to prevent from potential future problems. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- This would get fixed anyway when switching to strip_prefix(). However

[PATCH 2/2] t0111: Additions and fixes

2014-01-15 Thread Lukas Fleischer
* Rename the capitalize-* filters to dump.* since they also dump the arguments. * Add full argument validation to the email filters. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- tests/filters/capitalize-buffer.lua | 17 - tests/filters/capitalize-stdin.sh | 4

[PATCH/RFC] tests/: Add t0111-filter.sh

2014-01-14 Thread Lukas Fleischer
This adds basic tests for all types of exec filters. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- This only includes tests for exec filters so far. I will send another patch for Lua filters once this one is merged. tests/filters/capitalize-argv1.sh | 3 +++ tests/filters/capitalize

[PATCH 1/2] t0111: Prepare for other filter prefixes

2014-01-14 Thread Lukas Fleischer
Rename the filter repository to filter-exec. The Git repository itself is not renamed since it can be shared amongst all filter types. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- tests/setup.sh| 2 +- tests/t0111-filter.sh | 22 +++--- 2 files changed, 12

[PATCH 2/2] t0111: Add basic tests for Lua filters

2014-01-14 Thread Lukas Fleischer
Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- tests/filters/capitalize-buffer.lua | 14 ++ tests/setup.sh | 9 + tests/t0111-filter.sh | 32 3 files changed, 55 insertions(+) create mode 100644

[PATCH v2 1/3] t0111: Prepare for other filter prefixes

2014-01-14 Thread Lukas Fleischer
amongst all filter types. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- tests/filters/capitalize-argv1.sh | 3 --- tests/setup.sh| 4 ++-- tests/t0111-filter.sh | 26 +- 3 files changed, 15 insertions(+), 18 deletions(-) delete mode

Re: [PATCH 05/12] filter: basic write hooking infrastructure

2014-01-13 Thread Lukas Fleischer
On Mon, 13 Jan 2014 at 05:11:12, Jason A. Donenfeld wrote: Filters can now call hook_write and unhook_write if they want to redirect writing to stdout to a different function. This saves us from potential file descriptor pipes and other less efficient mechanisms. We do this instead of

Re: [PATCH 06/12] filter: add preliminary lua support

2014-01-13 Thread Lukas Fleischer
This patch is quite messy and hard to read. I read your cover-letter but maybe you still want to clean this up when dealing with the other suggestions during a rebase -- shouldn't be too hard when using an editor with good Git integration (like fugitive for Vim). On Mon, 13 Jan 2014 at 05:11:13,

[PATCH] cgitrc.5.txt: Fix documentation of the snapshot mask

2014-01-13 Thread Lukas Fleischer
Mention that the snapshot setting only specifies the formats that links are generated for and not the set of formats that are accessible via HTTP. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cgitrc.5.txt | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git

[PATCH 3/4] Refactor cgit_parse_snapshots_mask()

2014-01-10 Thread Lukas Fleischer
Use Git string lists instead of str{spn,cspn,ncmp}() magic. This significantly improves readability. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- shared.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/shared.c b/shared.c index 1f6310a

[PATCH 2/2] cgit.c: Fix comment on bit mask hack

2014-01-10 Thread Lukas Fleischer
* Formatting and spelling fixes. * A bit mask with the size of one byte only allows for storing 8 (not 255!) different flags. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- cgit.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cgit.c b/cgit.c

[PATCH 1/2] cgit.c: Use else for mutually exclusive branches

2014-01-10 Thread Lukas Fleischer
When parsing command line arguments, no pair of command line options can ever match simultaneously. Use else if blocks to reflect this. This change improves both readability and speed. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- Based on the patches I sent earlier today. cgit.c | 29

[PATCH] Disallow downloading disabled snapshot formats

2014-01-10 Thread Lukas Fleischer
We did only display enabled snapshot formats but we did not prevent from downloading disabled formats when requested. Fix this by adding an appropriate check. Also, add a test case that checks whether downloading disabled snapshot formats is denied, as expected. Signed-off-by: Lukas Fleischer c

[PATCH 1/2] README: Spelling and formatting fixes

2014-01-08 Thread Lukas Fleischer
* Several small spelling and capitalization fixes. * Use consistent and better-looking formatting that is compatible with AsciiDoc (and partly compatible with RST). Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- README | 82

[PATCH 2/2] ui-log.c: Several simplifications

2013-11-22 Thread Lukas Fleischer
* Use argv_array_pushf() for inserting formatted strings. * Remove unneeded static strings. * Replace if by else if for readability and speed. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- ui-log.c | 28 +--- 1 file changed, 9 insertions(+), 19 deletions(-) diff

Re: [PATCH v2 1/2] ui-diff: Use diff_tree_sha1() for raw diff formatting

2013-09-14 Thread Lukas Fleischer
On Tue, Aug 27, 2013 at 10:40:50AM +0200, Lukas Fleischer wrote: Use Git's internal diff_tree_sha1() function for the /rawdiff/ command instead of trying to recreate this functionality. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- ui-diff.c | 23 +-- 1 file

[PATCH v2 2/2] ui-shared: Drop filepair_cb_raw() and helper

2013-08-27 Thread Lukas Fleischer
Remove filepair_cb_raw() and all related functions. These are no longer needed. We now use Git's internal functions for raw diff formatting everywhere. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- ui-shared.c | 72 - ui

[PATCH 5/5] t0108: Add tests for revision ranges

2013-08-26 Thread Lukas Fleischer
Add tests to check whether generating multiple patches at once works. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- tests/t0108-patch.sh | 17 + 1 file changed, 17 insertions(+) diff --git a/tests/t0108-patch.sh b/tests/t0108-patch.sh index 0a2ec2e..fcc749d 100755

[PATCH] tests/: Add t0110-rawdiff.sh

2013-08-26 Thread Lukas Fleischer
This adds some basic tests for the /rawdiff/ command. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- tests/t0110-rawdiff.sh | 42 ++ 1 file changed, 42 insertions(+) create mode 100755 tests/t0110-rawdiff.sh diff --git a/tests/t0110-rawdiff.sh b

[PATCH/RFC 1/2] ui-diff: Use diff_tree_sha1() for raw diff formatting

2013-08-26 Thread Lukas Fleischer
Use Git's internal diff_tree_sha1() function for the /rawdiff/ command instead of trying to recreate this functionality. Signed-off-by: Lukas Fleischer c...@cryptocrack.de --- The test suite still passes. If anybody has any idea how to do this better: Comments welcome. ui-diff.c | 28

Re: [PATCH/RFC 1/2] ui-diff: Use diff_tree_sha1() for raw diff formatting

2013-08-26 Thread Lukas Fleischer
On Tue, Aug 27, 2013 at 03:31:14AM +0200, Jason A. Donenfeld wrote: On Tue, Aug 27, 2013 at 3:27 AM, Lukas Fleischer c...@cryptocrack.de wrote: + } else { + /* +* SHA-1 of an empty tree. We might be better off

[PATCH v4 1/4] ui-diff: Check the return value of get_sha1()

2013-08-20 Thread Lukas Fleischer
Sync with what we do everywhere else and check the return value of get_sha1() instead of calling sha1_object_info() to validate the object. Note that we later call lookup_commit_reference(), which checks that both SHA1 values refer to commits, anyway. Signed-off-by: Lukas Fleischer c

[PATCH] Use strbuf for reading configuration files

2013-06-04 Thread Lukas Fleischer
-by: Lukas Fleischer c...@cryptocrack.de --- configfile.c | 65 ++-- configfile.h | 2 ++ 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/configfile.c b/configfile.c index d98989c..e6ad1d6 100644 --- a/configfile.c +++ b

Re: [PATCH] Use strbuf for reading configuration files

2013-06-04 Thread Lukas Fleischer
On Tue, Jun 04, 2013 at 04:47:53PM +0200, Lukas Fleischer wrote: Use struct strbuf from Git instead of fixed-size buffers to remove the limit on the length of configuration file lines and refactor read_config_line() to improve readability. Note that this also fixes a buffer overflow