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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 27, 2013, 19:45 UTC
Message-ID
<7v4ni2wgto.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130127194223.GR7498@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
Show 20 quoted lines
> On Sun, Jan 27, 2013 at 11:04:08AM -0800, Junio C Hamano wrote:
>> One more thing that nobody brought up during the previous reviews is
>> if we want to support subset of repositories by allowing the
>> standard pathspec match mechanism.  For example,
>> 
>> 	git for-each-repo -d git diff --name-only -- foo/ bar/b\*z
>> 
>> might be a way to ask "please find repositories match the given
>> pathspecs (i.e. foo/ bar/b\*z) and run the command in the ones that
>> are dirty".  We would need to think about how to mark the end of the
>> command though---we could borrow \; from find(1), even though find
>> is not the best example of the UI design.  I.e.
>> 
>> 	git for-each-repo -d git diff --name-only \; [--] foo/ bar/b\*z
>> 
>> with or without "--".
>
> Would it be better to make this a (multi-valued) option?
>
>     git for-each-repo -d --filter=foo/ --filter=bar/b\*z git diff --name-only

The standard way to use filtering based on paths we have is to use the pathspec parameters at the end of the commmand line.

I see no reason for such an inconsistency with an option like --filter.
Show 14 quoted lines
>> Oh, that reminds me of another thing.  Perhaps we would want to
>> export the (relative) path to the found repository in some way to
>> allow the commands to do this kind of thing in the first place?
>> "submodule foreach" does this with $path, I think.
>
> I think $path is the only variable exported by "submodule foreach" which
> is applicable here, but it doesn't work on Windows, where environment
> variables are case-insensitive.
>
> Commit 64394e3 (git-submodule.sh: Don't use $path variable in
> eval_gettext string) changed "submodule foreach" to use $sm_path
> internally although I notice that the documentation still uses $path.
>
> Perhaps $repo_path in this case?

I do not care too deeply about the name, as long as the names used by both mechanisms are the same.

Previous: John KeepingNext: Lars Hjemli
Message 5 of 18 in “for-each-repo: new command for multi-repo operations”
  1. 0/2 for-each-repo: new command for multi-repo operationsLars Hjemli, Jan 27, 2013
  2. 1/2 for-each-repo: new command used for multi-repo operationsLars Hjemli, Jan 27, 2013
  3. Junio C HamanoJan 27, 2013
  4. John KeepingJan 27, 2013
  5. Junio C HamanoJan 27, 2013
  6. Lars HjemliJan 28, 2013
  7. Jonathan NiederJan 28, 2013
  8. Lars HjemliJan 28, 2013
  9. Junio C HamanoJan 28, 2013
  10. Junio C HamanoJan 28, 2013
  11. Lars HjemliJan 28, 2013
  12. Junio C HamanoJan 28, 2013
  13. Lars HjemliJan 28, 2013
  14. Jens LehmannJan 28, 2013
  15. Junio C HamanoJan 28, 2013
  16. Jens LehmannJan 28, 2013
  17. Junio C HamanoFeb 4, 2013
  18. 2/2 git: rewrite `git -a` to become a git-for-each-repo commandLars Hjemli, Jan 27, 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.