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

Re: [PATCH] for-each-repo: do nothing on empty config

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jan 7, 2021, 04:29 UTC
Message-ID
<CAPig+cQ5_J4MU9CkG9kyjOTrYPFikkX4vG6AFQhczUT857H7pg@mail.gmail.com>
In-Reply-To
<xmqqturtrdre.fsf@gitster.c.googlers.com>
On Wed, Jan 6, 2021 at 3:50 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
> > Is the API of this command ideal? It feels odd to force the user to
> > specify required input via a command-line option rather than just as a
> > positional argument. In other words, since the config variable name is
> > mandatory, an alternative invocation format would be:
> >
> >     git for-each-repo <config-var> <cmd>
>
> Or not to use any configuration variable (or not to have the
> for-each-repo subcommand at all) and let the users write
> something along the lines of...
>
>         git config --get-all <config-var> |
>         while read repo
>         do
>                 ( cd "$repo" && <cmd> )
>         done
>
> which is not all that bad and much more flexible.

I had the same thought/question about why git-for-each-repo exists, though I didn't verbalize it since I assumed the reason was covered during the original discussion or patch submission, which I did not follow. I can see this command possibly being useful for Windows users who don't necessarily have a Unix-like shell or MS PowerShell with which to open-code the loop you illustrated. This may be especially important when this is used for some sort of scheduled maintenance on Windows, as a guess.

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 15 in “for-each-repo: do nothing on empty config”
  1. for-each-repo: do nothing on empty configDerrick Stolee via GitGitGadget, Jan 5, 2021
  2. Eric SunshineJan 5, 2021
  3. Derrick StoleeJan 6, 2021
  4. Eric SunshineJan 6, 2021
  5. Derrick StoleeJan 6, 2021
  6. Eric SunshineJan 6, 2021
  7. Junio C HamanoJan 6, 2021
  8. Eric SunshineJan 7, 2021
  9. Junio C HamanoJan 6, 2021
  10. Derrick StoleeJan 6, 2021
  11. Junio C HamanoJan 6, 2021
  12. Junio C HamanoJan 6, 2021
  13. Derrick StoleeJan 7, 2021
  14. for-each-repo: do nothing on empty configDerrick Stolee via GitGitGadget, Jan 6, 2021
  15. for-each-repo: do nothing on empty configDerrick Stolee via GitGitGadget, Jan 8, 2021

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.