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

2013-01-23 Thread Lars Hjemli
[*git@vger.kernel.org accidentally dropped from cc *] On Wed, Jan 23, 2013 at 7:52 AM, Junio C Hamano wrote: > Lars Hjemli writes: > >> +static int walk(struct strbuf *path, int argc, const char **argv) >> +{ >> + DIR *dir; >> + struct dirent *ent; >> + size_t len; >> + >> + dir

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

2013-01-23 Thread Lars Hjemli
On Wed, Jan 23, 2013 at 9:39 AM, Duy Nguyen wrote: > On Wed, Jan 23, 2013 at 4:10 AM, Lars Hjemli wrote: >> When working with multiple, unrelated (or loosly related) git repos, >> there is often a need to locate all repos with uncommitted work and >> perform some action on them (say, commit and p

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

2013-01-23 Thread Duy Nguyen
On Wed, Jan 23, 2013 at 4:10 AM, Lars Hjemli wrote: > When working with multiple, unrelated (or loosly related) git repos, > there is often a need to locate all repos with uncommitted work and > perform some action on them (say, commit and push). Before this patch, > such tasks would require manua

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

2013-01-22 Thread Lars Hjemli
On Wed, Jan 23, 2013 at 7:44 AM, Junio C Hamano wrote: > But I do not think the loop structure of this function is right. If > $D has ".git" in it, should it even try to feed other subdirectories > of $D (say "$D/a") to itself in recursion to see if $D/a/.git exists? Yes, this is needed to meet

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

2013-01-22 Thread Junio C Hamano
Lars Hjemli writes: > +static struct option builtin_all_options[] = { > + OPT_BOOLEAN('c', "clean", &only_clean, N_("only show clean > repositories")), > + OPT_BOOLEAN('d', "dirty", &only_dirty, N_("only show dirty > repositories")), > + OPT_END(), > +}; If you were to go in the OP

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

2013-01-22 Thread Junio C Hamano
David Aguilar writes: >> +static int walk(struct strbuf *path, int argc, const char **argv) >> +{ >> + DIR *dir; >> + struct dirent *ent; >> + size_t len; >> + >> + dir = opendir(path->buf); >> + if (!dir) >> + return errno; >> + strbuf_addstr(pat

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

2013-01-22 Thread David Aguilar
On Tue, Jan 22, 2013 at 1:10 PM, Lars Hjemli wrote: > When working with multiple, unrelated (or loosly related) git repos, > there is often a need to locate all repos with uncommitted work and > perform some action on them (say, commit and push). Before this patch, > such tasks would require manua

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

2013-01-22 Thread Junio C Hamano
Lars Hjemli writes: > In principle I agree with your reasoning on this, but in practice I > fail to see what other kind of things `git all` could naturally refer > to. For example, the designers of 'for-each-ref' could have called it "git all", as it is to iterate over all refs. -- To unsubscrib

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

2013-01-22 Thread Lars Hjemli
On Tue, Jan 22, 2013 at 11:01 PM, Junio C Hamano wrote: > Lars Hjemli writes: > >> +static struct option builtin_all_options[] = { >> + OPT_BOOLEAN('c', "clean", &only_clean, N_("only show clean >> repositories")), >> + OPT_BOOLEAN('d', "dirty", &only_dirty, N_("only show dirty >> repos

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

2013-01-22 Thread Junio C Hamano
Lars Hjemli writes: > diff --git a/builtin/all.c b/builtin/all.c > new file mode 100644 > index 000..ee9270d > --- /dev/null > +++ b/builtin/all.c > @@ -0,0 +1,105 @@ > +/* > + * "git all" builtin command. > + * > + * Copyright (c) 2013 Lars Hjemli > + */ > +#include "cache.h" > +#include "c

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

2013-01-22 Thread Lars Hjemli
When working with multiple, unrelated (or loosly related) git repos, there is often a need to locate all repos with uncommitted work and perform some action on them (say, commit and push). Before this patch, such tasks would require manually visiting all repositories, running `git status` within ea