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
Allow public repo searching

GITLAB-1386

Change-Id: I9a0bbe8db1a9bb00cef33b3e1854d78844b70a45
Updated convience method to private
Fix #5313 hipchat 0.14.0 to use http_proxy
Add import_url param in API projects create
[API] add parent_ids to specific commit informations
Add comment about tls for ldap method

`omniauth-ldap` also supports tls for ldap method
Fix HTTP push to public repos

When doing an HTTP push, git (as of v1.7.9) first do an info/refs
request, and only if this request requires authentication it asks the
user for its password and authenticates further requests.

The initial request normally clears without auth on public repos as it
doesn't update any ref. This patch forces every git-receive-pack
requests to provide authentication.
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.
Make note anchors actually work

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Write new Notes coffee class to handle comments

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Switch Notes controller to use json

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Update commentable controllers with new note vars

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Remove old methods and classes

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Improve tests and make preview for notes

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
visibility level info in project tabs
fix tests

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fix file upload for edit note. Better style for discussion form

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>