<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-01-06T21:53:32Z</updated>
<entry>
<title>refs/files-backend: don't peek into `struct lock_file`</title>
<updated>2021-01-06T21:53:32Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2021-01-05T19:23:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7f0dc7998be01371c99517dc616421239405476c'/>
<id>urn:sha1:7f0dc7998be01371c99517dc616421239405476c</id>
<content type='text'>
Similar to the previous commits, avoid peeking into the `struct
lock_file`. Use the lock file API instead. Note how we obtain the path
to the lock file if `fdopen_lock_file()` failed and that this is not a
problem: as documented in lockfile.h, failure to "fdopen" does not roll
back the lock file and we're free to, e.g., query it for its path.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Reviewed-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'hn/refs-trace-backend'</title>
<updated>2020-09-22T19:36:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-22T19:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c9a04f036f6d52a2bca1c41bda6ecc1633c8e4cb'/>
<id>urn:sha1:c9a04f036f6d52a2bca1c41bda6ecc1633c8e4cb</id>
<content type='text'>
Developer support.

* hn/refs-trace-backend:
  refs: add GIT_TRACE_REFS debugging mechanism
</content>
</entry>
<entry>
<title>refs: add GIT_TRACE_REFS debugging mechanism</title>
<updated>2020-09-09T19:58:37Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-09-09T10:15:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4441f4270758042cc38ce8c04e4350ada743b28a'/>
<id>urn:sha1:4441f4270758042cc38ce8c04e4350ada743b28a</id>
<content type='text'>
When set in the environment, GIT_TRACE_REFS makes git print operations and
results as they flow through the ref storage backend. This helps debug
discrepancies between different ref backends.

Example:

    $ GIT_TRACE_REFS="1" ./git branch
    15:42:09.769631 refs/debug.c:26         ref_store for .git
    15:42:09.769681 refs/debug.c:249        read_raw_ref: HEAD: 0000000000000000000000000000000000000000 (=&gt; refs/heads/ref-debug) type 1: 0
    15:42:09.769695 refs/debug.c:249        read_raw_ref: refs/heads/ref-debug: 3a238e539bcdfe3f9eb5010fd218640c1b499f7a (=&gt; refs/heads/ref-debug) type 0: 0
    15:42:09.770282 refs/debug.c:233        ref_iterator_begin: refs/heads/ (0x1)
    15:42:09.770290 refs/debug.c:189        iterator_advance: refs/heads/b4 (0)
    15:42:09.770295 refs/debug.c:189        iterator_advance: refs/heads/branch3 (0)

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: move REF_LOG_ONLY to refs-internal.h</title>
<updated>2020-09-08T22:51:07Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-08-28T15:25:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=63c056736544c8273dc6dc4275c2f2857bbaee44'/>
<id>urn:sha1:63c056736544c8273dc6dc4275c2f2857bbaee44</id>
<content type='text'>
REF_LOG_ONLY is used in the transaction preparation: if a symref is involved in
a transaction, the referent of the symref should be updated, and the symref
itself should only be updated in the reflog.

Other ref backends will need to duplicate this logic too, so move it to a
central place.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: move gitdir into base ref_store</title>
<updated>2020-08-19T21:08:04Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-08-19T14:27:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5085aef4c8e569e5d688d9f35790a2ca2c2f4c11'/>
<id>urn:sha1:5085aef4c8e569e5d688d9f35790a2ca2c2f4c11</id>
<content type='text'>
Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: fix comment about submodule ref_stores</title>
<updated>2020-08-19T21:08:03Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-08-19T14:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4877c6c738c62906fc69cbf79b1e5f3dcc263942'/>
<id>urn:sha1:4877c6c738c62906fc69cbf79b1e5f3dcc263942</id>
<content type='text'>
Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: split off reading loose ref data in separate function</title>
<updated>2020-08-19T21:08:03Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-08-19T14:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e39620f07e092f36642ab97c6ced47be5b609d58'/>
<id>urn:sha1:e39620f07e092f36642ab97c6ced47be5b609d58</id>
<content type='text'>
This prepares for handling FETCH_HEAD (which is not a regular ref)
separately from the ref backend.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: move the logic to add \t to reflog to the files backend</title>
<updated>2020-07-31T17:21:51Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-07-31T11:36:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=25429fed5ce134bce9f729d927ac397badae1959'/>
<id>urn:sha1:25429fed5ce134bce9f729d927ac397badae1959</id>
<content type='text'>
523fa69c (reflog: cleanse messages in the refs.c layer, 2020-07-10)
centralized reflog normalizaton.  However, the normalizaton added a
leading "\t" to the message. This is an artifact of the reflog
storage format in the files backend, so it should be added there.

Routines that parse back the reflog (such as grab_nth_branch_switch)
expect the "\t" to not be in the message, so without this fix, git
with reftable cannot process the "@{-1}" syntax.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>reflog: cleanse messages in the refs.c layer</title>
<updated>2020-07-10T20:53:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-07-10T17:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=523fa69c36744ae6779e38614cb9bfb2be552923'/>
<id>urn:sha1:523fa69c36744ae6779e38614cb9bfb2be552923</id>
<content type='text'>
Regarding reflog messages:

 - We expect that a reflog message consists of a single line.  The
   file format used by the files backend may add a LF after the
   message as a delimiter, and output by commands like "git log -g"
   may complete such an incomplete line by adding a LF at the end,
   but philosophically, the terminating LF is not a part of the
   message.

 - We however allow callers of refs API to supply a random sequence
   of NUL terminated bytes.  We cleanse caller-supplied message by
   squashing a run of whitespaces into a SP, and by trimming trailing
   whitespace, before storing the message.  This is how we tolerate,
   instead of erring out, a message with LF in it (be it at the end,
   in the middle, or both).

Currently, the cleansing of the reflog message is done by the files
backend, before the log is written out.  This is sufficient with the
current code, as that is the only backend that writes reflogs.  But
new backends can be added that write reflogs, and we'd want the
resulting log message we would read out of "log -g" the same no
matter what backend is used, and moving the code to do so to the
generic layer is a way to do so.

An added benefit is that the "cleansing" function could be updated
later, independent from individual backends, to e.g. allow
multi-line log messages if we wanted to, and when that happens, it
would help a lot to ensure we covered all bases if the cleansing
function (which would be updated) is called from the generic layer.

Side note: I am not interested in supporting multi-line reflog
messages right at the moment (nobody is asking for it), but I
envision that instead of the "squash a run of whitespaces into a SP
and rtrim" cleansing, we can %urlencode problematic bytes in the
message *AND* append a SP at the end, when a new version of Git that
supports multi-line and/or verbatim reflog messages writes a reflog
record.  The reading side can detect the presense of SP at the end
(which should have been rtrimmed out if it were written by existing
versions of Git) as a signal that decoding %urlencode recovers the
original reflog message.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: improve documentation for ref iterator</title>
<updated>2020-05-20T17:39:02Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-05-20T17:36:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=84ee4ca10d7f598542eb2c1ea2cdf6199f9bdee1'/>
<id>urn:sha1:84ee4ca10d7f598542eb2c1ea2cdf6199f9bdee1</id>
<content type='text'>
Document some of the flag options in refs_ref_iterator_begin, and explain how
ref_iterator_advance_fn should handle them.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
