<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/fetch.c, branch v2.20.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.20.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.20.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-11-18T09:23:53Z</updated>
<entry>
<title>Merge branch 'jk/unused-parameter-fixes'</title>
<updated>2018-11-18T09:23:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-18T09:23:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ab96f28ba4deb71ff64b31bd63cee96314db7112'/>
<id>urn:sha1:ab96f28ba4deb71ff64b31bd63cee96314db7112</id>
<content type='text'>
Various functions have been audited for "-Wunused-parameter" warnings
and bugs in them got fixed.

* jk/unused-parameter-fixes:
  midx: double-check large object write loop
  assert NOARG/NONEG behavior of parse-options callbacks
  parse-options: drop OPT_DATE()
  apply: return -1 from option callback instead of calling exit(1)
  cat-file: report an error on multiple --batch options
  tag: mark "--message" option with NONEG
  show-branch: mark --reflog option as NONEG
  format-patch: mark "--no-numbered" option with NONEG
  status: mark --find-renames option with NONEG
  cat-file: mark batch options with NONEG
  pack-objects: mark index-version option as NONEG
  ls-files: mark exclude options as NONEG
  am: handle --no-patch-format option
  apply: mark include/exclude options as NONEG
</content>
</entry>
<entry>
<title>Merge branch 'jc/war-on-string-list'</title>
<updated>2018-11-13T13:37:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-13T13:37:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd4bb3806bcccbd8afa5dd45052ea37a882708ba'/>
<id>urn:sha1:fd4bb3806bcccbd8afa5dd45052ea37a882708ba</id>
<content type='text'>
Replace three string-list instances used as look-up tables in "git
fetch" with hashmaps.

* jc/war-on-string-list:
  fetch: replace string-list used as a look-up table with a hashmap
</content>
</entry>
<entry>
<title>assert NOARG/NONEG behavior of parse-options callbacks</title>
<updated>2018-11-06T03:56:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-11-05T06:45:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=517fe807d6903c629a739b23fe0e75b892096998'/>
<id>urn:sha1:517fe807d6903c629a739b23fe0e75b892096998</id>
<content type='text'>
When we define a parse-options callback, the flags we put in the option
struct must match what the callback expects. For example, a callback
which does not handle the "unset" parameter should only be used with
PARSE_OPT_NONEG. But since the callback and the option struct are not
defined next to each other, it's easy to get this wrong (as earlier
patches in this series show).

Fortunately, the compiler can help us here: compiling with
-Wunused-parameters can show us which callbacks ignore their "unset"
parameters (and likewise, ones that ignore "arg" expect to be triggered
with PARSE_OPT_NOARG).

But after we've inspected a callback and determined that all of its
callers use the right flags, what do we do next? We'd like to silence
the compiler warning, but do so in a way that will catch any wrong calls
in the future.

We can do that by actually checking those variables and asserting that
they match our expectations. Because this is such a common pattern,
we'll introduce some helper macros. The resulting messages aren't
as descriptive as we could make them, but the file/line information from
BUG() is enough to identify the problem (and anyway, the point is that
these should never be seen).

Each of the annotated callbacks in this patch triggers
-Wunused-parameters, and was manually inspected to make sure all callers
use the correct options (so none of these BUGs should be triggerable).

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: replace string-list used as a look-up table with a hashmap</title>
<updated>2018-11-01T05:37:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-25T20:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e198b3a740409fabe5ba774c5f1255b55fdd21c1'/>
<id>urn:sha1:e198b3a740409fabe5ba774c5f1255b55fdd21c1</id>
<content type='text'>
In find_non_local_tags() helper function (used to implement the
"follow tags"), we use string_list_has_string() on two string lists
as a way to see if a refname has already been processed, etc.

All this code predates more modern in-core lookup API like hashmap;
replace them with two hashmaps and one string list---the hashmaps
are used for look-ups and the string list is to keep the order of
items in the returned result stable (which is the only single thing
hashmap does worse than lookups on string-list).

Similarly, get_ref_map() uses another string-list as a look-up table
for existing refs.  Replace it with a hashmap.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jt/avoid-ls-refs'</title>
<updated>2018-10-19T04:34:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-19T04:34:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0527fbab689929de47ab3fa7baf1e7618ffa704f'/>
<id>urn:sha1:0527fbab689929de47ab3fa7baf1e7618ffa704f</id>
<content type='text'>
Over some transports, fetching objects with an exact commit object
name can be done without first seeing the ref advertisements.  The
code has been optimized to exploit this.

* jt/avoid-ls-refs:
  fetch: do not list refs if fetching only hashes
  transport: list refs before fetch if necessary
  transport: do not list refs if possible
  transport: allow skipping of ref listing
</content>
</entry>
<entry>
<title>fetch: do not list refs if fetching only hashes</title>
<updated>2018-10-07T00:53:21Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2018-09-27T19:24:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e70a3030e747312327a4f3619247bf8a986aa577'/>
<id>urn:sha1:e70a3030e747312327a4f3619247bf8a986aa577</id>
<content type='text'>
If only hash literals are given on a "git fetch" command-line, tag
following is not requested, and the fetch is done using protocol v2, a
list of refs is not required from the remote. Therefore, optimize by
invoking transport_get_remote_refs() only if we need the refs.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch: in partial clone, check presence of targets</title>
<updated>2018-09-21T20:20:49Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2018-09-21T18:22:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=35f9e3e5e7a6436b50a8709e7e14a65a10cc1e7a'/>
<id>urn:sha1:35f9e3e5e7a6436b50a8709e7e14a65a10cc1e7a</id>
<content type='text'>
When fetching an object that is known as a promisor object to the local
repository, the connectivity check in quickfetch() in builtin/fetch.c
succeeds, causing object transfer to be bypassed. However, this should
not happen if that object is merely promised and not actually present.

Because this happens, when a user invokes "git fetch origin &lt;sha-1&gt;" on
the command-line, the &lt;sha-1&gt; object may not actually be fetched even
though the command returns an exit code of 0. This is a similar issue
(but with a different cause) to the one fixed by a0c9016abd
("upload-pack: send refs' objects despite "filter"", 2018-07-09).

Therefore, update quickfetch() to also directly check for the presence
of all objects to be fetched. Its documentation and name are also
updated to better reflect what it does.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/fetch-tags-noclobber'</title>
<updated>2018-09-17T20:54:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-17T20:54:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d39cab3989f9e660cae124f78143369b13ad2901'/>
<id>urn:sha1:d39cab3989f9e660cae124f78143369b13ad2901</id>
<content type='text'>
The rules used by "git push" and "git fetch" to determine if a ref
can or cannot be updated were inconsistent; specifically, fetching
to update existing tags were allowed even though tags are supposed
to be unmoving anchoring points.  "git fetch" was taught to forbid
updates to existing tags without the "--force" option.

* ab/fetch-tags-noclobber:
  fetch: stop clobbering existing tags without --force
  fetch: document local ref updates with/without --force
  push doc: correct lies about how push refspecs work
  push doc: move mention of "tag &lt;tag&gt;" later in the prose
  push doc: remove confusing mention of remote merger
  fetch tests: add a test for clobbering tag behavior
  push tests: use spaces in interpolated string
  push tests: make use of unused $1 in test description
  fetch: change "branch" to "reference" in --force -h output
</content>
</entry>
<entry>
<title>Merge branch 'jk/cocci'</title>
<updated>2018-09-17T20:53:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-17T20:53:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3'/>
<id>urn:sha1:769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3</id>
<content type='text'>
spatch transformation to replace boolean uses of !hashcmp() to
newly introduced oideq() is added, and applied, to regain
performance lost due to support of multiple hash algorithms.

* jk/cocci:
  show_dirstat: simplify same-content check
  read-cache: use oideq() in ce_compare functions
  convert hashmap comparison functions to oideq()
  convert "hashcmp() != 0" to "!hasheq()"
  convert "oidcmp() != 0" to "!oideq()"
  convert "hashcmp() == 0" to hasheq()
  convert "oidcmp() == 0" to oideq()
  introduce hasheq() and oideq()
  coccinelle: use &lt;...&gt; for function exclusion
</content>
</entry>
<entry>
<title>Merge branch 'ds/reachable'</title>
<updated>2018-09-17T20:53:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-17T20:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1b7a91da71d42759dfb83fa3a17be54ad01f0132'/>
<id>urn:sha1:1b7a91da71d42759dfb83fa3a17be54ad01f0132</id>
<content type='text'>
The code for computing history reachability has been shuffled,
obtained a bunch of new tests to cover them, and then being
improved.

* ds/reachable:
  commit-reach: correct accidental #include of C file
  commit-reach: use can_all_from_reach
  commit-reach: make can_all_from_reach... linear
  commit-reach: replace ref_newer logic
  test-reach: test commit_contains
  test-reach: test can_all_from_reach_with_flags
  test-reach: test reduce_heads
  test-reach: test get_merge_bases_many
  test-reach: test is_descendant_of
  test-reach: test in_merge_bases
  test-reach: create new test tool for ref_newer
  commit-reach: move can_all_from_reach_with_flags
  upload-pack: generalize commit date cutoff
  upload-pack: refactor ok_to_give_up()
  upload-pack: make reachable() more generic
  commit-reach: move commit_contains from ref-filter
  commit-reach: move ref_newer from remote.c
  commit.h: remove method declarations
  commit-reach: move walk methods from commit.c
</content>
</entry>
</feed>
