Ensure directory exists before changing in popen

If the directory does not exist, we want to ensure that it does.

Forking repos will fail in some situations because of this issue.
Whitespace fixes to patch
Reduce image size.

Checking the site with the PageSpeed extension, one of the reports was
in reducing image size.  This reduced the number of bytes by 67%.

It was done with optipng -o7 -fix *.png in the app/assets/images dir.

References:
  optipng: http://optipng.sourceforge.net/
  PageSpeed extension: https://developers.google.com/speed/docs/insights/using_chrome
Add comment about tls for ldap method

`omniauth-ldap` also supports tls for ldap method
Update installation.md

Updated the version of Git used in the section for compiling Git from source.

Also, changed the verbiage used in the section "Initialize Database and Activate Advanced Features". It previously said to type 'yes' to install the database.
refactor omniauth configuration method

This refactoring allows a user to use omniauth providers which do not
use ```app_id``` and ```app_secret``` without needing to change the
devise configuration.
Merge branch 'master' into logo-white-compress

Conflicts:
	app/assets/images/logo-black.png
	app/assets/images/logo-white.png
Another optipng run over png's.

Ran optipng -o7 -fix over all png files. This should make pages load a
tiny bit faster (you can test this with the pagespeed tool on firefox or
chrome).

It might be an idea to add *lossless* image compression optimization
runs to the release process.
Also optimise gifs with gifsicle.

These are the same gif files just after running
gifsicle -b --optimize **/*.gif
Removed hash from "<user> #pushed to branch..." Hipchat notification
Display correct paths in markdown for reference style links.
More explanation for upload limits.
Git over ssh and http are different things.
Correct section number for 'Check application status'
Include a note for people that think the headers are wrong.
Replace context with service in development seed data.
Markdown helper spec for reference style relative links.
Merge branch 'master' into dont-depend-on-appid-and-appsecret

* master: (238 commits)
  Version 6.5.1
  Fix selectbox when submit MR from fork to origin
  Fix HELP layout
  No need for code tag here.
  Spelling mistake and add links.
  Warn against RVM.
  Remove GitHub mention because we also have a GitLab issue tracker now.
  Replace 6.0-to-6.4.md with 6.0-to-6.5.md
  Add public assets to gitignore
  Version 6.5.0
  Use 6-5 branch in installation docs
  Remove deprecated twitter handle.
  Further explain userPrincipalName settings
  Update from 6.4 to 6.5 guide
  Explain how to use AD userPrincipalName for logins
  More entries to CHANGELOG. Version to rc1
  Rephrase LDAP check script output
  add O'Reilly sponsorship in CHANGELOG
  Fix select2 css for drop above style
  Rename "Website url" labels to "Website"
  ...
Test if the views behave correctly with reference style relative links.
Report failure of DB backup commands