git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "martin f. krafft" <madduck@madduck.net>
Cc: git@vger.kernel.org, hjemli@gmail.com, skimo@liacs.nl
Subject: Re: [PATCH] Clarify role of init command in git-submodules documentation
Date: Mon, 20 Aug 2007 14:14:37 -0700	[thread overview]
Message-ID: <7vd4xhsybm.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <11875937841178-git-send-email-madduck@madduck.net> (martin f. krafft's message of "Mon, 20 Aug 2007 09:09:44 +0200")

"martin f. krafft" <madduck@madduck.net> writes:

> As per the discussion in this thread:
>
>   http://marc.info/?t=118721709500008&r=1&w=2

I'd rather see you summarize the conclusion of the thread here.
Having the URL as additional supporting reference is fine, but
when one reviews the "git log" output, one is not necessarily
online.

> this patch updates the git-submodules documentation to make the situation
> a bit clearer and documents the intended workflow.
>
> Signed-off-by: martin f. krafft <madduck@madduck.net>

Thanks.  Some comments.

> ---
> ...
>  init::
> -	Initialize the submodules, i.e. register in .git/config each submodule
> -	name and url found in .gitmodules. The key used in .git/config is
> -	`submodule.$name.url`. This command does not alter existing information
> -	in .git/config.
> +	Initialize the submodules, i.e. register in $GIT_DIR/config each
> +	submodule name and url found in .gitmodules. The key used in
> +	$GIT_DIR/config is `submodule.$name.url`. This command does not alter
> +	existing information in $GIT_DIR/config, it only serves to initialise
> +	the local configuration from the defaults in .gitmodules.

	s/initialise/initialize/;

>  FILES
>  -----
> -When initializing submodules, a .gitmodules file in the top-level directory
> -of the containing repository is used to find the url of each submodule.
> -This file should be formatted in the same way as $GIR_DIR/config. The key
> -to each submodule url is "submodule.$name.url".
> +To work with submodules, a user has to prepare a repository clone with the
> +command `git-submodule init`.

Is it "a user _has_ to"?  Or "a user can use 'git submodule
init' to prepare?"

Another thing that bothers me with this description is this.
Imagine you are a complete "git submodule" newbie (say, myself),
and want to try applying this facility to your own project (say,
git.git).  So I first remove git-gui from git.git repository and
then try to add git-gui.git from Shawn as a submodule.  Surely,
I am interested in the recipe "To work with submodules" at this
point, right?  Does that description apply to me?  Not really.

So this is not about "_has_ to" at all.  It is more like...

    You may want to work on a project you cloned from somebody
    else (we call that 'the superproject'), and find that the
    superproject has .gitmodules file at the top.  This file
    lists the subprojects that can be checked out in the
    superproject.  To make a checkout of the subprojects of the
    superproject you are interested in, you can use "git
    submodule init" to help you prime data about submodules in
    .git/config of the superproject.

> .... This command copies the url of each submodule
> +listed in the .gitmodules file in the top-level directory of the containing
> +repository to $GIT_DIR/config. The key to each submodule url is
> +"submodule.$name.url".

I think we've seen most of that description in the above 'init::'.

I've read Sven's description on two files.  My suspicion is that
instead of saying there are two files involved, it may be easier
to understand if we tell the story like this:

 - "git submodule" subcommands typically use data from the git
   configuration "submodule.$name.$key";

 - Definition of $name (e.g. it is just a logical token, not
   necessarily the directory name, i.e. moving a subproject to
   another directory does not have to change the $name).

 - Definition of possible $key (e.g. 'url'; others?)

 - After the initial clone of the superproject, you would not
   have any of the necessary configuration variables in _your_
   copy of the superproject.  There is a facility to help you
   prime that information.  The project gives you .gitmodules,
   and the tool gives you "git submodule init" to read from it.
   Here is what the subcommand does...

  parent reply	other threads:[~2007-08-20 21:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-15 16:20 git submodule init and redundant data in .gitmodules/.git/config martin f krafft
2007-08-15 16:38 ` Sven Verdoolaege
2007-08-15 22:29   ` using .gitmodule as default (was: git submodule init and redundant data in .gitmodules/.git/config) martin f krafft
2007-08-16 13:53     ` Josef Weidendorfer
2007-08-16 14:21       ` martin f krafft
2007-08-16 16:39         ` Josef Weidendorfer
2007-08-16 18:10       ` [PATCH] clarify need for init in git-submodules documentation martin f. krafft
2007-08-17  9:31         ` Sven Verdoolaege
2007-08-17 10:08           ` martin f krafft
2007-08-17 10:36             ` Sven Verdoolaege
2007-08-20  7:09               ` [PATCH] Clarify role of init command " martin f. krafft
2007-08-20  7:54                 ` Sven Verdoolaege
2007-08-21 18:02                   ` martin f krafft
2007-08-21 20:25                     ` Sven Verdoolaege
2007-08-21 21:03                       ` martin f krafft
2007-08-22  8:30                         ` Sven Verdoolaege
2007-08-22 13:48                           ` martin f krafft
2007-08-20 21:14                 ` Junio C Hamano [this message]
2007-08-20  9:29           ` Not setting M-F-T, keeping people on Cc (was: [PATCH] clarify need for init in git-submodules documentation) martin f krafft
2007-08-17  7:14     ` using .gitmodule as default (was: git submodule init and redundant data in .gitmodules/.git/config) Lars Hjemli

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

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

  git send-email \
    --in-reply-to=7vd4xhsybm.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=hjemli@gmail.com \
    --cc=madduck@madduck.net \
    --cc=skimo@liacs.nl \
    /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.
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 NNTP newsgroup(s).