Re: [PATCH v4 1/2] for-each-repo: new command used for multi-repo operations

2013-01-28 Thread Lars Hjemli
On Mon, Jan 28, 2013 at 7:51 PM, Junio C Hamano wrote: > Lars Hjemli writes: > >>> Come to think of it, is there a reason why "for-each-repo" should >>> not be an extention to "submodule foreach"? We can view this as >>> visiting repos

Re: [PATCH v4 1/2] for-each-repo: new command used for multi-repo operations

2013-01-28 Thread Lars Hjemli
On Mon, Jan 28, 2013 at 6:45 PM, Junio C Hamano wrote: > As to the pathspec limiting to affect the loop itself, not the > argument given to the command that is run, I don't think it is > absolutely needed; I am perfectly fine with declaring that > for-each-repo goes to repositories in all subdirec

Re: [PATCH v4 1/2] for-each-repo: new command used for multi-repo operations

2013-01-28 Thread Lars Hjemli
On Mon, Jan 28, 2013 at 9:10 AM, Jonathan Nieder wrote: > > Lars Hjemli wrote: > >> [1] The 'git -a' rewrite patch shows how I think about this command - >> it's just an option to the 'git' command, modifying the way any >> subcommand is i

Re: [PATCH v4 1/2] for-each-repo: new command used for multi-repo operations

2013-01-27 Thread Lars Hjemli
On Sun, Jan 27, 2013 at 8:04 PM, Junio C Hamano wrote: > Lars Hjemli writes: > >> The command also honours the option '--clean' which restricts the set of >> repos to those which '--dirty' would skip, and '-x' which is used to >> execute n

[PATCH v4 2/2] git: rewrite `git -a` to become a git-for-each-repo command

2013-01-27 Thread Lars Hjemli
With this rewriting, it is now possible to run e.g. `git -ad gui` to start up git-gui in each repo within the current directory which contains uncommited work. Signed-off-by: Lars Hjemli --- git.c| 36 +++ t/t6400-for-each-repo.sh | 63

[PATCH v4 1/2] for-each-repo: new command used for multi-repo operations

2013-01-27 Thread Lars Hjemli
d nongit commands, it must cd into the worktree of each repository before executing the command. It is then no need for the environment variables $GIT_WORK_TREE and $GIT_DIR to be specified, so git-for-each-repo will instead unset these variables to stop them from interfering with the executed

[PATCH v4 0/2] for-each-repo: new command for multi-repo operations

2013-01-27 Thread Lars Hjemli
problems from GIT_DIR/WORK_TREE * more tests Lars Hjemli (2): for-each-repo: new command used for multi-repo operations git: rewrite `git -a` to become a git-for-each-repo command .gitignore | 1 + Documentation/git-for-each-repo.txt | 71 Makefile

[PATCH v3 2/2] git: rewrite `git -a` to become a git-for-each-repo command

2013-01-23 Thread Lars Hjemli
With this rewriting, it is now possible to run e.g. `git -ad gui` to start up git-gui in each repo within the current directory which contains uncommited work. Signed-off-by: Lars Hjemli --- git.c| 36 t/t6400-for-each-repo.sh | 6

[PATCH v3 1/2] for-each-repo: new command used for multi-repo operations

2013-01-23 Thread Lars Hjemli
ional. If none is given, git-for-each-repo will just print the path to each repo found. Signed-off-by: Lars Hjemli --- .gitignore | 1 + Documentation/git-for-each-repo.txt | 62 +++ Makefile| 1 + builtin.h

[PATCH v3 0/2] Add git-for-each-repo

2013-01-23 Thread Lars Hjemli
Lars Hjemli (2): for-each-repo: new command used for multi-repo operations git: rewrite `git -a` to become a git-for-each-repo command .gitignore | 1 + Documentation/git-for-each-repo.txt | 62 +++ Makefile| 1

[PATCH] Ignore gitk-wish buildproduct

2013-01-23 Thread Lars Hjemli
After running `make` on latest master, gitk-git/gitk-wish shows up as untracked. This fixes it. Signed-off-by: Lars Hjemli --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index aa258a6..63d4904 100644 --- a/.gitignore +++ b/.gitignore @@ -171,6 +171,7

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

2013-01-23 Thread Lars Hjemli
On Wed, Jan 23, 2013 at 6:04 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >> But I still do not think this loop is correct. In a repository that >> has a working tree, you would learn that directory $D has $D/.git in >> it, feed $D to handle_repo(), and then descend into $D/.git/objects/

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

2013-01-23 Thread Lars Hjemli
On Wed, Jan 23, 2013 at 5:52 PM, Junio C Hamano wrote: > Lars Hjemli writes: > >> +static int walk(struct strbuf *path, int argc, const char **argv) >> +{ >> + DIR *dir; >> + struct dirent *ent; >> + struct stat st; >> + size_t

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

2013-01-23 Thread Lars Hjemli
On Wed, Jan 23, 2013 at 9:55 AM, Duy Nguyen wrote: > 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? The `git all` command is regularly invoked outside of git repos, so I'm not sure if this would work.

[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; >>

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

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

2013-01-23 Thread Lars Hjemli
none is given, git-all will just print the path to each repo found. Signed-off-by: Lars Hjemli --- Changes since v1: * uses setenv() instead of chdir(), which fixes .gitfile handling * uses DTYPE() and stat(), which fixes NO_D_TYPE_IN_DIRENT platforms * uses OPT_SET_INT() instead of OPT

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 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")), >>

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

2013-01-22 Thread Lars Hjemli
none is given, git-all will just print the path to each repo found. Signed-off-by: Lars Hjemli --- Documentation/git-all.txt | 37 Makefile | 1 + builtin.h | 1 + builtin/all.c | 105