<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-05-30T05:04:07Z</updated>
<entry>
<title>Merge branch 'js/use-bug-macro'</title>
<updated>2018-05-30T05:04:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-30T05:04:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50f08db5941755b69012378bfc86f6b8ee98edf4'/>
<id>urn:sha1:50f08db5941755b69012378bfc86f6b8ee98edf4</id>
<content type='text'>
Developer support update, by using BUG() macro instead of die() to
mark codepaths that should not happen more clearly.

* js/use-bug-macro:
  BUG_exit_code: fix sparse "symbol not declared" warning
  Convert remaining die*(BUG) messages
  Replace all die("BUG: ...") calls by BUG() ones
  run-command: use BUG() to report bugs, not die()
  test-tool: help verifying BUG() code paths
</content>
</entry>
<entry>
<title>Merge branch 'ma/lockfile-cleanup'</title>
<updated>2018-05-30T05:04:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-30T05:04:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2f76ebc93ca6bfc2aba1be330aabe391a7d093d2'/>
<id>urn:sha1:2f76ebc93ca6bfc2aba1be330aabe391a7d093d2</id>
<content type='text'>
Code clean-up to adjust to a more recent lockfile API convention that
allows lockfile instances kept on the stack.

* ma/lockfile-cleanup:
  lock_file: move static locks into functions
  lock_file: make function-local locks non-static
  refs.c: do not die if locking fails in `delete_pseudoref()`
  refs.c: do not die if locking fails in `write_pseudoref()`
  t/helper/test-write-cache: clean up lock-handling
</content>
</entry>
<entry>
<title>lock_file: make function-local locks non-static</title>
<updated>2018-05-10T05:54:45Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2018-05-09T20:55:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b227586831ed393e1d60629bfedcef01be4b9c22'/>
<id>urn:sha1:b227586831ed393e1d60629bfedcef01be4b9c22</id>
<content type='text'>
Placing `struct lock_file`s on the stack used to be a bad idea, because
the temp- and lockfile-machinery would keep a pointer into the struct.
But after 076aa2cbd (tempfile: auto-allocate tempfiles on heap,
2017-09-05), we can safely have lockfiles on the stack. (This applies
even if a user returns early, leaving a locked lock behind.)

These `struct lock_file`s are local to their respective functions and we
can drop their staticness.

For good measure, I have inspected these sites and come to believe that
they always release the lock, with the possible exception of bailing out
using `die()` or `exit()` or by returning from a `cmd_foo()`.

As pointed out by Jeff King, it would be bad if someone held on to a
`struct lock_file *` for some reason. After some grepping, I agree with
his findings: no-one appears to be doing that.

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/object-store-replace'</title>
<updated>2018-05-08T06:59:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-08T06:59:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=174774cd519846616edc475fcbc98237409ffc21'/>
<id>urn:sha1:174774cd519846616edc475fcbc98237409ffc21</id>
<content type='text'>
The effort to pass the repository in-core structure throughout the
API continues.  This round deals with the code that implements the
refs/replace/ mechanism.

* sb/object-store-replace:
  replace-object: allow lookup_replace_object to handle arbitrary repositories
  replace-object: allow do_lookup_replace_object to handle arbitrary repositories
  replace-object: allow prepare_replace_object to handle arbitrary repositories
  refs: allow for_each_replace_ref to handle arbitrary repositories
  refs: store the main ref store inside the repository struct
  replace-object: add repository argument to lookup_replace_object
  replace-object: add repository argument to do_lookup_replace_object
  replace-object: add repository argument to prepare_replace_object
  refs: add repository argument to for_each_replace_ref
  refs: add repository argument to get_main_ref_store
  replace-object: check_replace_refs is safe in multi repo environment
  replace-object: eliminate replace objects prepared flag
  object-store: move lookup_replace_object to replace-object.h
  replace-object: move replace_map to object store
  replace_object: use oidmap
</content>
</entry>
<entry>
<title>Replace all die("BUG: ...") calls by BUG() ones</title>
<updated>2018-05-06T10:06:13Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2018-05-02T09:38:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=033abf97fcbc247eabf915780181d947cfb66205'/>
<id>urn:sha1:033abf97fcbc247eabf915780181d947cfb66205</id>
<content type='text'>
In d8193743e08 (usage.c: add BUG() function, 2017-05-12), a new macro
was introduced to use for reporting bugs instead of die(). It was then
subsequently used to convert one single caller in 588a538ae55
(setup_git_env: convert die("BUG") to BUG(), 2017-05-12).

The cover letter of the patch series containing this patch
(cf 20170513032414.mfrwabt4hovujde2@sigill.intra.peff.net) is not
terribly clear why only one call site was converted, or what the plan
is for other, similar calls to die() to report bugs.

Let's just convert all remaining ones in one fell swoop.

This trick was performed by this invocation:

	sed -i 's/die("BUG: /BUG("/g' $(git grep -l 'die("BUG' \*.c)

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: store the main ref store inside the repository struct</title>
<updated>2018-04-12T02:38:56Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-04-12T00:21:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64a741619d27ede27788d2d444257635f4af8ffd'/>
<id>urn:sha1:64a741619d27ede27788d2d444257635f4af8ffd</id>
<content type='text'>
This moves the 'main_ref_store', which was a global variable in refs.c
into the repository struct.

This patch does not deal with the parts in the refs subsystem which deal
with the submodules there. A later patch needs to get rid of the submodule
exposure in the refs API, such as 'get_submodule_ref_store(path)'.

Acked-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: use chdir_notify to update cached relative paths</title>
<updated>2018-03-30T19:50:03Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-03-30T18:35:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fb9c2d27039a23457cb9710d86e00c51dfb910dc'/>
<id>urn:sha1:fb9c2d27039a23457cb9710d86e00c51dfb910dc</id>
<content type='text'>
Commit f57f37e2e1 (files-backend: remove the use of
git_path(), 2017-03-26) introduced a regression when a
relative $GIT_DIR is used in a working tree:

  - when we initialize the ref backend, we make a copy of
    get_git_dir(), which may be relative

  - later, we may call setup_work_tree() and chdir to the
    root of the working tree

  - further calls to the ref code will use the stored git
    directory, but relative paths will now point to the
    wrong place

The new test in t1501 demonstrates one such instance (the
bug causes us to write the ref update to the nonsense
"relative/relative/.git").

Since setup_work_tree() now uses chdir_notify, we can just
ask it update our relative paths when necessary.

Reported-by: Rafael Ascensao &lt;rafa.almas@gmail.com&gt;
Helped-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.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>Merge branch 'kg/packed-ref-cache-fix'</title>
<updated>2018-02-15T22:55:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-15T22:55:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9db22910f74b64764d4fb4e17f8aef4eb5aa6af0'/>
<id>urn:sha1:9db22910f74b64764d4fb4e17f8aef4eb5aa6af0</id>
<content type='text'>
Avoid mmapping small files while using packed refs (especially ones
with zero size, which would cause later munmap() to fail).

* kg/packed-ref-cache-fix:
  packed_ref_cache: don't use mmap() for small files
  load_contents(): don't try to mmap an empty file
  packed_ref_iterator_begin(): make optimization more general
  find_reference_location(): make function safe for empty snapshots
  create_snapshot(): use `xmemdupz()` rather than a strbuf
  struct snapshot: store `start` rather than `header_len`
</content>
</entry>
<entry>
<title>Merge branch 'sg/cocci-move-array'</title>
<updated>2018-02-13T21:39:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-13T21:39:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cbf0240f82fc6b7072c7d18fa56caace4902a44b'/>
<id>urn:sha1:cbf0240f82fc6b7072c7d18fa56caace4902a44b</id>
<content type='text'>
Code clean-up.

* sg/cocci-move-array:
  Use MOVE_ARRAY
</content>
</entry>
<entry>
<title>Merge branch 'mr/packed-ref-store-fix'</title>
<updated>2018-02-13T21:39:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-13T21:39:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b72ea0a48e8e5711f9bba122cbaf2bbe10737bc'/>
<id>urn:sha1:2b72ea0a48e8e5711f9bba122cbaf2bbe10737bc</id>
<content type='text'>
Crash fix for a corner case where an error codepath tried to unlock
what it did not acquire lock on.

* mr/packed-ref-store-fix:
  files_initial_transaction_commit(): only unlock if locked
</content>
</entry>
</feed>
