-
Notifications
You must be signed in to change notification settings - Fork 49
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
Push support - including complicated ones #50
Comments
Hi David, thanks for your report, it is reaaly helpful to get workflows from other people! I am not sure to fully understand the perforce worklow, do you have a link to a usage example? Thanks |
Don't worry about the P4 workflow as it is different. Basically, I stage a bunch of changes. The git push command I have to run is complicated, so I want those stored somewhere. Then in the :Magit window, just like hitting CC, I want to hit PP (or something) to do a git push, but the actual command run by :Magit would be a custom command I provided (assuming I provided one, otherwise, it will run the standard In my .vimrc I have augroups for different projects, which allow me to "customize" my Vim settings and plugins for that project. Consider this one:
I create an augroup for each project I work on. What I would do with Vimagit, is based on the directory I am in, I would override the Vimagit, would need to provide the ability for me to override that command though. We can't really do this at a buffer level using b: variables, since we could be many directories deep in the project. I am not sure what Vimagit provides, but I would think something like this:
"Project1", would have to be something returned from git. You already do this:
So maybe the dictionary of settings we store in the .vimrc can be keyed off some "thing" we get from git. I am extremely new to git, so I am not sure what that would be. But it just needs to be something to allow us to configure based on the directory we are in. Anyway, those are just ideas. I have given you two basic options:
|
Basically, for the moment, I am thinking to provide this function:
When these parameters are set, the current branch is pushed silently. When the parameters are not set (ie. the user calls While I'm at it, I advise you to have a look on git remote settings.
this remote setting will be local to your repository.
Finally, set upstream push default behabior: All that to say that it seems safer to let git handle this kind of stuff. Anyway, if you really prefer to handle your remote url and remote branch from vim, you always can wrap If you think that this solution is not yet enough for you, feel free to say it ;) |
BTW, let the user the opportunity to define it's own git command is a good idea! Do you really need different git commands among projects? |
This issue is related to #24 |
I downloaded the master branch today. When I open the :Magit window, then do: I don't see anything resembling "push". Ahh, I see the problem, I had to use the "dev-push" branch not "master". First problem with this branch, is it does not have my changes to make it work under Windows.
Looking at the code in the Vim debugger:
Should this line:
Be:
Hmm, I tried these variants, all failed:
Not sure what you were trying to accomplish. |
Hey, good to see how active you are! This is a quite old dev branch, I have to refresh my memory, I am not event sure this branch is working! I rebased the dev/push branch onto next, and repushed it (you should have do the rebase instead of apply again your patches). Could you try with the forced updated dev/push branch? About And the return value os system is important :) |
I see on the homepage you have:
Add a push function, taking care if needed about the remote repository and branch.
It would be nice to have some way to configure this via the vimrc.
For example the Perforce (source control) plugin allows you to specify which servers to use:
let g:p4Presets = ['port1 client1 user1', 'port2 client2 user2' ]
Then you can use :PFSwitch 1 to choose the first item in the List. This allows me to configure a buffer based on autocmds.
My git push commands with Gerrit look like this:
git push ssh://me@git:29418/my.server.git HEAD:refs/for/master
This is too difficult to remember (much longer than supplied above) and I have many to choose from.
So, I would like to be able to use an autocmd based on my directory to choose the correct "push" command for the project I am in. Then use a P or whatever mapping to run it.
Thanks,
David
The text was updated successfully, but these errors were encountered: