<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cgit, branch v0.10.2</title>
<subtitle>A hyperfast web frontend for git repositories written in C 
</subtitle>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/'/>
<entry>
<title>Bump version.</title>
<updated>2014-06-30T13:15:35+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2014-06-30T13:15:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=eeaffc33432d3cf91902cac3eab50c0598bdaa19'/>
<id>eeaffc33432d3cf91902cac3eab50c0598bdaa19</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>remove debug fprinf() calls that sneaked in with commit 79c985</title>
<updated>2014-06-29T18:18:42+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2014-06-29T16:52:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=4b91269bdbc21a664cc56c26d6071c630560f2e0'/>
<id>4b91269bdbc21a664cc56c26d6071c630560f2e0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to 2.0.1</title>
<updated>2014-06-28T14:07:30+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2014-06-28T14:04:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=390ffad022336b02dca6dec23504cefeb12adada'/>
<id>390ffad022336b02dca6dec23504cefeb12adada</id>
<content type='text'>
Everything works just bumping the version in Makefile and commit hash in
submodule. No code changes required.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Everything works just bumping the version in Makefile and commit hash in
submodule. No code changes required.
</pre>
</div>
</content>
</entry>
<entry>
<title>ui-patch: Flush stdout after outputting data</title>
<updated>2014-06-28T13:59:15+00:00</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2014-06-11T20:01:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=2efb59ed0fa8eced79fa702bc47454d3406c3431'/>
<id>2efb59ed0fa8eced79fa702bc47454d3406c3431</id>
<content type='text'>
It looks like cached patches are truncated to the nearest 1024-byte
boundary in the patch body. E.g.:

&gt; mricon@nikko:[/tmp]$ wget -O no-cache
&gt; "http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=6e1b4fdad5157bb9e88777d525704aba24389bee"
...
&gt; 2014-06-11 15:34:51 (80.4 MB/s) - ‘no-cache’ saved [4767]

Patch is complete, without truncation. Next hit, with cache in place:

&gt; mricon@nikko:[/tmp]$ wget -O yes-cache
&gt; "http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=6e1b4
&gt; fdad5157bb9e88777d525704aba24389bee"
...
&gt; 2014-06-11 15:35:01 (17.0 MB/s) - ‘yes-cache’ saved [4096/4096]

Length truncated to 4096. The cache on disk looks truncated as well, so
the bug must me during the process of saving cache. The same is true for
larger patches:

&gt; mricon@nikko:[/tmp]$ wget -O no-cache
&gt; "http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=2840c566e95599cd60c7143762ca8b49d9395050"
...
&gt; 2014-06-11 15:41:33 (1.07 MB/s) - ‘no-cache’ saved [979644]

979644 bytes with a cache-miss

&gt; mricon@nikko:[/tmp]$ wget -O yes-cache
&gt; "http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=2840c
&gt; 566e95599cd60c7143762ca8b49d9395050"
...
&gt; 2014-06-11 15:41:46 (1.05 MB/s) - ‘yes-cache’ saved [978944]

978944 (956KB exactly) with a cache-hit

Since the "html" functions use raw write(2) to STDIO_FILENO, we don't
notice problems with most pages, but raw patches write using printf(3).
This is fine if we're outputting straight to stdout since the buffers
are flushed on exit, but we close the cache output before this, so the
cached output ends up being truncated.

Make sure the buffers are flushed when we finish outputting a patch so
that we avoid this.

No other UIs use printf(3) so we do not need to worry about them.

Actually, it's slightly more interesting than this... since we don't set
GIT_FLUSH, Git decides whether or not it will flush stdout after writing
each commit based on whether or not stdout points to a regular file (in
maybe_flush_or_die()).

Which means that when writing directly to the webserver, Git flushes
stdout for us, but when we redirect stdout to the cache it points to a
regular file so Git no longer flushes the output for us.

The patch is still correct, but perhaps the full explanation is
interesting!

Reported-by: Konstantin Ryabitsev &lt;mricon@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It looks like cached patches are truncated to the nearest 1024-byte
boundary in the patch body. E.g.:

&gt; mricon@nikko:[/tmp]$ wget -O no-cache
&gt; "http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=6e1b4fdad5157bb9e88777d525704aba24389bee"
...
&gt; 2014-06-11 15:34:51 (80.4 MB/s) - ‘no-cache’ saved [4767]

Patch is complete, without truncation. Next hit, with cache in place:

&gt; mricon@nikko:[/tmp]$ wget -O yes-cache
&gt; "http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=6e1b4
&gt; fdad5157bb9e88777d525704aba24389bee"
...
&gt; 2014-06-11 15:35:01 (17.0 MB/s) - ‘yes-cache’ saved [4096/4096]

Length truncated to 4096. The cache on disk looks truncated as well, so
the bug must me during the process of saving cache. The same is true for
larger patches:

&gt; mricon@nikko:[/tmp]$ wget -O no-cache
&gt; "http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=2840c566e95599cd60c7143762ca8b49d9395050"
...
&gt; 2014-06-11 15:41:33 (1.07 MB/s) - ‘no-cache’ saved [979644]

979644 bytes with a cache-miss

&gt; mricon@nikko:[/tmp]$ wget -O yes-cache
&gt; "http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=2840c
&gt; 566e95599cd60c7143762ca8b49d9395050"
...
&gt; 2014-06-11 15:41:46 (1.05 MB/s) - ‘yes-cache’ saved [978944]

978944 (956KB exactly) with a cache-hit

Since the "html" functions use raw write(2) to STDIO_FILENO, we don't
notice problems with most pages, but raw patches write using printf(3).
This is fine if we're outputting straight to stdout since the buffers
are flushed on exit, but we close the cache output before this, so the
cached output ends up being truncated.

Make sure the buffers are flushed when we finish outputting a patch so
that we avoid this.

No other UIs use printf(3) so we do not need to worry about them.

Actually, it's slightly more interesting than this... since we don't set
GIT_FLUSH, Git decides whether or not it will flush stdout after writing
each commit based on whether or not stdout points to a regular file (in
maybe_flush_or_die()).

Which means that when writing directly to the webserver, Git flushes
stdout for us, but when we redirect stdout to the cache it points to a
regular file so Git no longer flushes the output for us.

The patch is still correct, but perhaps the full explanation is
interesting!

Reported-by: Konstantin Ryabitsev &lt;mricon@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ui-log: ignore unhandled arguments</title>
<updated>2014-06-28T13:57:02+00:00</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2014-06-28T13:55:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=4046e8ef66225928a4f0d2cd71479e401faf7c3b'/>
<id>4046e8ef66225928a4f0d2cd71479e401faf7c3b</id>
<content type='text'>
If you search for a bogus range string here:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/

Using something like "range" and "qwerty123456", it returns an "Internal
Server Error" and the following in the logs:

&gt; [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] fatal:
&gt; ambiguous argument 'qwerty123456': unknown revision or path not in the
&gt; working tree., referer:
&gt; http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
&gt; [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] Use '--' to
&gt; separate paths from revisions, like this:, referer:
&gt; http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
&gt; [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] 'git &lt;command&gt;
&gt; [&lt;revision&gt;...] -- [&lt;file&gt;...]', referer:
&gt; http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
&gt; [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] Premature end
&gt; of script headers: cgit, referer:
&gt; http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/

The cache will kick in, so if you search for the same string again,
it'll show an empty range, so you have to change the bogus strings each
time.

This is because we just pass the arguments straight to Git's revision
parsing machinery which die()s if it cannot parse an argument, printing
the above to stderr and exiting.

The patch below makes it a bit friendlier by just ignoring unhandled
arguments, but I can't see an easy way to report errors when we can't
parse revision arguments without losing the flexibility of supporting
all of the revision specifiers supported by Git.

Reported-by: Konstantin Ryabitsev &lt;mricon@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If you search for a bogus range string here:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/

Using something like "range" and "qwerty123456", it returns an "Internal
Server Error" and the following in the logs:

&gt; [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] fatal:
&gt; ambiguous argument 'qwerty123456': unknown revision or path not in the
&gt; working tree., referer:
&gt; http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
&gt; [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] Use '--' to
&gt; separate paths from revisions, like this:, referer:
&gt; http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
&gt; [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] 'git &lt;command&gt;
&gt; [&lt;revision&gt;...] -- [&lt;file&gt;...]', referer:
&gt; http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/
&gt; [Tue Jun 10 17:45:32 2014] [error] [client 172.21.1.6] Premature end
&gt; of script headers: cgit, referer:
&gt; http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/

The cache will kick in, so if you search for the same string again,
it'll show an empty range, so you have to change the bogus strings each
time.

This is because we just pass the arguments straight to Git's revision
parsing machinery which die()s if it cannot parse an argument, printing
the above to stderr and exiting.

The patch below makes it a bit friendlier by just ignoring unhandled
arguments, but I can't see an easy way to report errors when we can't
parse revision arguments without losing the flexibility of supporting
all of the revision specifiers supported by Git.

Reported-by: Konstantin Ryabitsev &lt;mricon@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update for git 2.0</title>
<updated>2014-06-28T13:14:56+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2014-05-29T15:35:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=79c985e13c10b498c3ea62f4607c2e2a460c3b10'/>
<id>79c985e13c10b498c3ea62f4607c2e2a460c3b10</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>remove trailing whitespaces from source files</title>
<updated>2014-04-17T10:55:09+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2014-04-17T09:55:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=b431282c91deea24916578395d88084261410968'/>
<id>b431282c91deea24916578395d88084261410968</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>git: update to 1.9.2</title>
<updated>2014-04-12T16:05:43+00:00</updated>
<author>
<name>Christian Hesse</name>
<email>mail@eworm.de</email>
</author>
<published>2014-04-10T03:34:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=dcb16f0d11305b4d7cb6357c5c0e21ad67f69871'/>
<id>dcb16f0d11305b4d7cb6357c5c0e21ad67f69871</id>
<content type='text'>
Everything works just bumping the version in Makefile and commit hash in
submodule. No code changes required.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Everything works just bumping the version in Makefile and commit hash in
submodule. No code changes required.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix cgit_parse_url when a repo url is contained in another repo url</title>
<updated>2014-04-05T22:05:36+00:00</updated>
<author>
<name>Julian Maurice</name>
<email>julian.maurice@biblibre.com</email>
</author>
<published>2014-03-28T22:18:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=10451797fa2370aab6f4146c86e0fa939a9a982b'/>
<id>10451797fa2370aab6f4146c86e0fa939a9a982b</id>
<content type='text'>
For example, if I have two repos (remove-suffix is enabled):
  /foo
  /foo/bar

http://cgit/foo/bar/ is interpreted as "repository 'foo', command 'bar'"
instead of "repository 'foo/bar'"
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For example, if I have two repos (remove-suffix is enabled):
  /foo
  /foo/bar

http://cgit/foo/bar/ is interpreted as "repository 'foo', command 'bar'"
instead of "repository 'foo/bar'"
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: use more reliable git tarball mirror</title>
<updated>2014-03-20T17:20:01+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2014-03-20T17:20:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.joursoir.net/cgit/commit/?id=88b93113235452d47e7ce474689327c43e64b843'/>
<id>88b93113235452d47e7ce474689327c43e64b843</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
