git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, vdye@github.com, me@ttaylorr.com,
	Derrick Stolee <derrickstolee@github.com>
Subject: Re: [PATCH v2 2/3] multi-pack-index: use --object-dir real path
Date: Mon, 25 Apr 2022 11:58:38 -0700	[thread overview]
Message-ID: <xmqqy1ztuh0h.fsf@gitster.g> (raw)
In-Reply-To: <fd580e7947743db545a839e81f027984e70b7717.1650911234.git.gitgitgadget@gmail.com> (Derrick Stolee via GitGitGadget's message of "Mon, 25 Apr 2022 18:27:13 +0000")

"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Derrick Stolee <derrickstolee@github.com>
>
> The --object-dir argument to 'git multi-pack-index' allows a user to
> specify an alternate to use instead of the local $GITDIR. This is used
> by third-party tools like VFS for Git to maintain the pack-files in a
> "shared object cache" used by multiple clones.
>
> On Windows, the user can specify a path using a Windows-style file path
> with backslashes such as "C:\Path\To\ObjectDir". This same path style is
> used in the .git/objects/info/alternates file, so it already matches the
> path of that alternate. However, find_odb() converts these paths to
> real-paths for the comparison, which use forward slashes. As of the
> previous change, lookup_multi_pack_index() uses real-paths, so it
> correctly finds the target multi-pack-index when given these paths.
>
> Some commands such as 'git multi-pack-index repack' call child processes
> using the object_dir value, so it can be helpful to convert the path to
> the real-path before sending it to those locations.
>
> Add a callback to convert the real path immediately upon parsing the
> argument. We need to be careful that we don't store the exact value out
> of get_object_directory() and free it, or we could corrupt a later use
> of the_repository->objects->odb->path.
>
> We don't use get_object_directory() for the initial instantiation in
> cmd_multi_pack_index() because we need 'git multi-pack-index -h' to work
> without a Git repository.
>
> Signed-off-by: Derrick Stolee <derrickstolee@github.com>
> ---
>  builtin/multi-pack-index.c | 45 ++++++++++++++++++++++++++++----------
>  1 file changed, 34 insertions(+), 11 deletions(-)

Much nicer compared to the previous round, by doing the
normalization early.

Will queue.  thanks.

  reply	other threads:[~2022-04-25 18:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 14:57 [PATCH 0/2] multi-pack-index: use real paths for --object-dir Derrick Stolee via GitGitGadget
2022-04-21 14:57 ` [PATCH 1/2] midx: use real paths in lookup_multi_pack_index() Derrick Stolee via GitGitGadget
2022-04-21 14:57 ` [PATCH 2/2] multi-pack-index: use --object-dir real path Derrick Stolee via GitGitGadget
2022-04-21 19:50   ` Victoria Dye
2022-04-21 19:55     ` Derrick Stolee
2022-04-21 20:28     ` Junio C Hamano
2022-04-25 18:27 ` [PATCH v2 0/3] multi-pack-index: use real paths for --object-dir Derrick Stolee via GitGitGadget
2022-04-25 18:27   ` [PATCH v2 1/3] midx: use real paths in lookup_multi_pack_index() Derrick Stolee via GitGitGadget
2022-04-25 18:27   ` [PATCH v2 2/3] multi-pack-index: use --object-dir real path Derrick Stolee via GitGitGadget
2022-04-25 18:58     ` Junio C Hamano [this message]
2022-04-25 18:27   ` [PATCH v2 3/3] cache: use const char * for get_object_directory() Derrick Stolee via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy1ztuh0h.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=me@ttaylorr.com \
    --cc=vdye@github.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).