All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Voigt <hvoigt@hvoigt.net>
To: "W. Trevor King" <wking@tremily.us>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Jens Lehmann <jens.lehmann@web.de>,
	Jonathan Nieder <jrnieder@gmail.com>, Jeff King <peff@peff.net>
Subject: Re: Re: [PATCH 2/5] implement submodule config cache for lookup of submodule names
Date: Fri, 6 Jun 2014 07:20:40 +0200	[thread overview]
Message-ID: <20140606052040.GA77405@book.hvoigt.net> (raw)
In-Reply-To: <20140605174610.GS21803@odin.tremily.us>

On Thu, Jun 05, 2014 at 10:46:10AM -0700, W. Trevor King wrote:
> On Thu, Jun 05, 2014 at 08:07:50AM +0200, Heiko Voigt wrote:
> > +The caller can look up information about submodules by using the
> > +`submodule_from_path()` or `submodule_from_name()` functions.
> 
> That's for an already-known submodule.  Do we need a way to list
> submodules (e.g. for 'submodule foreach' style operations) or is the
> preferred way to do that just walking the tree looking for gitlinks?
> The cases where .gitmodules would lead you astray (e.g. via sloppy
> commits after removing a submodule) are:
> 
> * Listing a submodule that wasn't in the tree anymore.  Easy to check
>   for and ignore.
> 
> * Not listing a submodule that is in the tree.  You'd need to walk the
>   tree to check for this, but it's a pretty broken situation already,
>   so I'd be fine just ignoring the orphaned gitlink.

Currently there is no need to list the submodules in a .gitmodule file.
We currently always begin from the gitlink and try to do things. If we
have enough information thats fine we go ahead, if not we stop (or
skip?) the submodule. So for already initialized submodules it is even
ok to not have a .gitmodules entry at all and we can still go ahead with
most operations. Here we should not be too picky, I think.

The only use-case I can think of is for checking whether .gitmodules
contains any extra unneeded values. But on the other hand that is not
so easy. Since .gitmodules are just config files they can contain user
defined values. That is ok.

So in summary: Yes the preferred way to list submodules is via iterating
the gitlinks and I do not think we need a way to iterate through the
.gitmodules file (at least not for the use-cases we currently need this
for).

Cheers Heiko

  reply	other threads:[~2014-06-06  5:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  6:04 [PATCH 0/5] submodule config lookup API Heiko Voigt
2014-06-05  6:06 ` [PATCH 1/5] hashmap: add enum for hashmap free_entries option Heiko Voigt
2014-06-06 17:52   ` Karsten Blees
2014-06-10 10:17     ` Heiko Voigt
2014-06-11  9:12       ` Karsten Blees
2014-06-12 19:12         ` Junio C Hamano
2014-06-17  8:30           ` Karsten Blees
2014-06-17 19:04             ` Heiko Voigt
2014-06-17 22:19               ` Junio C Hamano
2014-06-05  6:07 ` [PATCH 2/5] implement submodule config cache for lookup of submodule names Heiko Voigt
2014-06-05 17:46   ` W. Trevor King
2014-06-06  5:20     ` Heiko Voigt [this message]
2014-06-08  9:04   ` Eric Sunshine
2014-06-10 10:19     ` Heiko Voigt
2014-06-12 21:58   ` Junio C Hamano
2014-06-13 22:37     ` Heiko Voigt
2014-06-05  6:08 ` [PATCH 3/5] extract functions for submodule config set and lookup Heiko Voigt
2014-06-05  6:09 ` [PATCH 4/5] use new config API for worktree configurations of submodules Heiko Voigt
2014-06-05  6:09 ` [PATCH 5/5] do not die on error of parsing fetchrecursesubmodules option Heiko Voigt
2014-06-12 21:59 ` [PATCH 0/5] submodule config lookup API Junio C Hamano
2014-06-13 22:41   ` Heiko Voigt
2014-06-16 17:58     ` Junio C Hamano
2014-06-17 19:00       ` Heiko Voigt
2014-06-12 22:04 ` Junio C Hamano
2014-06-13  7:13   ` Jens Lehmann
2014-06-13 17:50     ` Junio C Hamano

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=20140606052040.GA77405@book.hvoigt.net \
    --to=hvoigt@hvoigt.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jens.lehmann@web.de \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    --cc=wking@tremily.us \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.