<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/split-index.c, 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-02T04:59:50Z</updated>
<entry>
<title>split-index: convert struct split_index to object_id</title>
<updated>2018-05-02T04:59:50Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-05-02T00:25:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2182abd94bf69a8daba18e71efae3e9f02a6c465'/>
<id>urn:sha1:2182abd94bf69a8daba18e71efae3e9f02a6c465</id>
<content type='text'>
Convert the base_sha1 member of struct split_index to use struct
object_id and rename it base_oid.  Include cache.h to make the structure
visible.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bw/c-plus-plus'</title>
<updated>2018-03-06T22:54:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-03-06T22:54:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=169c9c0169a00876f699678ac66ebe9563b0c29f'/>
<id>urn:sha1:169c9c0169a00876f699678ac66ebe9563b0c29f</id>
<content type='text'>
Avoid using identifiers that clash with C++ keywords.  Even though
it is not a goal to compile Git with C++ compilers, changes like
this help use of code analysis tools that targets C++ on our
codebase.

* bw/c-plus-plus: (37 commits)
  replace: rename 'new' variables
  trailer: rename 'template' variables
  tempfile: rename 'template' variables
  wrapper: rename 'template' variables
  environment: rename 'namespace' variables
  diff: rename 'template' variables
  environment: rename 'template' variables
  init-db: rename 'template' variables
  unpack-trees: rename 'new' variables
  trailer: rename 'new' variables
  submodule: rename 'new' variables
  split-index: rename 'new' variables
  remote: rename 'new' variables
  ref-filter: rename 'new' variables
  read-cache: rename 'new' variables
  line-log: rename 'new' variables
  imap-send: rename 'new' variables
  http: rename 'new' variables
  entry: rename 'new' variables
  diffcore-delta: rename 'new' variables
  ...
</content>
</entry>
<entry>
<title>split-index: rename 'new' variables</title>
<updated>2018-02-22T18:08:05Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2018-02-14T18:59:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=75b7b971ae07882c5ec6f76e21a0dbd76d70c187'/>
<id>urn:sha1:75b7b971ae07882c5ec6f76e21a0dbd76d70c187</id>
<content type='text'>
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>split-index: don't write cache tree with null oid entries</title>
<updated>2018-01-19T18:36:39Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2018-01-07T22:30:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4bddd98311f249e9ed8a9b6379c7a097201612d1'/>
<id>urn:sha1:4bddd98311f249e9ed8a9b6379c7a097201612d1</id>
<content type='text'>
In a96d3cc3f6 ("cache-tree: reject entries with null sha1", 2017-04-21)
we made sure that broken cache entries do not get propagated to new
trees.  Part of that was making sure not to re-use an existing cache
tree that includes a null oid.

It did so by dropping the cache tree in 'do_write_index()' if one of
the entries contains a null oid.  In split index mode however, there
are two invocations to 'do_write_index()', one for the shared index
and one for the split index.  The cache tree is only written once, to
the split index.

As we only loop through the elements that are effectively being
written by the current invocation, that may not include the entry with
a null oid in the split index (when it is already written to the
shared index), where we write the cache tree.  Therefore in split
index mode we may still end up writing the cache tree, even though
there is an entry with a null oid in the index.

Fix this by checking for null oids in prepare_to_write_split_index,
where we loop the entries of the shared index as well as the entries for
the split index.

This fixes t7009 with GIT_TEST_SPLIT_INDEX.  Also add a new test that's
more specifically showing the problem.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/free-and-null'</title>
<updated>2017-06-24T21:28:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-24T21:28:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50f03c6676ed5ea040dd53272882d3aac2ee1b48'/>
<id>urn:sha1:50f03c6676ed5ea040dd53272882d3aac2ee1b48</id>
<content type='text'>
A common pattern to free a piece of memory and assign NULL to the
pointer that used to point at it has been replaced with a new
FREE_AND_NULL() macro.

* ab/free-and-null:
  *.[ch] refactoring: make use of the FREE_AND_NULL() macro
  coccinelle: make use of the "expression" FREE_AND_NULL() rule
  coccinelle: add a rule to make "expression" code use FREE_AND_NULL()
  coccinelle: make use of the "type" FREE_AND_NULL() rule
  coccinelle: add a rule to make "type" code use FREE_AND_NULL()
  git-compat-util: add a FREE_AND_NULL() wrapper around free(ptr); ptr = NULL
</content>
</entry>
<entry>
<title>Revert "split-index: add and use unshare_split_index()"</title>
<updated>2017-06-24T19:02:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-24T19:02:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64719b115d61582fa501690ee6caff4c478b4b1a'/>
<id>urn:sha1:64719b115d61582fa501690ee6caff4c478b4b1a</id>
<content type='text'>
This reverts commit f9d7abec2ad2f9eb3d8873169cc28c34273df082;
see public-inbox.org/git/CAP8UFD0bOfzY-_hBDKddOcJdPUpP2KEVaX_SrCgvAMYAHtseiQ@mail.gmail.com
</content>
</entry>
<entry>
<title>*.[ch] refactoring: make use of the FREE_AND_NULL() macro</title>
<updated>2017-06-16T19:44:09Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2017-06-15T23:15:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=88ce3ef636b1385e861ec0e9e2155248b999b032'/>
<id>urn:sha1:88ce3ef636b1385e861ec0e9e2155248b999b032</id>
<content type='text'>
Replace occurrences of `free(ptr); ptr = NULL` which weren't caught by
the coccinelle rule. These fall into two categories:

 - free/NULL assignments one after the other which coccinelle all put
   on one line, which is functionally equivalent code, but very ugly.

 - manually spotted occurrences where the NULL assignment isn't right
   after the free() call.

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>split-index: add and use unshare_split_index()</title>
<updated>2017-05-08T01:50:20Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-05-05T14:57:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f9d7abec2ad2f9eb3d8873169cc28c34273df082'/>
<id>urn:sha1:f9d7abec2ad2f9eb3d8873169cc28c34273df082</id>
<content type='text'>
When split-index is being used, we have two cache_entry arrays in
index_state-&gt;cache[] and index_state-&gt;split_index-&gt;base-&gt;cache[].

index_state-&gt;cache[] may share the same entries with base-&gt;cache[] so
we can quickly determine what entries are shared. This makes memory
management tricky, we can't free base-&gt;cache[] until we know
index_state-&gt;cache[] does not point to any of those entries.

unshare_split_index() is added for this purpose, to find shared
entries and either duplicate them in index_state-&gt;cache[], or discard
them. Either way it should be safe to free base-&gt;cache[] after
unshare_split_index().

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>split-index: add {add,remove}_split_index() functions</title>
<updated>2017-03-01T21:24:21Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2017-02-27T18:00:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cef4fc7ebe869e910d0fd5643cd60328ed76356a'/>
<id>urn:sha1:cef4fc7ebe869e910d0fd5643cd60328ed76356a</id>
<content type='text'>
Also use the functions in cmd_update_index() in
builtin/update-index.c.

These functions will be used in a following commit to tweak
our use of the split-index feature depending on the setting
of a configuration variable.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>split-index: s/eith/with/ typo fix</title>
<updated>2016-11-01T18:48:02Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2016-10-23T09:26:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=753c4515016c762f2c23bf6243c77868631c8abe'/>
<id>urn:sha1:753c4515016c762f2c23bf6243c77868631c8abe</id>
<content type='text'>
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
