All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.keller@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: Brandon Williams <bmwill@google.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH 3/2] ls-files: only recurse on active submodules
Date: Fri, 14 Apr 2017 09:33:01 -0700	[thread overview]
Message-ID: <CA+P7+xoY-FFXEkPgQBA4=Twq+G5YZrHkBqiO+sKHcGJe7xt7vw@mail.gmail.com> (raw)
In-Reply-To: <CAGZ79kaRTrgHMnP6mA3V2rDHzf8iOidqLTpp2aXmi6x+6YeZxw@mail.gmail.com>

On Thu, Apr 13, 2017 at 12:25 PM, Stefan Beller <sbeller@google.com> wrote:
> On Thu, Apr 13, 2017 at 12:12 PM, Jacob Keller <jacob.keller@gmail.com> wrote:
>> On Thu, Apr 13, 2017 at 12:05 PM, Stefan Beller <sbeller@google.com> wrote:
>>> On Thu, Apr 13, 2017 at 11:57 AM, Brandon Williams <bmwill@google.com> wrote:
>>>> Add in a check to see if a submodule is active before attempting to
>>>> recurse.  This prevents 'ls-files' from trying to operate on a submodule
>>>> which may not exist in the working directory.
>>>
>>> What would currently happen on recursing into non-active submodules?
>>> Can we have a test for this?
>>>
>>> Thanks,
>>> Stefan
>>
>> We should be able to test for this. Is it possible that we can recurse
>> into a submodule as long as we have the clone in .git/modules/<name>
>> even if we don't have it checked out currently?
>
> Conceptually that should be possible, e.g.
>
>     git ls-files --recurse-submodules <ancient ref>
>
> where the ancient ref contained submodules that are not present any more.
> In that case we would need to do
>
>     struct strbuf sb = STRBUF_INIT;
>     struct child_process = CHILD_PROCESS_INIT;
>     struct submodule *sub = submodule_from_path( \
>         <path as recorded in ancient tree>, <ancient ref>)
>     strbuf_git_path(&sb, "modules/%s", sub->name);
>
>     argv_array_pushl(&cp.args, "git", "ls-files", "--recurse", ...);
>     cp.dir = sb.buf;
>     run_command(&cp);
>
> Stefan

Never mind. git ls-files doesn't support showing files for a specific
ancient history. (I guess you'd use ls-tree for that?). I'm guessing
we want to run in the actual work-tree for ls-files here.

Does "is_submodule_initialized()" going to ensure that we only operate
on a submodule that's currently checked out?

Thanks,
Jake

  parent reply	other threads:[~2017-04-14 16:33 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12  0:39 [PATCH] ls-files: properly prepare submodule environment Jacob Keller
2017-04-12 16:58 ` Brandon Williams
2017-04-12 22:45   ` Jacob Keller
2017-04-13 17:12     ` [PATCH v2 1/2] ls-files: fix recurse-submodules with nested submodules Jacob Keller
2017-04-13 17:12       ` [PATCH v2 2/2] ls-files: fix path used when recursing into submodules Jacob Keller
2017-04-13 18:10         ` Brandon Williams
2017-04-13 18:15         ` Stefan Beller
2017-04-13 18:34           ` Jacob Keller
2017-04-18  2:03         ` Junio C Hamano
2017-04-18  7:42           ` Jacob Keller
2017-04-18 18:41           ` Stefan Beller
2017-04-13 18:03       ` [PATCH v2 1/2] ls-files: fix recurse-submodules with nested submodules Brandon Williams
2017-04-13 18:31         ` Jacob Keller
2017-04-13 18:35           ` Stefan Beller
2017-04-13 18:36             ` Brandon Williams
2017-04-13 18:57       ` [PATCH 3/2] ls-files: only recurse on active submodules Brandon Williams
2017-04-13 19:05         ` Stefan Beller
2017-04-13 19:12           ` Jacob Keller
2017-04-13 19:25             ` Stefan Beller
2017-04-13 19:30               ` Jacob Keller
2017-04-14 16:33               ` Jacob Keller [this message]
2017-04-14 17:02                 ` Stefan Beller
2017-04-14 23:49                   ` Jacob Keller
2017-04-19  1:03         ` Junio C Hamano
2017-05-12 16:21           ` paul
2017-05-12 17:26             ` Brandon Williams
2017-05-12 18:12               ` Paul Jolly
2017-05-12 18:19                 ` Brandon Williams
2017-08-01 18:16                   ` Paul Jolly
     [not found]                   ` <CACoUkn7i76dEsQa3eoN+7WR8QmsD1pWsRQ0dvhkxzFN0sxTmRQ@mail.gmail.com>
2017-08-01 18:18                     ` Brandon Williams
2017-08-01 18:19                       ` Paul Jolly
2017-08-01 18:20                         ` Brandon Williams
2017-08-01 18:41                           ` 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='CA+P7+xoY-FFXEkPgQBA4=Twq+G5YZrHkBqiO+sKHcGJe7xt7vw@mail.gmail.com' \
    --to=jacob.keller@gmail.com \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.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.
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.