git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Finding the repository

From
Phil Hord <phil.hord@gmail.com>
Date
Oct 25, 2013, 03:09 UTC
Message-ID
<CABURp0rFPYZEDC95+pL7bvnFuMpsiqp_YoQJ6f0DSFYWP=v4Gw@mail.gmail.com>
In-Reply-To
<CACsJy8AVdV8nPXFVdj37O1dgvcWh=tQ5C7iUE134Wk2yTD42Ug@mail.gmail.com>
On Thu, Oct 24, 2013 at 9:46 AM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 6 quoted lines
> On Thu, Oct 24, 2013 at 2:49 PM, Perry Hutchison <perryh@pluto.rain.com> wrote:
>> Duy Nguyen <pclouds@gmail.com> wrote:
>>
>>> ... it's not easy to determine ambiguity here, especially when the
>>> repo finding code does not know anything about "bar/barz.c" (is it
>>> a pathname or an argument to an option?).
...
Show 15 quoted lines
>>> There are more cases to consider, like what if you do
>>> "git rm bar/baz.c and rab/zab.c" where bar and rab are
>>> two different repositories..
>>
>> So we remove baz.c from bar and zab.c from rab.  It's not clear
>> to me that there's anything wrong with that -- it's exactly what
>> I would expect to have happen (and also what the hackish script
>> I posted will do).
>
> For "git rm", maybe. Many other commands need repo information and it
> would not make sense to have paths from two different repositories.
> For example, commit, rev-list or log. And it may break more things as
> most of current commands are designed to work on one repo from a to z.
> Some may support multi-repo operations if they're part of submodule
> support.

I've done some preliminary work on extending this sort of behavior to submodule commands. For example,

  git grep --recurse-submodules foo

which would look in the current project path and also any submodules encountered. This usage also begs for this extension:

  git grep --recurse-submodules foo path/to/sub/bar.c

Where 'path/to/sub' is a submodule, and therefore a foreign git repo to this one. Solving this is a little bit easier than your case because git is already running inside a repo. Extending the reach to submodules only requires more odb's than our first one to be considered. Along the way, I have considered your case, but I haven't focused on it. Lately I haven't had time to focus on my case either, though. :-\

Phil
Previous: Duy Nguyen
Message 5 of 5 in “Finding the repository”
  1. Perry HutchisonOct 23, 2013
  2. Duy NguyenOct 23, 2013
  3. Perry HutchisonOct 24, 2013
  4. Duy NguyenOct 24, 2013
  5. Phil HordOct 25, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.