<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fetch-pack.c, branch v2.45.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.45.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.45.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-07-02T16:27:58Z</updated>
<entry>
<title>Merge branch 'jk/fetch-pack-fsck-wo-lock-pack' into maint-2.45</title>
<updated>2024-07-02T16:27:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-07-02T16:27:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5cf6e9b022cd281b2da66c58b5c033b9b735c160'/>
<id>urn:sha1:5cf6e9b022cd281b2da66c58b5c033b9b735c160</id>
<content type='text'>
"git fetch-pack -k -k" without passing "--lock-pack" (which we
never do ourselves) did not work at all, which has been corrected.

* jk/fetch-pack-fsck-wo-lock-pack:
  fetch-pack: fix segfault when fscking without --lock-pack
</content>
</entry>
<entry>
<title>Merge branch 'dg/fetch-pack-code-cleanup' into maint-2.45</title>
<updated>2024-06-28T22:53:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-06-28T22:53:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=db15f4d7940844b31ed0125808aca85526607f1a'/>
<id>urn:sha1:db15f4d7940844b31ed0125808aca85526607f1a</id>
<content type='text'>
Code clean-up to remove an unused struct definition.

* dg/fetch-pack-code-cleanup:
  fetch-pack: remove unused 'struct loose_object_iter'
</content>
</entry>
<entry>
<title>fetch-pack: fix segfault when fscking without --lock-pack</title>
<updated>2024-06-20T17:58:00Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2024-06-19T13:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=96a6621d256dc39a561913f5aadd1605ba33f161'/>
<id>urn:sha1:96a6621d256dc39a561913f5aadd1605ba33f161</id>
<content type='text'>
The fetch-pack internals have multiple options related to creating
".keep" lock-files for the received pack:

  - if args.lock_pack is set, then we tell index-pack to create a .keep
    file. In the fetch-pack plumbing command, this is triggered by
    passing "-k" twice.

  - if the caller passes in a pack_lockfiles string list, then we use it
    to record the path of the keep-file created by index-pack. We get
    that name by reading the stdout of index-pack. In the fetch-pack
    command, this is triggered by passing the (undocumented) --lock-pack
    option; without it, we pass in a NULL string list.

So it's possible to ask index-pack to create the lock-file (using "-k
-k") but not ask to record it (by avoiding "--lock-pack"). This worked
fine until 5476e1efde (fetch-pack: print and use dangling .gitmodules,
2021-02-22), but now it causes a segfault.

Before that commit, if pack_lockfiles was NULL, we wouldn't bother
reading the output from index-pack at all. But since that commit,
index-pack may produce extra output if we asked it to fsck. So even if
nobody cares about the lockfile path, we still need to read it to skip
to the output we do care about.

We correctly check that we didn't get a NULL lockfile path (which can
happen if we did not ask it to create a .keep file at all), but we
missed the case where the lockfile path is not NULL (due to "-k -k") but
the pack_lockfiles string_list is NULL (because nobody passed
"--lock-pack"), and segfault trying to add to the NULL string-list.

We can fix this by skipping the append to the string list when either
the value or the list is NULL. In that case we must also free the
lockfile path to avoid leaking it when it's non-NULL.

Nobody noticed the bug for so long because the transport code used by
"git fetch" always passes in a pack_lockfiles pointer, and remote-curl
(the main user of the fetch-pack plumbing command) always passes
--lock-pack.

Reported-by: Kirill Smelkov &lt;kirr@nexedi.com&gt;
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>fetch-pack: remove unused 'struct loose_object_iter'</title>
<updated>2024-05-13T23:55:20Z</updated>
<author>
<name>Dr. David Alan Gilbert</name>
<email>dave@treblig.org</email>
</author>
<published>2024-05-12T00:59:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc0202b0e9679d44ebc5806c07439442d0a94a7a'/>
<id>urn:sha1:fc0202b0e9679d44ebc5806c07439442d0a94a7a</id>
<content type='text'>
'struct loose_object_iter' in fetch-pack.c is unused since commit
97b2fa08 (fetch-pack: drop custom loose object cache, 2018-11-12).

Remove it.

Signed-off-by: Dr. David Alan Gilbert &lt;dave@treblig.org&gt;
Acked-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sd/negotiate-trace-fix'</title>
<updated>2024-01-30T21:34:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-01-30T21:34:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65973e4e995f1c7d3c71105edd0d9b6578a9e779'/>
<id>urn:sha1:65973e4e995f1c7d3c71105edd0d9b6578a9e779</id>
<content type='text'>
Tracing fix.

* sd/negotiate-trace-fix:
  push: region_leave trace for negotiate_using_fetch
</content>
</entry>
<entry>
<title>Merge branch 'en/header-cleanup'</title>
<updated>2024-01-08T22:05:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-01-08T22:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=492ee03f60297e7e83d101f4519ab8abc98782bc'/>
<id>urn:sha1:492ee03f60297e7e83d101f4519ab8abc98782bc</id>
<content type='text'>
Remove unused header "#include".

* en/header-cleanup:
  treewide: remove unnecessary includes in source files
  treewide: add direct includes currently only pulled in transitively
  trace2/tr2_tls.h: remove unnecessary include
  submodule-config.h: remove unnecessary include
  pkt-line.h: remove unnecessary include
  line-log.h: remove unnecessary include
  http.h: remove unnecessary include
  fsmonitor--daemon.h: remove unnecessary includes
  blame.h: remove unnecessary includes
  archive.h: remove unnecessary include
  treewide: remove unnecessary includes in source files
  treewide: remove unnecessary includes from header files
</content>
</entry>
<entry>
<title>push: region_leave trace for negotiate_using_fetch</title>
<updated>2024-01-03T23:32:44Z</updated>
<author>
<name>Sam Delmerico</name>
<email>delmerico@google.com</email>
</author>
<published>2024-01-03T22:40:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee9895b0ff0475c4883234a9004f02b19065cd12'/>
<id>urn:sha1:ee9895b0ff0475c4883234a9004f02b19065cd12</id>
<content type='text'>
There were two region_enter events for negotiate_using_fetch instead of
one enter and one leave. This commit replaces the second region_enter
event with a region_leave.

Signed-off-by: Sam Delmerico &lt;delmerico@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>treewide: remove unnecessary includes in source files</title>
<updated>2023-12-26T20:04:31Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-12-23T17:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eea0e59ffbed6e33d171ace5be13cde9faa41639'/>
<id>urn:sha1:eea0e59ffbed6e33d171ace5be13cde9faa41639</id>
<content type='text'>
Each of these were checked with
   gcc -E -I. ${SOURCE_FILE} | grep ${HEADER_FILE}
to ensure that removing the direct inclusion of the header actually
resulted in that header no longer being included at all (i.e. that
no other header pulled it in transitively).

...except for a few cases where we verified that although the header
was brought in transitively, nothing from it was directly used in
that source file.  These cases were:
  * builtin/credential-cache.c
  * builtin/pull.c
  * builtin/send-pack.c

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsck: handle NULL value when parsing message config</title>
<updated>2023-12-08T23:24:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-12-07T07:11:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d49cb162fa752d62cf20548ae057471d348e42ae'/>
<id>urn:sha1:d49cb162fa752d62cf20548ae057471d348e42ae</id>
<content type='text'>
When parsing fsck.*, receive.fsck.*, or fetch.fsck.*, we don't check for
an implicit bool. So any of:

  [fsck]
  badTree
  [receive "fsck"]
  badTree
  [fetch "fsck"]
  badTree

will cause us to segfault. We can fix it with config_error_nonbool() in
the usual way, but we have to make a few more changes to get good error
messages. The problem is that all three spots do:

  if (skip_prefix(var, "fsck.", &amp;var))

to match and parse the actual message id. But that means that "var" now
just says "badTree" instead of "receive.fsck.badTree", making the
resulting message confusing. We can fix that by storing the parsed
message id in its own separate variable.

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 'ts/unpacklimit-config-fix'</title>
<updated>2023-08-30T20:50:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-08-30T20:50:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc48906c3b0ce0cb472b6c97fa66fa2d396b59e4'/>
<id>urn:sha1:cc48906c3b0ce0cb472b6c97fa66fa2d396b59e4</id>
<content type='text'>
transfer.unpackLimit ought to be used as a fallback, but overrode
fetch.unpackLimit and receive.unpackLimit instead.

* ts/unpacklimit-config-fix:
  transfer.unpackLimit: fetch/receive.unpackLimit takes precedence
</content>
</entry>
</feed>
