<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/pack-objects.c, 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-02-16T01:11:53Z</updated>
<entry>
<title>Merge branch 'rs/size-t-fixes'</title>
<updated>2023-02-16T01:11:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-02-16T01:11:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5f7b2a6fe34bbdd4453be6620e08dbcf1b695fb'/>
<id>urn:sha1:c5f7b2a6fe34bbdd4453be6620e08dbcf1b695fb</id>
<content type='text'>
Type fixes.

* rs/size-t-fixes:
  pack-objects: use strcspn(3) in name_cmp_len()
  read-cache: use size_t for {base,df}_name_compare()
</content>
</entry>
<entry>
<title>Merge branch 'ew/free-island-marks'</title>
<updated>2023-02-09T22:40:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-02-09T22:40:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d1b2e48feb2a0d136d5980bf47ad8bfe0f7f6a6'/>
<id>urn:sha1:6d1b2e48feb2a0d136d5980bf47ad8bfe0f7f6a6</id>
<content type='text'>
"git pack-objects" learned to release delta-island bitmap data when
it is done using it, saving peak heap memory usage.

* ew/free-island-marks:
  delta-islands: free island_marks and bitmaps
</content>
</entry>
<entry>
<title>pack-objects: use strcspn(3) in name_cmp_len()</title>
<updated>2023-02-06T22:31:11Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2023-02-05T10:42:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e65b868d074a38b3049529064bb05df53948761f'/>
<id>urn:sha1:e65b868d074a38b3049529064bb05df53948761f</id>
<content type='text'>
Call strcspn(3) to find the length of a string terminated by NUL, NL or
slash instead of open-coding it.  Adopt its return type, size_t, to
support strings of arbitrary length.  Use that type in callers as well
for variables and function parameters that receive the return value.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>delta-islands: free island_marks and bitmaps</title>
<updated>2023-02-04T02:01:46Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2023-02-03T23:44:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=647982bb7171b2409f2a90da245b8a31913f930f'/>
<id>urn:sha1:647982bb7171b2409f2a90da245b8a31913f930f</id>
<content type='text'>
On my mirror of linux.git forkgroup with 780 islands, this saves
nearly 4G of heap memory in pack-objects.  This savings only
benefits delta island users of pack bitmaps, as the process
would otherwise be exiting anyways.

However, there's probably not many delta island users, but the
majority of delta island users would also be pack bitmaps users.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Helped-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: add flag `--source` to work with tree-ish</title>
<updated>2023-01-14T16:49:55Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2023-01-14T08:30:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47cfc9bd7d0add617cf6d928e96b7d207be614f1'/>
<id>urn:sha1:47cfc9bd7d0add617cf6d928e96b7d207be614f1</id>
<content type='text'>
The contents of the .gitattributes files may evolve over time, but "git
check-attr" always checks attributes against them in the working tree
and/or in the index. It may be beneficial to optionally allow the users
to check attributes taken from a commit other than HEAD against paths.

Add a new flag `--source` which will allow users to check the
attributes against a commit (actually any tree-ish would do). When the
user uses this flag, we go through the stack of .gitattributes files but
instead of checking the current working tree and/or in the index, we
check the blobs from the provided tree-ish object. This allows the
command to also be used in bare repositories.

Since we use a tree-ish object, the user can pass "--source
HEAD:subdirectory" and all the attributes will be looked up as if
subdirectory was the root directory of the repository.

We cannot simply use the `&lt;rev&gt;:&lt;path&gt;` syntax without the `--source`
flag, similar to how it is used in `git show` because any non-flag
parameter before `--` is treated as an attribute and any parameter after
`--` is treated as a pathname.

The change involves creating a new function `read_attr_from_blob`, which
given the path reads the blob for the path against the provided source and
parses the attributes line by line. This function is plugged into
`read_attr()` function wherein we go through the stack of attributes
files.

Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Toon Claes &lt;toon@iotcl.com&gt;
Co-authored-by: toon@iotcl.com
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-objects: simplify --filter handling</title>
<updated>2022-11-30T01:00:33Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2022-11-29T12:25:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0d5448a554723acfb0d8bbb131e0583504dc7230'/>
<id>urn:sha1:0d5448a554723acfb0d8bbb131e0583504dc7230</id>
<content type='text'>
pack-objects uses OPT_PARSE_LIST_OBJECTS_FILTER_INIT() to initialize the
a rev_info struct lazily before populating its filter member using the
--filter option values.  It tracks whether the initialization is needed
using the .have_revs member of the callback data.

There is a better way: Use a stand-alone list_objects_filter_options
struct and build a rev_info struct with its .filter member after option
parsing.  This allows using the simpler OPT_PARSE_LIST_OBJECTS_FILTER()
and getting rid of the extra callback mechanism.

Even simpler would be using a struct rev_info as before 5cb28270a1
(pack-objects: lazily set up "struct rev_info", don't leak, 2022-03-28),
but that would expose a memory leak caused by repo_init_revisions()
followed by release_revisions() without a setup_revisions() call in
between.

Using list_objects_filter_options also allows pushing the rev_info
struct into get_object_list(), where it arguably belongs. Either way,
this is all left for later.

Helped-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-objects: fix handling of multiple --filter options</title>
<updated>2022-11-30T01:00:33Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2022-11-29T12:23:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=825babe5d5c720cb196f4f12c8eeb15fe00e95a1'/>
<id>urn:sha1:825babe5d5c720cb196f4f12c8eeb15fe00e95a1</id>
<content type='text'>
Since 5cb28270a1 (pack-objects: lazily set up "struct rev_info", don't
leak, 2022-03-28) --filter options given to git pack-objects overrule
earlier ones, letting only the leftmost win and leaking the memory
allocated for earlier ones.  Fix that by only initializing the rev_info
struct once.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/doc-synopsis-and-cmd-usage'</title>
<updated>2022-10-28T18:26:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-10-28T18:26:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b9b634ca5e931941938c93bd233d9c6848fd7b2'/>
<id>urn:sha1:7b9b634ca5e931941938c93bd233d9c6848fd7b2</id>
<content type='text'>
The short-help text shown by "git cmd -h" and the synopsis text
shown at the beginning of "git help cmd" have been made more
consistent.

* ab/doc-synopsis-and-cmd-usage: (34 commits)
  tests: assert consistent whitespace in -h output
  tests: start asserting that *.txt SYNOPSIS matches -h output
  doc txt &amp; -h consistency: make "worktree" consistent
  worktree: define subcommand -h in terms of command -h
  reflog doc: list real subcommands up-front
  doc txt &amp; -h consistency: make "commit" consistent
  doc txt &amp; -h consistency: make "diff-tree" consistent
  doc txt &amp; -h consistency: use "[&lt;label&gt;...]" for "zero or more"
  doc txt &amp; -h consistency: make "annotate" consistent
  doc txt &amp; -h consistency: make "stash" consistent
  doc txt &amp; -h consistency: add missing options
  doc txt &amp; -h consistency: use "git foo" form, not "git-foo"
  doc txt &amp; -h consistency: make "bundle" consistent
  doc txt &amp; -h consistency: make "read-tree" consistent
  doc txt &amp; -h consistency: make "rerere" consistent
  doc txt &amp; -h consistency: add missing options and labels
  doc txt &amp; -h consistency: make output order consistent
  doc txt &amp; -h consistency: add or fix optional "--" syntax
  doc txt &amp; -h consistency: fix mismatching labels
  doc SYNOPSIS &amp; -h: use "-" to separate words in labels, not "_"
  ...
</content>
</entry>
<entry>
<title>doc txt &amp; -h consistency: use "&lt;options&gt;", not "&lt;options&gt;..."</title>
<updated>2022-10-13T16:32:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-10-13T15:39:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=23a9235d523f3e8e7dd9becee23a15559b4e5a32'/>
<id>urn:sha1:23a9235d523f3e8e7dd9becee23a15559b4e5a32</id>
<content type='text'>
It's arguably more correct to say "[&lt;option&gt;...]" than either of these
forms, but the vast majority of our documentation uses the
"[&lt;options&gt;]" form to indicate an arbitrary number of options, let's
do the same in these cases, which were the odd ones out.

In the case of "mv" and "sparse-checkout" let's add the missing "[]"
to indicate that these are optional.

In the case of "t/helper/test-proc-receive.c" there is no *.txt
version, making it the only hunk in this commit that's not a "doc txt
&amp; -h consistency" change.

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>Merge branch 'ab/unused-annotation'</title>
<updated>2022-09-14T19:56:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-09-14T19:56:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dd407f1c7c7cce148d7313537494d0bc049ccb0e'/>
<id>urn:sha1:dd407f1c7c7cce148d7313537494d0bc049ccb0e</id>
<content type='text'>
Undoes 'jk/unused-annotation' topic and redoes it to work around
Coccinelle rules misfiring false positives in unrelated codepaths.

* ab/unused-annotation:
  git-compat-util.h: use "deprecated" for UNUSED variables
  git-compat-util.h: use "UNUSED", not "UNUSED(var)"
</content>
</entry>
</feed>
