git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: CAGZ79kZbc394rmxYDUxCbysKNbEQCB7aLJkf6MGcCeXKAxiKhA@mail.gmail.com
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Valery Tolstov <me@vtolstov.org>,
	sven@cs-ware.de
Subject: Re: git init --separate-git-dir does not update symbolic .git links for submodules
Date: Tue, 7 Mar 2017 12:11:26 -0800	[thread overview]
Message-ID: <CAGZ79kaFxN+0W8HDBB4Wnqy64UmdsRCCF2kZ852XsLNP=QNofA@mail.gmail.com> (raw)
In-Reply-To: <1488916365.8812.1@smtp.yandex.ru>

On Tue, Mar 7, 2017 at 11:52 AM, Valery Tolstov <me@vtolstov.org> wrote:
> Just noticed that there already is function that gives module list
> module_list_compute. But purpose of it's arguments is not quite clear
> for me at this moment.
>

static int module_list_compute(int argc, const char **argv,
                               const char *prefix,
                               struct pathspec *pathspec,
                               struct module_list *list)


argc, argv and prefix are just passed through from each caller
argc is the number of arguments on the command line,
argv is an array of said arguments on the command line,
prefix is the position inside the repository.

e.g. If in git.git in Documentation/, you run a git command
"git submodule--helper module_list *"
then first "git" and "submodule--helper" are removed,
and then cmd_submodule__helper is called (at the end of
the submodule helper, which then sees
    argc=2, argv=["module_list", "*"],
    prefix="Documentation/"
which then proceeds to into module_list().

That parses these arguments, but there is no
argument it knows about, so it does nothing.

Then it just passes these three (argc, argv, prefix)
to module_list_compute, which then makes up the list,
to be stored in the last parameter 'list'.

The 'pathspec' parameter seems weird.
Internally the arguments mentioned above are converted to a pathspec,
such that we can go through all files and call match_pathspec inside
of module_list_compute.

In all but one cases we do not care about the pathspec, but in one
case (in update_clone) we want to issue a warning if the pathspec
was empty (i.e. the user just said "git submodule--helper update_clone"
with no further path arguments)

  reply	other threads:[~2017-03-07 20:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 19:52 git init --separate-git-dir does not update symbolic .git links for submodules Valery Tolstov
2017-03-07 20:11 ` Stefan Beller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-03-07 18:59 Valery Tolstov
2017-03-07 19:59 ` Stefan Beller
2017-03-04 14:15 Valery Tolstov
2017-03-06 16:40 ` Stefan Beller
2017-03-04 12:15 Sven Strickroth

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='CAGZ79kaFxN+0W8HDBB4Wnqy64UmdsRCCF2kZ852XsLNP=QNofA@mail.gmail.com' \
    --to=sbeller@google.com \
    --cc=CAGZ79kZbc394rmxYDUxCbysKNbEQCB7aLJkf6MGcCeXKAxiKhA@mail.gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@vtolstov.org \
    --cc=sven@cs-ware.de \
    /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).