<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-01-02T12:37:19Z</updated>
<entry>
<title>Merge branch 'ps/fsync-refs-fix'</title>
<updated>2023-01-02T12:37:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-01-02T12:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ed91c5f22084eaf8c3a324fb82017fec8361a14'/>
<id>urn:sha1:3ed91c5f22084eaf8c3a324fb82017fec8361a14</id>
<content type='text'>
Fix the sequence to fsync $GIT_DIR/packed-refs file that forgot to
flush its output to the disk..

* ps/fsync-refs-fix:
  refs: fix corruption by not correctly syncing packed-refs to disk
</content>
</entry>
<entry>
<title>refs: fix corruption by not correctly syncing packed-refs to disk</title>
<updated>2022-12-25T07:18:12Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2022-12-20T14:52:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce54672f9b017adf60d15bc7174994b63cb29d3a'/>
<id>urn:sha1:ce54672f9b017adf60d15bc7174994b63cb29d3a</id>
<content type='text'>
At GitLab we have recently received a report where a repository was left
with a corrupted `packed-refs` file after the node hard-crashed even
though `core.fsync=reference` was set. This is something that in theory
should not happen if we correctly did the atomic-rename dance to:

    1. Write the data into a temporary file.

    2. Synchronize the temporary file to disk.

    3. Rename the temporary file into place.

So if we crash in the middle of writing the `packed-refs` file we should
only ever see either the old or the new state of the file.

And while we do the dance when writing the `packed-refs` file, there is
indeed one gotcha: we use a `FILE *` stream to write the temporary file,
but don't flush it before synchronizing it to disk. As a consequence any
data that is still buffered will not get synchronized and a crash of the
machine may cause corruption.

Fix this bug by flushing the file stream before we fsync.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: unify parse_worktree_ref() and ref_type()</title>
<updated>2022-09-19T18:11:11Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2022-09-19T16:34:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=71e5473493612f74244e2fa7a257a868df98be53'/>
<id>urn:sha1:71e5473493612f74244e2fa7a257a868df98be53</id>
<content type='text'>
The logic to handle worktree refs (worktrees/NAME/REF and
main-worktree/REF) existed in two places:

* ref_type() in refs.c

* parse_worktree_ref() in worktree.c

Collapse this logic together in one function parse_worktree_ref():
this avoids having to cross-check the result of parse_worktree_ref()
and ref_type().

Introduce enum ref_worktree_type, which is slightly different from
enum ref_type. The latter is a misleading name (one would think that
'ref_type' would have the symref option).

Instead, enum ref_worktree_type only makes explicit how a refname
relates to a worktree. From this point of view, HEAD and
refs/bisect/abc are the same: they specify the current worktree
implicitly.

The files-backend must avoid packing refs/bisect/* and friends into
packed-refs, so expose is_per_worktree_ref() separately.

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>git-compat-util.h: use "UNUSED", not "UNUSED(var)"</title>
<updated>2022-09-01T17:49:48Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-08-25T17:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5cf88fd8b059235b21ee2f72b17bf1f421a9c4e7'/>
<id>urn:sha1:5cf88fd8b059235b21ee2f72b17bf1f421a9c4e7</id>
<content type='text'>
As reported in [1] the "UNUSED(var)" macro introduced in
2174b8c75de (Merge branch 'jk/unused-annotation' into next,
2022-08-24) breaks coccinelle's parsing of our sources in files where
it occurs.

Let's instead partially go with the approach suggested in [2] of
making this not take an argument. As noted in [1] "coccinelle" will
ignore such tokens in argument lists that it doesn't know about, and
it's less of a surprise to syntax highlighters.

This undoes the "help us notice when a parameter marked as unused is
actually use" part of 9b240347543 (git-compat-util: add UNUSED macro,
2022-08-19), a subsequent commit will further tweak the macro to
implement a replacement for that functionality.

1. https://lore.kernel.org/git/220825.86ilmg4mil.gmgdl@evledraar.gmail.com/
2. https://lore.kernel.org/git/220819.868rnk54ju.gmgdl@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: mark unused virtual method parameters</title>
<updated>2022-08-19T19:18:55Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-08-19T10:08:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7718827a2d4ec90c9cbdb7ec01f68065bdb52dc2'/>
<id>urn:sha1:7718827a2d4ec90c9cbdb7ec01f68065bdb52dc2</id>
<content type='text'>
The refs code uses various polymorphic types (e.g., loose vs packed
ref_stores, abstracted iterators). Not every virtual function or
callback needs all of its parameters. Let's mark the unused ones to
quiet -Wunused-parameter.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: mark unused each_ref_fn parameters</title>
<updated>2022-08-19T19:18:54Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-08-19T10:08:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=63e14ee2d69b58eae72e34df81f2cde145427037'/>
<id>urn:sha1:63e14ee2d69b58eae72e34df81f2cde145427037</id>
<content type='text'>
Functions used with for_each_ref(), etc, need to conform to the
each_ref_fn interface. But most of them don't need every parameter;
let's annotate the unused ones to quiet -Wunused-parameter.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ep/maint-equals-null-cocci'</title>
<updated>2022-05-20T22:26:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-20T22:26:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=538dc459a0331c48b893c9f6ca0be5917860bb99'/>
<id>urn:sha1:538dc459a0331c48b893c9f6ca0be5917860bb99</id>
<content type='text'>
Introduce and apply coccinelle rule to discourage an explicit
comparison between a pointer and NULL, and applies the clean-up to
the maintenance track.

* ep/maint-equals-null-cocci:
  tree-wide: apply equals-null.cocci
  tree-wide: apply equals-null.cocci
  contrib/coccinnelle: add equals-null.cocci
</content>
</entry>
<entry>
<title>Merge branch 'ep/maint-equals-null-cocci' for maint-2.35</title>
<updated>2022-05-02T17:06:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-02T17:06:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b0a58d164b0642be3eeb476fecd28114445cdd5'/>
<id>urn:sha1:2b0a58d164b0642be3eeb476fecd28114445cdd5</id>
<content type='text'>
* ep/maint-equals-null-cocci:
  tree-wide: apply equals-null.cocci
  contrib/coccinnelle: add equals-null.cocci
</content>
</entry>
<entry>
<title>tree-wide: apply equals-null.cocci</title>
<updated>2022-05-02T16:50:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-02T16:50:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afe8a9070bc62db9cfde1e30147178c40d391d93'/>
<id>urn:sha1:afe8a9070bc62db9cfde1e30147178c40d391d93</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Revert "Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'"</title>
<updated>2022-04-13T22:51:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-04-13T22:51:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c6da34a610e58f7e58042b5ed24a19bd2c18e928'/>
<id>urn:sha1:c6da34a610e58f7e58042b5ed24a19bd2c18e928</id>
<content type='text'>
This reverts commit 991b4d47f0accd3955d05927d5ce434e03ffbdb6, reversing
changes made to bcd020f88e1e22f38422ac3f73ab06b34ec4bef1.
</content>
</entry>
</feed>
