From: Brandon Williams <bmwill@google.com> To: Junio C Hamano <gitster@pobox.com> Cc: git@vger.kernel.org, Stefan Beller <sbeller@google.com> Subject: Re: [PATCH 1/2] submodule: create helper to build paths to submodule gitdirs Date: Fri, 10 Aug 2018 14:45:59 -0700 [thread overview] Message-ID: <20180810214559.GA211322@google.com> (raw) In-Reply-To: <xmqqpnyp7vzv.fsf@gitster-ct.c.googlers.com> On 08/10, Junio C Hamano wrote: > Brandon Williams <bmwill@google.com> writes: > > > Introduce a helper function "submodule_name_to_gitdir()" (and the > > submodule--helper subcommand "gitdir") which constructs a path to a > > submodule's gitdir, located in the provided repository's "modules" > > directory. > > > > This consolidates the logic needed to build up a path into a > > repository's "modules" directory, abstracting away the fact that > > submodule git directories are stored in a repository's common gitdir. > > This makes it easier to adjust how submodules gitdir are stored in the > > "modules" directory in a future patch. > > > > Signed-off-by: Brandon Williams <bmwill@google.com> > > --- > > ... > > @@ -2018,7 +2039,7 @@ static int connect_gitdir_workingtree(int argc, const char **argv, const char *p > > name = argv[1]; > > path = argv[2]; > > > > - strbuf_addf(&sb, "%s/modules/%s", get_git_dir(), name); > > + submodule_name_to_gitdir(&sb, the_repository, name); > > sm_gitdir = absolute_pathdup(sb.buf); > > > > connect_work_tree_and_git_dir(path, sm_gitdir, 0); > > This function goes away with 1c866b98 ("submodule--helper: replace > connect-gitdir-workingtree by ensure-core-worktree", 2018-08-03) in > sb/submodule-update-in-c topic. git-submodule.sh has simlar > conflicts. > > I guess its replacement function does not care as deeply as its > predecessor used to about where the submodule's $GIT_DIR is, so the > correct resolution may be just to ignore the change made to this > caller to the new name-to-gitdir function. Well that patch still cares about where the gitdir is except it initializes a "struct repository" for the submodule and then builds a path to the config using: cfg_file = xstrfmt("%s/config", subrepo.gitdir); hmm...I didn't get a chance to look at that series but that line looks wrong. It probably should be more like: cfg_file = repo_git_path(&subrepo, "config"); I'll go comment on that series. > > It would have been nicer to see a bit better inter-developer > coordination, especially between two who sit practically next to > each other ;-) > > Thanks. -- Brandon Williams
next prev parent reply other threads:[~2018-08-10 21:46 UTC|newest] Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-08-07 23:06 [RFC] submodule: munge paths to submodule git directories Brandon Williams 2018-08-07 23:25 ` Jonathan Nieder 2018-08-08 0:14 ` Junio C Hamano 2018-08-08 22:33 ` [PATCH 0/2] munge submodule names Brandon Williams 2018-08-08 22:33 ` [PATCH 1/2] submodule: create helper to build paths to submodule gitdirs Brandon Williams 2018-08-08 23:21 ` Stefan Beller 2018-08-09 0:45 ` Brandon Williams 2018-08-10 21:27 ` Junio C Hamano 2018-08-10 21:45 ` Brandon Williams [this message] 2018-08-08 22:33 ` [PATCH 2/2] submodule: munge paths to submodule git directories Brandon Williams 2018-08-09 21:26 ` Jeff King 2018-08-14 18:04 ` Brandon Williams 2018-08-14 18:57 ` Jonathan Nieder 2018-08-14 21:08 ` Stefan Beller 2018-08-14 21:12 ` Jonathan Nieder 2018-08-14 22:34 ` Stefan Beller 2018-08-16 2:34 ` Jonathan Nieder 2018-08-16 2:39 ` Stefan Beller 2018-08-16 2:47 ` Jonathan Nieder 2018-08-16 17:34 ` Brandon Williams 2018-08-16 18:19 ` [PATCH] submodule: add config for where gitdirs are located Brandon Williams 2018-08-20 22:03 ` Junio C Hamano 2018-08-16 15:07 ` [PATCH 2/2] submodule: munge paths to submodule git directories Junio C Hamano 2018-08-14 18:58 ` Jeff King 2018-08-28 21:35 ` Stefan Beller 2018-08-29 5:25 ` Jeff King 2018-08-29 18:10 ` Stefan Beller 2018-08-29 21:03 ` Jeff King 2018-08-29 21:10 ` Stefan Beller 2018-08-29 21:18 ` Jonathan Nieder 2018-08-29 21:27 ` Stefan Beller 2018-08-29 21:30 ` Jeff King 2018-08-29 21:09 ` Jonathan Nieder 2018-08-29 21:14 ` Stefan Beller 2018-08-29 21:25 ` Brandon Williams 2018-08-29 21:32 ` Jeff King 2018-08-16 0:19 ` Aaron Schrab 2019-01-15 1:25 ` [RFC] " Jonathan Nieder 2019-01-17 17:32 ` Jeff King 2019-01-17 17:57 ` Stefan Beller
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=20180810214559.GA211322@google.com \ --to=bmwill@google.com \ --cc=git@vger.kernel.org \ --cc=gitster@pobox.com \ --cc=sbeller@google.com \ --subject='Re: [PATCH 1/2] submodule: create helper to build paths to submodule gitdirs' \ /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
Code repositories for project(s) associated with this 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).