Issue 235 - Created new Helper Function to create generic shortcut #238

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@gep13
Member
gep13 commented Jan 30, 2013

As described here:

#235

I have created a generic Install-ChocoatelyShortcut helper function to allow a shortcut, with optional parameters, to be created anywhere the user specifies.

I believe that this may also solve Issue 218 as well:

#218

I have included 7 new Unit Tests to verify the functionality.

The only thing that I am not "convinced" by are the last two tests. I have created fake files at the root of the C:\ drive, which are tided up after the test is completed. Obviously, it would be better to mock these files. I attempted to use TestDrive for this purpose, however, I could not get this to work. I believe that this is due to .CreateShortcut being a call into a ComObject, which TestDrive can't handle.

Let me know if you have any questions.

Thanks

Gary

@ferventcoder
Member

Thanks!

@gep13
Member
gep13 commented Jan 31, 2013

Not a problem at all. Would welcome any feedback (good or bad), it can only help me to get better :-)

@ferventcoder ferventcoder was assigned Mar 21, 2013
@rismoney
Member

asserts changed in new pester, particularly around piping...
I really like this PR.

And I would rebase fixup your commits so its a clean bisectable history. With all the outstanding PRs we need to make sure if we introduce a bug, we can use git bisect and git blame successfully going forward.

@gep13
Member
gep13 commented Apr 19, 2013

Hey,

More than happy to do what ever is required, but can I ask for a bit of hand holding for this, still relatively new to git, and don't want to do anything wrong :-)

Are you simply looking for me to rebase so that there is a single commit for the PR? If so, could you walk me through the steps?

Thanks, much appreciated! My experience with git to date has been as a single developer working in one branch and one remote, so I haven't yet ventured into the sort of details that you guys are now facing.

Also, is there something that I need to change around the asserts? If so, happy to do this as well.

Thanks

Gary

@rismoney
Member

C:\gitrepos\chocolatey [branch]> git remote -v
origin git@github.com:rismoney/chocolatey.git (fetch)
origin git@github.com:rismoney/chocolatey.git (push)
upstream git@github.com:chocolatey/chocolatey.git (fetch)
upstream git@github.com:chocolatey/chocolatey.git (push)

git checkout master
git fetch upstream
git rebase upstream/master

then
git checkout yourbranch
git fetch upstream
git rebase upstream/master - this puts your changes on top of the current HEAD

then
git rebase -i upstream/master
editor should be launched

you should see a list of all your commits, with the word pick in front.
starting with the second commit change the first word from pick to fixup
repeat for all subsequent comits
close editor with save

then
git commit --amend to fixup the single commit message

then
git push -f origin

you will then have a single commit that looks like you did it perfectly the 1st time.

@gep13
Member
gep13 commented Apr 19, 2013

Sounds easy :P

I will let you know how i get on.

Thanks for all your help!

Gary

Sent from my Windows Phone


From: Rich Siegelmailto:notifications@github.com
Sent: ‎19/‎04/‎2013 21:14
To: chocolatey/chocolateymailto:chocolatey@noreply.github.com
Cc: Gary Ewan Parkmailto:gep13@gep13.co.uk
Subject: Re: [chocolatey] Issue 235 - Created new Helper Function to create generic shortcut (#238)

C:\gitrepos\chocolatey [branch]> git remote -v
origin git@github.com:rismoney/chocolatey.git (fetch)
origin git@github.com:rismoney/chocolatey.git (push)
upstream git@github.com:chocolatey/chocolatey.git (fetch)
upstream git@github.com:chocolatey/chocolatey.git (push)

git checkout master
git fetch upstream
git rebase upstream/master

then
git checkout yourbranch
git fetch upstream
git rebase upstream/master - this puts your changes on top of the current HEAD

then
git rebase -i upstream/master
editor should be launched

you should see a list of all your commits, with the word pick in front.
starting with the second commit change the first word from pick to fixup
repeat for all subsequent comits
close editor with save

then
git commit --amend to fixup the single commit message

then
git push -f origin

you will then have a single commit that looks like you did it perfectly the 1st time.


Reply to this email directly or view it on GitHub:
#238 (comment)

@gep13
Member
gep13 commented Apr 20, 2013

Ok, I think I have done everything that you suggested, but I am now also a little confused. How did it get into this pull request already? I expected the last command that I ran, i.e:

git push -f origin

To put the rewritten commits into my forked repo, and from there I would have to update the pull request, but this seems to have happened automagically. What gives? Or what am I missing?

Thanks for all the help by the way, it really helped! Would have never figured that out on my own! :-)

Gary

@ferventcoder
Member

Once you push to a remote that is part of a pull request, it updates the PR
automagically. That's why we always want PRs in branches, so you don't
accidentally include something you don't want in the PR.

On Saturday, April 20, 2013, Gary Ewan Park wrote:

Ok, I think I have done everything that you suggested, but I am now also a
little confused. How did it get into this pull request already? I expected
the last command that I ran, i.e:

git push -f origin

To put the rewritten commits into my forked repo, and from there I would
have to update the pull request, but this seems to have happened
automagically. What gives? Or what am I missing?

Thanks for all the help by the way, it really helped! Would have never
figured that out on my own! :-)

Gary


Reply to this email directly or view it on GitHubhttps://github.com/chocolatey/chocolatey/pull/238#issuecomment-16705844
.


Rob
"Be passionate in all you do"

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

@gep13
Member
gep13 commented Apr 20, 2013

Gotcha, that makes sense. Have to take my hat off to Git and Github, they really do provide a great system. Once you get past the learning curve that is :-)

@gep13 gep13 Created new Helper Function to create generic shortcut
- Added Helper Function
- Created Unit Test to verify Function
- Added Synopsis to help with Documentation
- Used new syntax for Pester 2 asserts
0d5c50d
@rismoney
Member

It really is awesome. I hope I can get a lot of posh people on it at the summit this week. I Cant stand codeplex.

@Redsandro
Contributor

Gep13 said:

I believe that this may also solve Issue 218 as well:
#218

This adds a shortcut to the desktop which does not make the application appear in the Windows 7 or Windows 8 start menu. It is not indexed for searching.

This #228 allows pinning to start. I use it in my own installers, but this should really be included in Chocolatey imo.

I think it'd be best to encourage packagers to do pin to start anything that is not a command line tool as discussed here: #305

@gep13 gep13 assigned gep13 and unassigned ferventcoder Feb 27, 2014
@gep13
Member
gep13 commented Mar 5, 2014

Due to me deleting the original branch that this PR was submitted on, I had to recreate it, as a result, the linking is broken. However, I have recreated the PR, and pulled it in here:

201ad95

@gep13 gep13 closed this Mar 5, 2014
@ferventcoder ferventcoder added v0.9.9 and removed v0.9.8.25 labels Jul 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment