{"thread":{"id":"27172","subject":"RFC: Folder Git","startedAt":"2011-04-25T08:32:36Z","lastAt":"2011-04-26T07:03:44Z","messageCount":6,"participants":["Victor Engmark","Jon Seymour","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"166301","messageId":"BANLkTim=xKxN9JovToVuOg=SQ2Mba1LvxQ@mail.gmail.com","threadId":"27172","inReplyTo":null,"subject":"RFC: Folder Git","fromName":"Victor Engmark","fromEmail":"victor.engmark@gmail.com","sentAt":"2011-04-25T08:32:36Z","receivedAt":"2011-04-25T08:32:36Z","isPatch":false,"sender":{"key":"victor.engmark@gmail.com","avatar":"https://gravatar.com/avatar/5d7b4229a48f2ed011a265c19a1881c4ee58946449215db6627373a244c8aa4c?d=mp&s=160"},"body":"Most days I work on more than one repository, and on more than one\nmachine. I've never needed the \"--\" argument separator so far. This\ncombination makes it useful to have a way to run Git commands on\nseveral repositories at once. A one-time solution would of course be a\nfor-loop which checks for a .git directory before running the given\ncommand, but this operation ended up being frequent enough that I\nwrote a script for it: fgit\n<https://github.com/l0b0/fgit/blob/master/fgit.sh>. Features include:\n* Runs the Git command given in all specified directories which have a\n.git subdirectory, and warns about any that lack this directory.\n* Should work with any path, containing spaces, newlines or other\nexotic characters.\n* Should work with any Git command that doesn't require the \"--\"\nseparator between the options and arguments.\n* Prints the Git command before running it, for logging and repetition.\n* errexit and nounset are active for each line, with one exception:\nerrexit is disabled for the running of the command, to allow it to\ncontinue to other repositories.\n\nIssues:\n* Don't know if anyone else has used it. Probably not, so there's\nbound to be issues (especially since it's been changed quite a bit the\nlast couple days for this RFC).\n\nIs there a place for such a tool in Git porcelain or elsewhere in the\nGit project, or should it be kept completely separate?\n\n-- \nVictor Engmark\n"},{"id":"166303","messageId":"BANLkTimnyv_+NCc3yOSswJeqHo_zsGwCDA@mail.gmail.com","threadId":"27172","inReplyTo":"BANLkTim=xKxN9JovToVuOg=SQ2Mba1LvxQ@mail.gmail.com","subject":"Re: RFC: Folder Git","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-04-25T08:52:59Z","receivedAt":"2011-04-25T08:52:59Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Mon, Apr 25, 2011 at 6:32 PM, Victor Engmark\n<victor.engmark@gmail.com> wrote:\ncontinue to other repositories.\n>\n> Issues:\n> * Don't know if anyone else has used it. Probably not, so there's\n> bound to be issues (especially since it's been changed quite a bit the\n> last couple days for this RFC).\n>\n\nVictor,\n\nCertainly seems like a common need. I had a similar solution which I\nused for a while.\n\nIn the end, however, I found that creating a super-module in the top\ndirectory that contains\nthe other git directories as git submodules allowed me to use a\nstandard feature of git to achieve the same effect.\n\nSo:\n\n    git submodule foreach git gc --aggressive\n\nI know this won't suit every use case, but it does work in an\nenvironment where the set of repos you are operating on have a degree\nof coherence and it makes sense to set up a submodule for them.  In\nthis particular case this is the only reason why I use submodules - I\ndon't use them for configuration management, for example, simply as a\nhandy way to exploit git submodule foreach.\n\nHave you considered using git submodules in this way?\n\njon.\n"},{"id":"166308","messageId":"m3fwp6wr7h.fsf@localhost.localdomain","threadId":"27172","inReplyTo":"BANLkTim=xKxN9JovToVuOg=SQ2Mba1LvxQ@mail.gmail.com","subject":"Re: RFC: Folder Git","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-04-25T10:39:31Z","receivedAt":"2011-04-25T10:39:31Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Victor Engmark <victor.engmark@gmail.com> writes:\n\n[...]\n> I wrote a script for it: fgit\n> <https://github.com/l0b0/fgit/blob/master/fgit.sh>. Features include:\n> * Runs the Git command given in all specified directories which have a\n> .git subdirectory, and warns about any that lack this directory.\n> * Should work with any path, containing spaces, newlines or other\n> exotic characters.\n> * Should work with any Git command that doesn't require the \"--\"\n> separator between the options and arguments.\n> * Prints the Git command before running it, for logging and repetition.\n> * errexit and nounset are active for each line, with one exception:\n> errexit is disabled for the running of the command, to allow it to\n> continue to other repositories.\n\nDo you think this tool is mature and stable enough to add it to\n\n  https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools\n\npage on Git Wiki?\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"166353","messageId":"BANLkTikkFgCQP9DA5VwMCMzDCiTnEENvOg@mail.gmail.com","threadId":"27172","inReplyTo":"BANLkTimnyv_+NCc3yOSswJeqHo_zsGwCDA@mail.gmail.com","subject":"Re: RFC: Folder Git","fromName":"Victor Engmark","fromEmail":"victor.engmark@gmail.com","sentAt":"2011-04-26T06:47:46Z","receivedAt":"2011-04-26T06:47:46Z","isPatch":false,"sender":{"key":"victor.engmark@gmail.com","avatar":"https://gravatar.com/avatar/5d7b4229a48f2ed011a265c19a1881c4ee58946449215db6627373a244c8aa4c?d=mp&s=160"},"body":"On Mon, Apr 25, 2011 at 10:52 AM, Jon Seymour <jon.seymour@gmail.com> wrote:\n> On Mon, Apr 25, 2011 at 6:32 PM, Victor Engmark\n> <victor.engmark@gmail.com> wrote:\n> continue to other repositories.\n>>\n>> Issues:\n>> * Don't know if anyone else has used it. Probably not, so there's\n>> bound to be issues (especially since it's been changed quite a bit the\n>> last couple days for this RFC).\n>>\n>\n> Victor,\n>\n> Certainly seems like a common need. I had a similar solution which I\n> used for a while.\n>\n> In the end, however, I found that creating a super-module in the top\n> directory that contains\n> the other git directories as git submodules allowed me to use a\n> standard feature of git to achieve the same effect.\n>\n> So:\n>\n>    git submodule foreach git gc --aggressive\n>\n> I know this won't suit every use case, but it does work in an\n> environment where the set of repos you are operating on have a degree\n> of coherence and it makes sense to set up a submodule for them.  In\n> this particular case this is the only reason why I use submodules - I\n> don't use them for configuration management, for example, simply as a\n> handy way to exploit git submodule foreach.\n>\n> Have you considered using git submodules in this way?\n\nI didn't know you could use them this way, and it's a nicely \"Gitonic\"\nway of doing it. I don't think this would fit my case, since the repos\nare not much related and it's a more verbose solution which takes\nlonger to set up than copying a single script. A compromise could be\nto set up a Git alias `sgit=\"git submodule foreach git\"`, if that'll\nwork as expected.\n\n-- \nVictor Engmark\n"},{"id":"166355","messageId":"BANLkTinK40EQzog6WyZCyUGKN4DpYJ-YwA@mail.gmail.com","threadId":"27172","inReplyTo":"m3fwp6wr7h.fsf@localhost.localdomain","subject":"Re: RFC: Folder Git","fromName":"Victor Engmark","fromEmail":"victor.engmark@gmail.com","sentAt":"2011-04-26T06:59:31Z","receivedAt":"2011-04-26T06:59:31Z","isPatch":false,"sender":{"key":"victor.engmark@gmail.com","avatar":"https://gravatar.com/avatar/5d7b4229a48f2ed011a265c19a1881c4ee58946449215db6627373a244c8aa4c?d=mp&s=160"},"body":"On Mon, Apr 25, 2011 at 12:39 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> Victor Engmark <victor.engmark@gmail.com> writes:\n>\n> [...]\n>> I wrote a script for it: fgit\n>> <https://github.com/l0b0/fgit/blob/master/fgit.sh>. Features include:\n>> * Runs the Git command given in all specified directories which have a\n>> .git subdirectory, and warns about any that lack this directory.\n>> * Should work with any path, containing spaces, newlines or other\n>> exotic characters.\n>> * Should work with any Git command that doesn't require the \"--\"\n>> separator between the options and arguments.\n>> * Prints the Git command before running it, for logging and repetition.\n>> * errexit and nounset are active for each line, with one exception:\n>> errexit is disabled for the running of the command, to allow it to\n>> continue to other repositories.\n>\n> Do you think this tool is mature and stable enough to add it to\n>\n>  https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools\n>\n> page on Git Wiki?\n\nIt's already there, so I guess someone thought it was :) I'll try to\nfix the description as soon as the web page works with Firefox (I\ncould only load the contents with wget).\n\n-- \nVictor Engmark\n"},{"id":"166356","messageId":"BANLkTin5JV3WSMDvA3E-oJUMCxsy8uByhw@mail.gmail.com","threadId":"27172","inReplyTo":"BANLkTikkFgCQP9DA5VwMCMzDCiTnEENvOg@mail.gmail.com","subject":"Re: RFC: Folder Git","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2011-04-26T07:03:44Z","receivedAt":"2011-04-26T07:03:44Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"A concept I played with at one point was to have the idea of a working\nset, which is a list repos.\n\nYou could then apply to the whole working set any command after\nchanging to the root directory of each repo, much like git submodules\ndoes, but without any suggestion of any other relationship between the\nrepos.\n\nThe details working set were stored in the global git configuration.\n\nIn principle, you could have multiple working sets and switch which\none was active at a given time.\n\nSo, you'd do something like:\n\ngit working-set foreach {cmd} {args...}\ngit working-set activate working-set-name\ngit working-set add repo-url\ngit working-set remove repo-url\n\nand so on...\n\njon.\n\nOn Tue, Apr 26, 2011 at 4:47 PM, Victor Engmark\n<victor.engmark@gmail.com> wrote:\n> On Mon, Apr 25, 2011 at 10:52 AM, Jon Seymour <jon.seymour@gmail.com> wrote:\n>> On Mon, Apr 25, 2011 at 6:32 PM, Victor Engmark\n>> <victor.engmark@gmail.com> wrote:\n>> continue to other repositories.\n>>>\n>>> Issues:\n>>> * Don't know if anyone else has used it. Probably not, so there's\n>>> bound to be issues (especially since it's been changed quite a bit the\n>>> last couple days for this RFC).\n>>>\n>>\n>> Victor,\n>>\n>> Certainly seems like a common need. I had a similar solution which I\n>> used for a while.\n>>\n>> In the end, however, I found that creating a super-module in the top\n>> directory that contains\n>> the other git directories as git submodules allowed me to use a\n>> standard feature of git to achieve the same effect.\n>>\n>> So:\n>>\n>>    git submodule foreach git gc --aggressive\n>>\n>> I know this won't suit every use case, but it does work in an\n>> environment where the set of repos you are operating on have a degree\n>> of coherence and it makes sense to set up a submodule for them.  In\n>> this particular case this is the only reason why I use submodules - I\n>> don't use them for configuration management, for example, simply as a\n>> handy way to exploit git submodule foreach.\n>>\n>> Have you considered using git submodules in this way?\n>\n> I didn't know you could use them this way, and it's a nicely \"Gitonic\"\n> way of doing it. I don't think this would fit my case, since the repos\n> are not much related and it's a more verbose solution which takes\n> longer to set up than copying a single script. A compromise could be\n> to set up a Git alias `sgit=\"git submodule foreach git\"`, if that'll\n> work as expected.\n>\n> --\n> Victor Engmark\n>\n"}]}