git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/4] unpack-trees: take care to propagate the split-index flag

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Mar 23, 2023, 14:32 UTC
Message-ID
<5a6e83e6-c14b-f2bb-5ec1-669ee7d246c8@jeffhostetler.com>
In-Reply-To
<3963d3e542896b9cdf871dc7ea13330ddac87795.1679500859.git.gitgitgadget@gmail.com>
On 3/22/23 12:00 PM, Johannes Schindelin via GitGitGadget wrote:
Show 26 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> When copying the `split_index` structure from one index structure to
> another, we need to propagate the `SPLIT_INDEX_ORDERED` flag, too, if it
> is set, otherwise Git might forget to write the shared index when that
> is actually needed.
> 
> It just so _happens_ that in many instances when `unpack_trees()` is
> called, the result causes the shared index to be written anyway, but
> there are edge cases when that is not so.
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>   unpack-trees.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/unpack-trees.c b/unpack-trees.c
> index 90b92114be8..ca5e47c77c0 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -1916,6 +1916,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
>   		 * create a new one.
>   		 */
>   		o->result.split_index = o->src_index->split_index;
> +		if (o->src_index->cache_changed & SPLIT_INDEX_ORDERED)
> +			o->result.cache_changed |= SPLIT_INDEX_ORDERED;
Nice find!
>   		o->result.split_index->refcount++;
>   	} else {
>   		o->result.split_index = init_split_index(&o->result);
Previous: Johannes Schindelin via GitGitGadgetNext: Junio C Hamano
Message 11 of 19 in “Fix a few split-index bugs”
  1. 0/4 Fix a few split-index bugsJohannes Schindelin via GitGitGadget, Mar 22, 2023
  2. 1/4 split-index & fsmonitor: demonstrate a bugJohannes Schindelin via GitGitGadget, Mar 22, 2023
  3. Jeff HostetlerMar 23, 2023
  4. 2/4 split-index; stop abusing the `base_oid` to strip the "link" extensionJohannes Schindelin via GitGitGadget, Mar 22, 2023
  5. Junio C HamanoMar 22, 2023
  6. Jeff HostetlerMar 23, 2023
  7. Junio C HamanoMar 23, 2023
  8. Jeff HostetlerMar 23, 2023
  9. 3/4 fsmonitor: avoid overriding `cache_changed` bitsJohannes Schindelin via GitGitGadget, Mar 22, 2023
  10. 4/4 unpack-trees: take care to propagate the split-index flagJohannes Schindelin via GitGitGadget, Mar 22, 2023
  11. Jeff HostetlerMar 23, 2023
  12. Junio C HamanoMar 22, 2023
  13. 0/4 Fix a few split-index bugsJohannes Schindelin via GitGitGadget, Mar 26, 2023
  14. 3/4 fsmonitor: avoid overriding `cache_changed` bitsJohannes Schindelin via GitGitGadget, Mar 26, 2023
  15. 2/4 split-index; stop abusing the `base_oid` to strip the "link" extensionJohannes Schindelin via GitGitGadget, Mar 26, 2023
  16. 1/4 split-index & fsmonitor: demonstrate a bugJohannes Schindelin via GitGitGadget, Mar 26, 2023
  17. 4/4 unpack-trees: take care to propagate the split-index flagJohannes Schindelin via GitGitGadget, Mar 26, 2023
  18. Jeff HostetlerMar 27, 2023
  19. Junio C HamanoMar 27, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.