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.