Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

Add support for batch operations #4

Open
phortx opened this issue Aug 10, 2015 · 0 comments
Open

Add support for batch operations #4

phortx opened this issue Aug 10, 2015 · 0 comments
Assignees

Comments

@phortx
Copy link

phortx commented Aug 10, 2015

Given the case you have an amount of quite similar projects (similar structure, same branching model, ...) and you want to do an git operation on each repository like switching the branch for example.

Currently you have two options: First one: cd in each repository, run git checkout nice-branch. That's ok if you have 2 repos, but then you won't use mgpm. If you use mgpm, you probably have about 40 repositories and then it won't make much fun doing it that way.

Second option is:

$ find . -maxdepth 1 -type d -not -path . -exec git --git-dir={}/.git --work-tree=$PWD/{} checkout nice-branch \;

which is hard to remember, much stuff to type, ugly and so on ...

Well, it would be really awesome if mgpm supports a batch mode, which allows the user to run git commands on each repository, which is managed by mgpm, just like the following example (-e is for execute):

$ mgpm -e 'checkout nice-branch'

This would enter each repository and run git checkout nice-branch in each of 'em.

Or maybe you want to do a simple commit on each repo after a small change and tag it, push it (pump it, rock it, groove it, move it ... :D). therefore chaining would be nice:

$ mgpm -e "commit -am 'Added /target to .gitignore'" -e "tag 2.5.19" -e 'push' -e 'push origin 2.5.19'

This would enter each repository and run each of the given git commands in the specified order.

What do you think?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants