RFC: Folder Git
- From
Victor Engmark <victor.engmark@gmail.com>
- Date
- Apr 25, 2011, 08:32 UTC
- Message-ID
- <BANLkTim=xKxN9JovToVuOg=SQ2Mba1LvxQ@mail.gmail.com>
Most days I work on more than one repository, and on more than one machine. I've never needed the "--" argument separator so far. This combination makes it useful to have a way to run Git commands on several repositories at once. A one-time solution would of course be a for-loop which checks for a .git directory before running the given command, but this operation ended up being frequent enough that I wrote a script for it: fgit <https://github.com/l0b0/fgit/blob/master/fgit.sh>. Features include: * Runs the Git command given in all specified directories which have a .git subdirectory, and warns about any that lack this directory. * Should work with any path, containing spaces, newlines or other exotic characters. * Should work with any Git command that doesn't require the "--" separator between the options and arguments. * Prints the Git command before running it, for logging and repetition. * errexit and nounset are active for each line, with one exception: errexit is disabled for the running of the command, to allow it to continue to other repositories.
Issues: * Don't know if anyone else has used it. Probably not, so there's bound to be issues (especially since it's been changed quite a bit the last couple days for this RFC).
Is there a place for such a tool in Git porcelain or elsewhere in the Git project, or should it be kept completely separate?
-- Victor Engmark