-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redesign the set of mgit commands #73
Comments
From the above I'd like to see (as I'm missing those tasks):
The other are either meh (for me) or I have similar functionality in the IDE - like |
Would it commit in all packages or just the ones which are different than |
All of those sounds very reasonable for me, I think that it's a good approach to think about this tool as multi git rather than lerna tool. It can be used with lerna easily but it can be transparent about it. Currently I'm using mgit just for bootstrap command, I will be pleased when I see commands like, commit, push, checkout and even stash. ==== To automate the workflow even more I would like see that my hashes in mgit.json are updated automatically when I execute |
Interesting idea. Mgit could automatically update hashes if it had hashes stored in The tricky thing is – can it know when to do that and when not? I'm often jumping between repos and branches in these repos and I don't want mgit to constantly change my |
All changes that you've done. A shorthand for Which reminded me about |
Maybe we can provide some flag to explicitly save branches, hashes or don't commit changes in the main repo at all? |
Would it work like a watcher? Or would it change some property in
|
Don't forget about
This is where the "watch mode" comes into action and convenient saving state will help. Generally speaking - if developer is going to do some "illegal" action like you mentioned above:
I would warn user with message like: "Hey men! You are trying to checkout|commit|rebase directly into 'ckeditor5-engine' repository. Do you want to save your changes first?" ====
@jodator How do you commit to multiple repositories? Do you use some plugin? <probably-offtopic> By the way also I found it annoying when I checkout hashes, so I lost track of branch to which I want to commit to. Not sure, how your workflow looks like, but did you had similar issues? There might be possibility to keep track of both - branches and hashes in mgit.json. As far as I remember current syntax is: { "repo-name": "user/repo-name#d4da809"} it might be resolved by storing both:
It might be helpful when you want to commit changes. </probably-offtopic> |
But how? You would need a githook inside that package. While this is certainly possible, that's quite a lot of work.
If you check out to hashes, then I don't think it's not common to try to do a commit in that state. It's like If mgit would save hash+branch, then when checking out to that sate it would actually have to do this:
Which would allow committing, but not pushing these changes (if you were behind the origin). So I think that the only reasonable solution is to save only branches in |
@adelura: If you open CKEditor repository with all sub-repos in ps.: It's built in functionality (I'm on 2018.1.1 now, but it works at least in 2017.x versions). But I can see the blog post from 2012 mentioning this also. |
Guys, take into consideration that mgit cannot have interactive commands because it's running in parallel threads. |
We should manually go through all repos and add files to commit manually. Then use |
Not if you'll do |
Mhm. Ok. Let's summary the whole talk about new commands:
Could it just pull the changes? We could have In the future
Everything sounds good except that parameters for the command must be separated by mgit co -- -b <branch> It must be done this way because we can specify the scope for mgit, e.g.: mgit co --scope=*build* -- -b t/some-ticket-id
I would like to remove cloning repos and introduce
👍
mgit commit -- [params] The git commit --all [params] Is it good?
Could it be:
👍
We could introduce the |
Just a reminder - that it would be helpful to create branches only on modified repos. As for checkout - should it only checkout existing? (no create) |
We could introduce an option for the whole mgit: It should execute given command only for repos that contain some changes. But we should define what it does mean? Is it branch other than specified in |
The |
Probably command specific. As one example I wonder if |
I'm wondering what I can say about the whole topic as a summary and I don't really know. I have a feeling that the whole topic is about adding new commands or changing the name of existing ones. The final proposition about the set of mgit commands:
checkoutBy default it will checkout the project to the state saved in But it also can be used to create a new branch or checkout to existing branch:
The syncThe goal is to have a command which updated the whole projects. We could use In the details, Let me know guys WDYT because would be good to start implementing these commands. |
I'm unsure about this. Can it be just
Doing Please also do remember that all commands which may lead to losing some uncommitted changes should abort if the repo isn't clean. As for the rest, all sounds fine to me. |
It does not make sense to do But what I prefer to do for sync is |
👍 from me. |
One more thing – it'd be great if doing this:
Executed actually this:
So, I think that we can safely assume for now that |
IMO it's confusing that some |
How would you see them work then, if the most important requirement is that mgit should speed up our daily activities? What about creating new branches only in repos with changes? Or making |
Also, |
To be precise |
I think it depends on this (which I think all of us should have in our
This option should be on by default. I don't like the fact that git merge's things when you pull changes. This makes the history more complicated than it needs to be. |
You can also use |
Maybe we can allow making aliases in E.g |
The problem is that a command like Besides, DRY. If all of us will have to create aliases, then something's wrong. |
Or, maybe I mostly use my aliases, some of them are pretty complex, use |
IMO, you're overengineering this. Suddenly, we're going to parse existing aliases and force all of us to setup them just to avoid.. doing what? Preconfiguring git commands? I don't like the fact that we'll use the same names as git, but to do slightly more specific way (please note – we're not doing something different; we'll just preconfigure them!). But that's not a reason to introduce all these complications. Besides, currently |
I also think that command which does not do exactly the same should be called differently. For instance, I would expect that |
Sounds good to me. I'm only unsure about mgit close because closing PRs does not mean merging them. Can we find some other name? If not, then I'd keep mgit merge. --no-ff is not an uncommon addition anyway. |
Feature: Introduced a set of new commands which should help developers in daily tasks. Closes #73. * New commands: * `commit` - allows committing all changes files that are tracked by Git (a shorthand for `mgit exec 'git commit -a'`) * `fetch` - allows fetching changes in all cloned repositories (a shorthand for `mgit exec 'git fetch'`) * `pull` - allows pulling changes in all cloned repositories and cloning missing ones (it does not check out to specified branch in `mgit.json` file) * `push` - allows pushing changes in all cloned repositories (a shorthand for `mgit exec 'git push'`) * `close` - allows mering specified branch into current one and removes the merged branch from the local and remote * The `update` command was renamed to `sync`. * The `save-hashes` command was renamed to `save`. It accepts two options: `--branch` or `--hash` (which is default one). If specified `--branch`, name of current branches will be saved in `mgit.json`. * Removed command `bootstrap`. Use the `sync` command instead. Sync command will scan the package directories and compare results with packages saved in configuration file. If there is something that is not defined in `mgit.json`, it will be printed out. * `checkout` command now allows checking out the project to specified branch: `mgit checkout stable` will check out all repositories to `#stable` branch. It can also create a new branch for repositories that contains changes in files tracked by git. Calling `mgit checkout -- --branch develop` will create the `#develop` branch in these repositories. * Improved the help screen of mgit and introduced a help screen for specified command, e.g.: `mgit sync --help`. BREAKING CHANGE: Removed the `bootstrap` command. The `sync` command should be used instead for initializing the repositories. BREAKING CHANGE: Renamed `update` command to `sync`. BREAKING CHANGE: Renamed `save-hashes` command to `save`. It supports two parameters: `--branch` and `--hash` which the second one is set as default. NOTE: `mgit checkout branch` will check out the repository on `#branch`. `[branch]` argument is optional. If it isn't specified, branch name will be taken from `mgit.json`.
Right now we have a pretty messy situation where we have
mgit bootstrap
,mgit update
,mgit co
. The first two are quite similar, but none actually followsgit pull
andgit fetch
.The initial idea was to follow Lerna's naming. But after a time we see that
mgit
should followgit
's naming. Ideally, pretty much 1:1.So, it could look like:
mgit pull
– does whatgit pull
does + clones missing reposmgit co
– checks out to branches listed inmgit.json
mgit co <branch>
– checks out all repos to the given branchmgit co -b <branch>
– creates new branches (in all repos in which you have changes?)mgit fetch
– does whatgit fetch
dies (+ clones missing repos?)mgit push
– does whatgit push
doesmgit commit <params...>
– does whatgit commit
doesmgit save --branches
– saves current configuration of branches tomgit.json
mgit save --hashes
– saves hashes tomgit.json
mgit st
– like todaymgit diff
– like todaymgit exec
– like todaymgit merge
– to simplify closing multi-repo PRsHowever, what we need to understand is whether these commands do match our workflow. I mean here the old
mgit update
which was actually a sum of the newmgit co && mgit pull
. Are we ok with the fact that now you'll have to think more about what branches you're on and thatmgit pull
is not all if you were on some completely different setup previously?The text was updated successfully, but these errors were encountered: