This week I found a bug in a plug-in we've been using on a Craft project.

The plugin is Google Maps for Craft, it's been in beta for quite a while but is based on the long released Google Maps for ExpressionEngine.

In the end it was a simple bug to fix – aren't they always? - but it took a while to understand how everything worked and where to fix.

It was a JS bug rather than a PHP bug but that's beside the point.

Code sharing, Version Control, GitHub and the Web is amazing

I could have filed a bug and crossed my fingers, but for a 'free' product that's not how it works. All the code is available on GitHub so I forked and found a fix myself. As our project is in Git I'd be able to keep a track of my changes if the plugin gets updated, but there's no need to email Justin with a fix because GitHub can handle it.

I forked, applied the fix and submitted a pull request all on GitHub – not forgetting that's all in the Browser.

As I typed in a message to go with the pull request I sat back in wonder about the tools at our disposal. This wasn't possible 10 years ago. Things move fast compared to other industries and we adapt to what's 'normal' just as quickly – it's easy to forget how much has changed.

How great is it to be a Web Dev in 2016?

Easy upgrading of Git on Mac (Lion)

I went through this process 6 months ago and of course in that time I've completely forgotten how to do it again. A return to Google and going through some trial-and-error brought it all back. So this post is as much reference for me as hopefully helping someone else.

I'm running Lion 10.7.5 but these steps should be version independent and will work with Snow Leopard, Mountain Lion etc.

Also, I'm sure there's many different (possibly better) ways to do this but this is the way that worked for me. Upgrading on the command line, building from source, using Homebrew are all options. But if you haven't got XCode installed or Homebrew this is a simple option.

Download Git

I know this is an upgrade but the best way to do this is RTFM. Downloading the latest Graphical Git installer actually contains the simplest instructions!

Uninstall and reinstall Git

In the included README are the instructions to upgrade. Basically remove your existing Git, install the latest. If you have used any guides to setting up git config options these were retained after uninstall for me – so no need to worry about setting everything up again.

There's a shell script to uninstall Git. Again there's ways of doing this but here's the easiest:

  1. Copy 'uninstall.sh' to your desktop.
  2. Open Terminal and type:

    $ cd ~/Desktop
    $ sh uninstall.sh

    This gets you to desktop and uses the shell command to run the script. easy.

  3. Simply double click the installer to run

And that's it! Type $ git --version and you should see you're running the latest version of Git (the same version as in the installer file name).

SSH remembering password

The reason I wanted to upgrade was for the new(er) option of remembering my username and password. I use Git on the command line (I just haven't got on with any GUI yet) but by default Git doesn't remember your password. When pushing and pulling to remote repos all day, having to retype your password is a real pain as I don't have the brain space to remember it.

By default Beanstalk uses SSH for repos now (nice feature) but you need at least Git 1.7.12.1 to remember credentials.

In short this is the command you need to remember your password for 24hours:

git config --global credential.helper 'cache --timeout=86400'

*Update 22nd July 2013

After the upgrade I had issues with Git asking for a password but then erroring with:

error: git-credential-osxkeychain died of signal 11

The answer came from Beanstalk's superb support.

you need to download a new version of git-credential-osxkeychain helper.
http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain
After downloading the file you need to set executable permissions on it:

chmod u+x git-credential-osxkeychain  

And move it to it's path inside Git directory:

sudo mv git-credential-osxkeychain "$(dirname $(which git))/git-credential-osxkeychain"

And that fixed it. Basically this just downloads the git-credential-osxkeychain file and puts it in the right place. I have no idea why it went missing, got corrupted or wasn't included in the upgrade install but everything works as expected now.