git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jacob Keller <jacob.keller@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	Stefan Beller <stefanbeller@gmail.com>, Jeff King <peff@peff.net>,
	Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH v10 0/9] submodule inline diff format
Date: Thu, 25 Aug 2016 13:39:18 -0700	[thread overview]
Message-ID: <CA+P7+xrQy33gt8bnsagLVPAHhZPZx-3s0E_Aj7tOwXnHjOoCBg@mail.gmail.com> (raw)
In-Reply-To: <CAGZ79kbsq52Qh0Jtn5hpPPfHu_9r2CUHvAHOTh6Cgz8ODkzreg@mail.gmail.com>

On Tue, Aug 23, 2016 at 10:47 AM, Stefan Beller <sbeller@google.com> wrote:
> On Tue, Aug 23, 2016 at 10:25 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> I am not so sure about that.  If there is an existing place that is
>> buggy, shouldn't we fix that, instead of spreading the same bug
>> (assuming that it is a bug in the first place, which I do not have a
>> strong opinion on, at least not yet)?
>>
>> Can there be .git/modules/<foo>/ repository that is pointed at an
>> in-tree .git file when there is no "name" defined?
>
> If you're holding it wrong we can come into that state.
> * Checkout the submodule,
> * then remove .gitmodules as well as relevant config in .git/config.
> Result: Then we have a only a gitlink recorded as well as connected
> working tree to a gitdir inside a superprojects .git/modules/.
>

Yea, but I think you're right that we shouldn't support that state.
What I'm worried about is the case where we can get this state doing
something sane/acceptable but I don't think we can.

So we should support the gitlink to a repository stored at <path>
without stuff inside the .git/modules, and we should support submodule
gitlinks with a proper .gitmodules setup. I don't think we should
die() but we should error properly so I will introduce a _gently()
variant of these functions, and die properly in the regular flow.

>> I thought we
>> errored out in module_name helper function in git-submodule.sh when
>> we need a name and only have path (I just checked in the maint-2.6
>> track); did we break it recently? submodule--helper.c::module_name()
>> seems to error out when submodule_from_path() fails to find one and
>> will segfault if it does not have name, so it is not likely.
>
> The name is literally the only thing that is not optional in a struct submodule
> (see submodule-config.c:182 In lookup_or_create_by_name, these structs are
> added to the internal cache.
>
> Stepping back a bit, I think we'd want to document this expectation more
> in the man pages
>     The name unlike the path of a submodule must not be changed (as the
>     name is used internally to point at the submodules git dir)

Agreed, this should be documented. Do you mind doing the documentation
patch for this?

Thanks,
Jake

  reply	other threads:[~2016-08-25 20:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-22 23:43 [PATCH v10 0/9] submodule inline diff format Jacob Keller
2016-08-22 23:43 ` [PATCH v10 1/9] Git 2.10-rc1 Jacob Keller
2016-08-23  0:28   ` Stefan Beller
2016-08-23  6:21     ` Jacob Keller
2016-08-22 23:43 ` [PATCH v10 2/9] cache: add empty_tree_oid object and helper function Jacob Keller
2016-08-22 23:43 ` [PATCH v10 3/9] diff.c: remove output_prefix_length field Jacob Keller
2016-08-22 23:43 ` [PATCH v10 4/9] graph: add support for --line-prefix on all graph-aware output Jacob Keller
2016-08-22 23:43 ` [PATCH v10 5/9] diff: prepare for additional submodule formats Jacob Keller
2016-08-22 23:43 ` [PATCH v10 6/9] allow do_submodule_path to work even if submodule isn't checked out Jacob Keller
2016-08-22 23:43 ` [PATCH v10 7/9] submodule: convert show_submodule_summary to use struct object_id * Jacob Keller
2016-08-22 23:43 ` [PATCH v10 8/9] submodule: refactor show_submodule_summary with helper function Jacob Keller
2016-08-23 23:07   ` Junio C Hamano
2016-08-24  6:28     ` Jacob Keller
2016-08-22 23:43 ` [PATCH v10 9/9] diff: teach diff to display submodule difference with an inline diff Jacob Keller
2016-08-23  1:00 ` [PATCH v10 0/9] submodule inline diff format Stefan Beller
2016-08-23  7:23   ` Jacob Keller
2016-08-23 17:25   ` Junio C Hamano
2016-08-23 17:47     ` Stefan Beller
2016-08-25 20:39       ` Jacob Keller [this message]
2016-08-25 20:46         ` Stefan Beller
2016-08-25 22:16           ` Jacob Keller
2016-08-25 22:38         ` Junio C Hamano
2016-08-25 22:46           ` Jacob Keller
2016-08-26 17:35             ` Stefan Beller
2016-08-26 18:26               ` Keller, Jacob E
2016-08-25 20:35     ` Jacob Keller

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=CA+P7+xrQy33gt8bnsagLVPAHhZPZx-3s0E_Aj7tOwXnHjOoCBg@mail.gmail.com \
    --to=jacob.keller@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=jacob.e.keller@intel.com \
    --cc=peff@peff.net \
    --cc=sbeller@google.com \
    --cc=stefanbeller@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).