<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/pack-refs.h, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-09-19T17:02:55Z</updated>
<entry>
<title>builtin/pack-refs: factor out core logic into a shared library</title>
<updated>2025-09-19T17:02:55Z</updated>
<author>
<name>Meet Soni</name>
<email>meetsoni3017@gmail.com</email>
</author>
<published>2025-09-19T08:26:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0d4ec339227d04bcba89390bdef22d4dce30d271'/>
<id>urn:sha1:0d4ec339227d04bcba89390bdef22d4dce30d271</id>
<content type='text'>
The implementation of `git pack-refs` is monolithic within
`cmd_pack_refs()`, making it impossible to share its logic with other
commands. To enable code reuse for the upcoming `git refs optimize`
subcommand, refactor the core logic into a shared helper function.

Split the original `builtin/pack-refs.c` file into two parts:

- A new shared library file, `pack-refs.c`, which contains the
  core option parsing and packing logic in a new `pack_refs_core()`
  helper function.

- The original `builtin/pack-refs.c`, which is now a thin wrapper
  responsible only for defining the `git pack-refs` command and
  calling the shared helper.

A new `pack-refs.h` header is also introduced to define the public
interface for this shared logic.

Mentored-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Mentored-by: shejialuo &lt;shejialuo@gmail.com&gt;
Signed-off-by: Meet Soni &lt;meetsoni3017@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-refs: merge code from pack-refs.{c,h} into refs.{c,h}</title>
<updated>2013-05-01T22:33:11Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2013-04-22T19:52:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=32d462cea80cd52b2c3fa0d538aba7fcf079ba77'/>
<id>urn:sha1:32d462cea80cd52b2c3fa0d538aba7fcf079ba77</id>
<content type='text'>
pack-refs.c doesn't contain much code, and the code it does contain is
closely related to reference handling.  Moreover, there is some
duplication between pack_refs() and repack_without_ref().  Therefore,
merge pack-refs.c into refs.c and pack-refs.h into refs.h.

The code duplication will be addressed in future commits.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Move pack_refs() and friends into libgit</title>
<updated>2008-06-19T22:53:13Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2008-06-15T14:05:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=94e724a741590e741a540075c07a961082e3c80a'/>
<id>urn:sha1:94e724a741590e741a540075c07a961082e3c80a</id>
<content type='text'>
This moves pack_refs() and underlying functionality into the library,
to make pack-refs functionality easily available to all git programs.

Most of builtin-pack-refs.c has been moved verbatim into a new file
pack-refs.c that is compiled into libgit.a. A corresponding header
file, pack-refs.h, has also been added, declaring pack_refs() and
the #defines associated with the flags parameter to pack_refs().

This patch introduces no other changes in functionality.

Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
