git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ping Yin" <pkufranky@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH/RFC v2] git-submodule: multi-level module definition
Date: Wed, 05 Mar 2008 19:48:33 -0800	[thread overview]
Message-ID: <7vejaoldgu.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <46dff0320803051754o4b45222es524a62a7cac50b94@mail.gmail.com> (Ping Yin's message of "Thu, 6 Mar 2008 09:54:58 +0800")

"Ping Yin" <pkufranky@gmail.com> writes:

>>  I would agree that allowing the user to use a short-hand to name a group
>>  of modules the user is interested in would be a good idea, but I think
>>  .gitmodules is a wrong place to do so.  The grouping is a user preference,
>>  isn't it?
>>
>>  The place the owner of the repository (not the project) expresses which
>>  modules are of interest, what transports she wants to use to access it,
>>  etc. is $GIT_DIR/config, and .gitmodules is a vehicle to supply hints to
>>  be used when the user populates that information.
>>
> Not always the case. In my company environment, we have many
> submodules and have a unified hierachy of modules,...
> ..., it's better to put the
> common config in .gitmodules to pass to every one.

I think we are saying the same thing, and I do not understand why you
sound so upset about my comments.  I never said it is bad to copy the
"hints" supplied by .gitmodules verbatim to $GIT_DIR/config.

See how the current cmd_init() uses the information in .gitmodules.  It
could later become interactive to allow users to override what's in there,
but by default it simply uses the information from .gitmodules verbatim.

In the special case of everybody using exactly the same settings, you can
have "all" submodule group alias in .gitmodules, and the user can say "git
submodule init all", which would set up the set of the modules the user
would work with, using the "hints" in the .gitmodules distributed company
wide verbatim.

One of the goal of the overall design of submodules is _not forcing_ but
still allowing such uniformity, and I think using $GIT_DIR/config as
authoritative and treating in-tree .gitmodules as hint to prime
$GIT_DIR/config is quite fundamental to that design.  Let's make sure we
do not needlessly deviate from it.

Because names to name things are fundamental part of the communication, I
do not think we would want to allow users to call A what the project as a
whole calls B.  The use of .gitmodules by the current module_name() that
maps a specific name to a path is not just fine but is preferred for this
reason (i.e. if we copied them to $GIT_DIR/config it would only introduce
tower-of-babel confusion).

However, a short-hand to name groups of submodules is not just about
naming one thing with one name, but has user convenience aspect too.
There should be per-user customizability built into the design.  You could
probably fix this by making the code first consult $GIT_DIR/config and
then fall back on in-tree .gitmodules file.

By the way, in your patch, I notice that quoting of $name is often very
loosely done.  I do not think we have officially defined what the allowed
repertoire of module name characters are, but we probably should declare
the rules and make sure the code actively enforces it to prevent future
grief.  I'd say the same restriction as we have for refnames, except
that we do not allow slashes either, is good enough?

  parent reply	other threads:[~2008-03-06  3:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04 16:04 [PATCH/RFC v2] git-submodule: multi-level module definition Ping Yin
2008-03-04 16:12 ` Johannes Schindelin
2008-03-05  2:13   ` Ping Yin
     [not found] ` <7bfdc29a0803041917j16112e80uc0b21707bdfd3fe@mail.gmail.com>
     [not found]   ` <46dff0320803042315t2d89eb6fl325b4b2ef8ddbc44@mail.gmail.com>
2008-03-05  7:16     ` Ping Yin
2008-03-05  7:40       ` Imran M Yousuf
2008-03-05  7:53         ` Ping Yin
2008-03-05  8:03           ` Imran M Yousuf
2008-03-05 23:18 ` Junio C Hamano
2008-03-06  1:54   ` Ping Yin
2008-03-06  2:16     ` Imran M Yousuf
2008-03-06  2:32     ` Johannes Schindelin
2008-03-06  5:18       ` Ping Yin
2008-03-06  3:48     ` Junio C Hamano [this message]
2008-03-06  5:48       ` Ping Yin
2008-03-07  1:43         ` Ping Yin

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=7vejaoldgu.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pkufranky@gmail.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).