<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/config_file.c, branch longpath-printf</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>config: buffer comments to match git's variable-adding</title>
<updated>2015-09-18T10:28:05+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-09-18T10:28:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=cd677b8fe0ff6d843d4733b1a08a5bcff89e4f46'/>
<id>cd677b8fe0ff6d843d4733b1a08a5bcff89e4f46</id>
<content type='text'>
When there is a comment at the end of a section, git keeps it there,
while we write the new variable right at the end.

Keep comments buffered and dump them when we're going to output a
variable or section, or reach EOF. This puts us in line with the config
files which git produces.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When there is a comment at the end of a section, git keeps it there,
while we write the new variable right at the end.

Keep comments buffered and dump them when we're going to output a
variable or section, or reach EOF. This puts us in line with the config
files which git produces.
</pre>
</div>
</content>
</entry>
<entry>
<title>config: implement basic transactional support</title>
<updated>2015-08-12T02:09:09+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-01T17:17:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=b1667039640ba3464ea0e2d13ad28c9244d80b4d'/>
<id>b1667039640ba3464ea0e2d13ad28c9244d80b4d</id>
<content type='text'>
When a configuration file is locked, any updates made to it will be done
to the in-memory copy of the file. This allows for multiple updates to
happen while we hold the lock, preventing races during complex
config-file manipulation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a configuration file is locked, any updates made to it will be done
to the in-memory copy of the file. This allows for multiple updates to
happen while we hold the lock, preventing races during complex
config-file manipulation.
</pre>
</div>
</content>
</entry>
<entry>
<title>config: write the modified file to memory</title>
<updated>2015-08-12T02:09:08+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-06-01T06:45:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=3ce9e4d23572718deeab438ce149013eece57371'/>
<id>3ce9e4d23572718deeab438ce149013eece57371</id>
<content type='text'>
Instead of writing into the filebuf directly, make the functions to
write the modified config file write into a buffer which can then be
dumped into the lockfile for committing.

This allows us to re-use the same code for modifying a locked
configuration, as we can simply skip the last step of dumping the data
to disk.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of writing into the filebuf directly, make the functions to
write the modified config file write into a buffer which can then be
dumped into the lockfile for committing.

This allows us to re-use the same code for modifying a locked
configuration, as we can simply skip the last step of dumping the data
to disk.
</pre>
</div>
</content>
</entry>
<entry>
<title>git__tolower: a tolower() that isn't dumb</title>
<updated>2015-05-29T22:16:46+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-05-29T20:56:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=75a4636f502908ddd406a69a4b065e29b79276da'/>
<id>75a4636f502908ddd406a69a4b065e29b79276da</id>
<content type='text'>
Some brain damaged tolower() implementations appear to want to
take the locale into account, and this may require taking some
insanely aggressive lock on the locale and slowing down what should
be the most trivial of trivial calls for people who just want to
downcase ASCII.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some brain damaged tolower() implementations appear to want to
take the locale into account, and this may require taking some
insanely aggressive lock on the locale and slowing down what should
be the most trivial of trivial calls for people who just want to
downcase ASCII.
</pre>
</div>
</content>
</entry>
<entry>
<title>config: plug a couple of leaks</title>
<updated>2015-05-05T07:47:16+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2015-05-05T07:47:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=b162d97a4f33dbb8d24c2b07ff2f379a074e24ef'/>
<id>b162d97a4f33dbb8d24c2b07ff2f379a074e24ef</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>config: cleanup some now-unused variables</title>
<updated>2015-05-04T12:41:38+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-04-27T20:29:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=63c0cc65bc27850d0fab214370a9814c928911b6'/>
<id>63c0cc65bc27850d0fab214370a9814c928911b6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>config: lock the file for write before reading</title>
<updated>2015-05-04T12:41:37+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-04-27T19:38:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=9c26de0fd175c2fbb9c67908a0f8bcd37e81252b'/>
<id>9c26de0fd175c2fbb9c67908a0f8bcd37e81252b</id>
<content type='text'>
When writing a configuration file, we want to take a lock on the
new file (eg, `config.lock`) before opening the configuration file
(`config`) for reading so that we can prevent somebody from changing
the contents underneath us.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When writing a configuration file, we want to take a lock on the
new file (eg, `config.lock`) before opening the configuration file
(`config`) for reading so that we can prevent somebody from changing
the contents underneath us.
</pre>
</div>
</content>
</entry>
<entry>
<title>config: write existing lines as-is when rewriting</title>
<updated>2015-05-04T12:41:35+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-04-27T14:43:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=2a950c945a24fd279f89469c1a2e78772378fb14'/>
<id>2a950c945a24fd279f89469c1a2e78772378fb14</id>
<content type='text'>
When updating a configuration file, we want to copy the old data
from the file to preserve comments and funny whitespace, instead
of writing it in some "canonical" format.  Thus, we keep a
pointer to the start of the line and the line length to preserve
these things we don't care to rewrite.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When updating a configuration file, we want to copy the old data
from the file to preserve comments and funny whitespace, instead
of writing it in some "canonical" format.  Thus, we keep a
pointer to the start of the line and the line length to preserve
these things we don't care to rewrite.
</pre>
</div>
</content>
</entry>
<entry>
<title>config: examine whole file when writing</title>
<updated>2015-05-04T12:41:33+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-04-23T20:54:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=bf99390eefb66c03ad56cd5131078817092d3322'/>
<id>bf99390eefb66c03ad56cd5131078817092d3322</id>
<content type='text'>
Previously we would try to be clever when writing the configuration
file and try to stop parsing (and simply copy the rest of the old
file) when we either found the value we were trying to write,
or when we left the section that value was in, the assumption being
that there was no more work to do.

Regrettably, you can have another section with the same name later
in the file, and we must cope with that gracefully, thus we read the
whole file in order to write a new file.

Now, writing a file looks even more than reading.  Pull the config
parsing out into its own function that can be used by both reading
and writing the configuration.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously we would try to be clever when writing the configuration
file and try to stop parsing (and simply copy the rest of the old
file) when we either found the value we were trying to write,
or when we left the section that value was in, the assumption being
that there was no more work to do.

Regrettably, you can have another section with the same name later
in the file, and we must cope with that gracefully, thus we read the
whole file in order to write a new file.

Now, writing a file looks even more than reading.  Pull the config
parsing out into its own function that can be used by both reading
and writing the configuration.
</pre>
</div>
</content>
</entry>
<entry>
<title>config: peek returns '\n' on EOF; handle in write</title>
<updated>2015-04-23T15:25:07+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@microsoft.com</email>
</author>
<published>2015-04-21T21:18:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=d369d71f6af3107eb8d47849a678a0ce45799757'/>
<id>d369d71f6af3107eb8d47849a678a0ce45799757</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
