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: Jacob Keller <jacob.e.keller@intel.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Stefan Beller <stefanbeller@gmail.com>, Jeff King <peff@peff.net>,
	Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH v7 5/7] submodule: correct output of submodule log format
Date: Thu, 18 Aug 2016 11:34:11 -0700	[thread overview]
Message-ID: <CA+P7+xoXANOOratwedB3RgJfJm5RLyw6Goa03z61sMZF8mooug@mail.gmail.com> (raw)
In-Reply-To: <CAGZ79kZdXXe7QwgtK8ZNHS+aKDx5vOc9rvETP9zo+ZCTCX10oQ@mail.gmail.com>

On Thu, Aug 18, 2016 at 11:25 AM, Stefan Beller <sbeller@google.com> wrote:
> On Wed, Aug 17, 2016 at 5:51 PM, Jacob Keller <jacob.e.keller@intel.com> wrote:
>> From: Jacob Keller <jacob.keller@gmail.com>
>>
>> The submodule log diff output incorrectly states that the submodule is
>> "not checked out" in cases where it wants to say the submodule is "not
>> initialized". Change the wording to reflect the actual check being
>> performed.
>>
>> Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
>> ---
>>  submodule.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/submodule.c b/submodule.c
>> index 1b5cdfb7e784..e1a51b7506ff 100644
>> --- a/submodule.c
>> +++ b/submodule.c
>> @@ -348,7 +348,7 @@ void show_submodule_summary(FILE *f, const char *path,
>>         if (is_null_sha1(two))
>>                 message = "(submodule deleted)";
>>         else if (add_submodule_odb(path))
>> -               message = "(not checked out)";
>> +               message = "(not initialized)";
>
> I think "not checked" out is actually correct here.
>

Hmmm.. It shouldn't say not checked out. I was running iinto problems
in some of my tests which indicated that the entire sub module didn't
exist. I think I had already assumed it wasn't failing when no
checkout. I think I have some fix for add_submodule_odb that can help
with this, making submodule dir behave correctly for this case.

I want add_submodule_odb to work in both of these cases:

a) we don't have a working checkout but we have the objects in the
usual location
b) we have a working directory with objects inside a .git folder but
it hasn't yet been moved into .git/modules/<>

I'll take a look and see what I can do.

>     $ git clone https://gerrit.googlesource.com/gerrit
>     $ cd gerrit
>     $ git submodule update --init
>       ...
>     $ git diff cc82b24..5222e66 plugins/
>     Submodule plugins/cookbook-plugin 2d40ee2..69b8f9f:
>      > Organize imports
>     $ rm -rf plugins/cookbook-plugin/
>     $ git diff cc82b24..5222e66 plugins/
>     Submodule plugins/cookbook-plugin 2d40ee2...69b8f9f (not checked out)
>     $
>
> Mind that by "rm -rf" of the working dir I create the "not checked out,
> but initialized state and even cloned state".
>
> So as a long term TODO:
>     I guess we could teach `add_submodule_odb` to operate
>     inside its git directory instead of its working directory, to have
>     it working whenever we have the object database (no matter if
>     checked out or not). Although this may collide with the plan of a
>     different refs backend? I dunno.
>
> add_submodule_odb is used in a variety of places:
>     show_submodule_header
>     submodule_needs_pushing
>     push_submodule
>     is_submodule_commit_present
>     merge_submodule
>
> And all of them seem to not require a checkout, but the presence of
> objects is fine.

Yea, they really only need objects, not the working tree.

Thanks,
Jake

  reply	other threads:[~2016-08-19  3:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18  0:51 [PATCH v7 0/7] implement inline submodule diff format Jacob Keller
2016-08-18  0:51 ` [PATCH v7 1/7] diff.c: remove output_prefix_length field Jacob Keller
2016-08-18  0:51 ` [PATCH v7 2/7] graph: add support for --line-prefix on all graph-aware output Jacob Keller
2016-08-18 17:56   ` Stefan Beller
2016-08-18 18:26     ` Jacob Keller
2016-08-18 18:29     ` Jacob Keller
2016-08-18  0:51 ` [PATCH v7 3/7] diff: prepare for additional submodule formats Jacob Keller
2016-08-18 18:03   ` Stefan Beller
2016-08-18  0:51 ` [PATCH v7 4/7] submodule: allow do_submodule_path to work if given gitdir directly Jacob Keller
2016-08-18 18:06   ` Stefan Beller
2016-08-18 18:46   ` Junio C Hamano
2016-08-18 18:50     ` Jacob Keller
2016-08-18  0:51 ` [PATCH v7 5/7] submodule: correct output of submodule log format Jacob Keller
2016-08-18 18:25   ` Stefan Beller
2016-08-18 18:34     ` Jacob Keller [this message]
2016-08-18  0:51 ` [PATCH v7 6/7] submodule: refactor show_submodule_summary with helper function Jacob Keller
2016-08-18  7:00   ` David Aguilar
2016-08-18  7:37     ` Jacob Keller
2016-08-18 19:04   ` Stefan Beller
2016-08-18 20:24     ` Jacob Keller
2016-08-18 20:39       ` Stefan Beller
2016-08-18 20:44         ` Jacob Keller
2016-08-18 20:49           ` Junio C Hamano
2016-08-18 21:08             ` Jacob Keller
2016-08-18  0:51 ` [PATCH v7 7/7] diff: teach diff to display submodule difference with an inline diff Jacob Keller
2016-08-18 19:47   ` Stefan Beller
2016-08-18 20:13     ` 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+xoXANOOratwedB3RgJfJm5RLyw6Goa03z61sMZF8mooug@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).