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

[PATCH 0/2] multi-pack-index: use real paths for --object-dir

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 21, 2022, 14:57 UTC
Message-ID
<pull.1221.git.1650553069.gitgitgadget@gmail.com>

A VFS for Git user reported [1] that the background maintenance did not seem to be doing anything. At least, the 'git multi-pack-index expire' and 'git multi-pack-index repack' steps did nothing. The 'write' subcommand worked to collect all pack-files into a single multi-pack-index file, but the packs were only growing in number instead of being maintained carefully.

[1] https://github.com/microsoft/git/issues/497

The root issue is about path comparisons between Windows and Unix path styles.

The fix is two-fold:
 * Patch 1 performs real-path normalization at a low-level where it is
   required.
 * Patch 2 performs real-path normalization at a high-level to be extra
   safe.

I'm not exactly sure how to test this properly in the Git codebase, but I'm looking to add some tests into VFS for Git to ensure this doesn't regress in the future.

Thanks, -Stolee
Derrick Stolee (2):
  midx: use real paths in lookup_multi_pack_index()
  multi-pack-index: use --object-dir real path
 builtin/multi-pack-index.c | 19 ++++++++++++++++---
 midx.c                     | 17 +++++++++++++----
 2 files changed, 29 insertions(+), 7 deletions(-)
base-commit: 6cd33dceed60949e2dbc32e3f0f5e67c4c882e1e
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1221%2Fderrickstolee%2Fmidx-normalize-object-dir-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1221/derrickstolee/midx-normalize-object-dir-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1221
-- 
gitgitgadget
Next: Derrick Stolee via GitGitGadget
Message 1 of 11 in “multi-pack-index: use real paths for --object-dir”
  1. 0/2 multi-pack-index: use real paths for --object-dirDerrick Stolee via GitGitGadget, Apr 21, 2022
  2. 1/2 midx: use real paths in lookup_multi_pack_index()Derrick Stolee via GitGitGadget, Apr 21, 2022
  3. 2/2 multi-pack-index: use --object-dir real pathDerrick Stolee via GitGitGadget, Apr 21, 2022
  4. Victoria DyeApr 21, 2022
  5. Derrick StoleeApr 21, 2022
  6. Junio C HamanoApr 21, 2022
  7. 0/3 multi-pack-index: use real paths for --object-dirDerrick Stolee via GitGitGadget, Apr 25, 2022
  8. 1/3 midx: use real paths in lookup_multi_pack_index()Derrick Stolee via GitGitGadget, Apr 25, 2022
  9. 2/3 multi-pack-index: use --object-dir real pathDerrick Stolee via GitGitGadget, Apr 25, 2022
  10. Junio C HamanoApr 25, 2022
  11. 3/3 cache: use const char * for get_object_directory()Derrick Stolee via GitGitGadget, Apr 25, 2022

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.