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

Re: [PATCH v2] all: new command used for multi-repo operations

From
Jens Lehmann <jens.lehmann@web.de>
Date
Jan 23, 2013, 20:17 UTC
Message-ID
<51004542.8010708@web.de>
In-Reply-To
<CACsJy8DskoCi9Lg+HW0JeQBe4HX-bMXNHUgfrsg+DoqBN9-ntQ@mail.gmail.com>
Am 23.01.2013 09:55, schrieb Duy Nguyen:
Show 6 quoted lines
> On Wed, Jan 23, 2013 at 3:12 PM, Lars Hjemli <hjemli@gmail.com> wrote:
>> +NAME
>> +----
>> +git-all - Execute a git command in multiple repositories
> 
> I agree with Junio "git-all" is too generic.
+1
Show 14 quoted lines
>> +static int get_repo_state()
>> +{
>> +       const char *diffidx[] = {"diff", "--quiet", "--cached", NULL};
>> +       const char *diffwd[] = {"diff", "--quiet", NULL};
>> +
>> +       if (run_command_v_opt(diffidx, RUN_GIT_CMD) != 0)
>> +               return DIRTY;
>> +       if (run_command_v_opt(diffwd, RUN_GIT_CMD) != 0)
>> +               return DIRTY;
>> +       return CLEAN;
>> +}
> 
> Perhaps we could add the subrepo's object data to the in-memory object
> database of git-all, then do the diff without launching new commands?

You could do that for the "--cached" case, but not for the plain diff. But I think forking a "git status --porcelain -uno" and testing if it produced any output should do the trick with a single fork.

Previous: Duy NguyenNext: Junio C Hamano
Message 5 of 9 in “all: new command used for multi-repo operations”
  1. all: new command used for multi-repo operationsLars Hjemli, Jan 23, 2013
  2. Duy NguyenJan 23, 2013
  3. Lars HjemliJan 23, 2013
  4. Duy NguyenJan 23, 2013
  5. Jens LehmannJan 23, 2013
  6. Junio C HamanoJan 23, 2013
  7. Junio C HamanoJan 23, 2013
  8. Lars HjemliJan 23, 2013
  9. Lars HjemliJan 23, 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.