cake-contrib / Cake_Git

Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp
https://cakebuild.net/extensions/cake-git
Other
39 stars 64 forks source link

Add alias for git push with refspec #11

Closed IanMercer closed 8 years ago

IanMercer commented 8 years ago

This PR adds two aliases for pushing with a refspec which is needed in order to tag a remote.

Usage example: GitTag("./", "v1.0.0"); GitPushRef("./", gitUsername, gitPassword, "origin", "v1.0.0");

[Fixes: https://github.com/WCOMAB/Cake_Git/issues/9]

devlead commented 8 years ago

@IanMercer thanks for contributing :+1:

GitAliases.Checkout.cs(63,46): error CS0618: Warning as Error: `LibGit2Sharp.Repository.Checkout(string, LibGit2Sharp.CheckoutOptions)' is obsolete: `This method is deprecated. Please use LibGit2Sharp.Commands.Checkout()'
IanMercer commented 8 years ago

Fixed the warning message. Not sure how to proceed with the test:

  1. There doesn't seem to be a test for Git-Push to model this on.
  2. Trying a local push gets the error "Error: Local push doesn't (yet) support pushing to non-bare repos."
  3. To get round this I tried creating a new bare repo to push to but then I hit the issue that there is no alias in Cake-Git to add a remote.

What am I missing?

devlead commented 8 years ago

Does it work if you clone a local repo to a new local path, change something and push that?

IanMercer commented 8 years ago

No, tried that, gets the error message "Error: Local push doesn't (yet) support pushing to non-bare repos". So then I tried creating a third, bare repo and pushing to that; but without a command to add a remote that's not possible either.

devlead commented 8 years ago

I see, could you rebase into 1 commit and I'll do a final review before merging.

IanMercer commented 8 years ago

OK, will do. BTW see also: https://help.github.com/articles/about-pull-request-merge-squashing/

IanMercer commented 8 years ago

I left three commits because two are really not about this feature. Your choice.

devlead commented 8 years ago

@IanMercer your changed have now been merged, thanks for contributing :+1: Version 0.8.0 is now pushed to NuGet.org and should be avail shortly.