From: Eric Sunshine Date: Thu, 07 Jan 2021 04:29:43 GMT Subject: Re: [PATCH] for-each-repo: do nothing on empty config Message-ID: In-Reply-To: On Wed, Jan 6, 2021 at 3:50 PM Junio C Hamano wrote: > Eric Sunshine 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 > > 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 | > while read repo > do > ( cd "$repo" && ) > 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.