Skip to content
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

(GH-460) Fix Uninstall Template $key array #462

Closed
wants to merge 1 commit into from
Closed

(GH-460) Fix Uninstall Template $key array #462

wants to merge 1 commit into from

Conversation

pauby
Copy link
Member

@pauby pauby commented Oct 13, 2015

Using 'choco new' to produce ChocolateyUninstall.ps1 for your package would result in the uninstall block never being executed as the $key variable type was wrong. Updated the script template to force the $key variable to always be an array and therefore have a Count method that can be evaluated and the uninstall block executed.

Closes #460
Supersedes #461

@ferventcoder
Copy link
Member

This is really good. As a further enhancement, I would line break your git commit message body around 72 chars. And update your summary a bit - you are fixing the uninstall template.

It's okay to use (GH-460) Fix Uninstall Template $key array

@ferventcoder ferventcoder changed the title (GH-460) Amended Template (GH-460) Fix Uninstall Template $key array Oct 13, 2015
@pauby
Copy link
Member Author

pauby commented Oct 13, 2015

I appreciate your patience on this Rob. Until I got the hang of Github and how it all works I have been working with the Windows GUI. While the command line is not alien to me at all (using PowerShell on a daily basis) working with Github through it is!

I have updated my commit text and wrapped it at 72 (that was in your doc - I forgot about it) but I'm not sure if I have to remove my pull request and resubmit?

@ferventcoder
Copy link
Member

Perfect! Once AppVeyor is happy, we'll move forward.

@ferventcoder
Copy link
Member

Once the PR is repushed, everything shows up here again for commit validation checks.

@pauby
Copy link
Member Author

pauby commented Oct 15, 2015

I want to smile when I ask but ... how to I repush a PR? I'm Googling. I am. But I cant find anything that tells me.

@pauby
Copy link
Member Author

pauby commented Oct 15, 2015

git push origin fixup_uninstall_template:master

http://stackoverflow.com/questions/8479559/github-pushing-to-pull-requests ?

@ferventcoder
Copy link
Member

@ferventcoder
Copy link
Member

When you make additional commits, you can use git push origin fixup_uninstall_template, when you are changing history (adding more to same commit, rebasing against master, squashing, reordering commits, etc), you use git push origin fixup_uninstall_template -f

@ferventcoder
Copy link
Member

The update of the branch will automatically update the existing PR.

@ferventcoder
Copy link
Member

@pauby Whoopsy. Don't ever use git pull.

@pauby
Copy link
Member Author

pauby commented Oct 16, 2015

Rob, apologies. I'm actually at a loss on how to proceed any further. The instructions provided didn't work and Git itself suggested a git pull which is why I used it.

@ferventcoder
Copy link
Member

Mostly you should always use git fetch followed by git rebase. I would highly recommend installing git extensions (choco install gitextensions) and then using it to visualize what's going on.

@ferventcoder
Copy link
Member

Then read over the instructions again. When you fetch and rebase master (which wasn't required here), you do that against the master branch, not your feature branch.

@pauby
Copy link
Member Author

pauby commented Oct 16, 2015

Rob, when I follow the instructions I get the following errors:

git push origin fixup_uninstall_template
To https://github.com/pauby/choco.git
! [rejected] fixup_uninstall_template -> fixup_uninstall_template (non-fast-forward)
error: failed to push some refs to 'https://github.com/pauby/choco.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Probably something to do with what I have already done. I really don't want to do anymore in case I make things worse.

@pauby
Copy link
Member Author

pauby commented Oct 16, 2015

Oh, and I have installed Git Extensions. Just looking at it now.

@ferventcoder
Copy link
Member

Thats why -f, which is in the instructions.

On Friday, October 16, 2015, Paul Broadwith notifications@github.com
wrote:

Rob, when I follow the instructions I get the following errors:

git push origin fixup_uninstall_template
To https://github.com/pauby/choco.git
! [rejected] fixup_uninstall_template -> fixup_uninstall_template
(non-fast-forward)
error: failed to push some refs to 'https://github.com/pauby/choco.git'
hint: Updates were rejected because the tip of your current branch is
behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Probably something to do with what I have already done. I really don't
want to do anymore in case I make things worse.


Reply to this email directly or view it on GitHub
#462 (comment).

Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@pauby
Copy link
Member Author

pauby commented Oct 16, 2015

Used -f for the push now.

@ferventcoder
Copy link
Member

So you are going to likely need to back off the merge from master commit, then do another force push. Optionally I can cherry pick your commits and fix it up if you feel like you've gotten in too big of a mess to get out of.

Hope you are looking at this as a learning opportunity, not something that is scary. Git is quite powerful and it can be quite daunting for newcomers.

@ferventcoder
Copy link
Member

These are very specific instructions to follow, and should be followed almost near exactly as they are specified.

  • make sure you are in the branch git checkout fixup_uninstall_template
  • If you have any work you need to save - git add -A / git stash.
  • git reset --hard 857ade1ea57eb026fcbaf48816108f0f564ba9b2
  • git rebase -i HEAD~2
  • With the box that comes up, you will have two commits, you want to put s next to the second one to squash the two commits together (second one is the second one DOWN in the list). Save that and close it. You are changing this from pick to squash (the instructions tell you the exact word you can put there).
  • The next box will come up asking how you want to edit the commit message. Fix it up the way you want and then save and close it.
  • Once it finishes, you should have one commit in your branch.
  • git push origin fixup_uninstall_template -f

@gep13
Copy link
Member

gep13 commented Oct 17, 2015

@ferventcoder said...
Git is quite powerful and it can be quite daunting for newcomers.

Totally agree with this. Although I am "comfortable" with git, I know there is still a LOT I don't know about it. But once you grasp the basics, you will be amazed at what you can achieve.

(GH-460) Amended Template

Using 'choco new' to produce ChocolateyUninstall.ps1 for your package would
result in the uninstall block never being executed as the $key variable type
was wrong. Updated the script template to force the $key variable to always be
an array and therefore have a Count method that can be evaluated and the
uninstall block executed.

Closes #460
@ferventcoder
Copy link
Member

@pauby that's really close. :)

@pauby
Copy link
Member Author

pauby commented Oct 23, 2015

Lol. Thanks Rob. Close but not close enough? Why is it failing?

@ferventcoder
Copy link
Member

TeamCity always fails.

The reason I said it was close but not close enough. Your commit was squashed into an already pushed commit.

@ferventcoder
Copy link
Member

@pauby I'll take this one for you and fix it up. No worries.

@ferventcoder
Copy link
Member

Thanks for working with me on this. I hope that so far it's a good learning opportunity!

@pauby
Copy link
Member Author

pauby commented Oct 26, 2015

Thanks Rob. Let's just say it's been an ... experience :)

@ferventcoder
Copy link
Member

@pauby if you want to pair up on this, I'd be open to it.

@pauby
Copy link
Member Author

pauby commented Oct 29, 2015

@ferventcoder What did you have in mind?

@ferventcoder
Copy link
Member

contact me at ferventcoder gmail.

@ferventcoder
Copy link
Member

I cherry picked in 857ade1 at ad27a72. Thanks for the contribution!

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

Successfully merging this pull request may close these issues.

None yet

3 participants