Re: [PATCH v4 4/4] submodule: record superproject gitdir during 'update'
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Oct 25, 2021, 16:17 UTC
- Message-ID
- <6ad1f4bc-25cc-8c0d-2bf2-900c94d717d9@gmail.com>
- In-Reply-To
- <20211014203416.2802639-5-emilyshaffer@google.com>
On 10/14/2021 4:34 PM, Emily Shaffer wrote:
Show 7 quoted lines
> + sm_gitdir="$(git -C "$sm_path" rev-parse --absolute-git-dir)"
> + relative_gitdir="$(git rev-parse --path-format=relative \
> + --prefix "${sm_gitdir}" \
> + --git-dir)"
> +
> + git -C "$sm_path" config --worktree \
> + submodule.superprojectgitdir "$relative_gitdir"This use of `--worktree` is good because it acts the same as `--local` if config.worktree doesn't exist. If we discover it is too challenging to find the correct config file in-core, then we could call this command as a subprocess in patch 3.
Thanks, -Stolee