Only create All-Projects ACL once

If refs/meta/config already exists do not overwrite or update it
with default configuration. This protects site administrators who
run `java -war gerrit.war init -d /some/existing/site --batch` and
corrupt ACLs of a live server with default settings.

To really set the default ACLs on an existing site the admin
should remove the refs/meta/config branch so it can be created.

Change-Id: I44a21b0c162812747ebcd50535709e8330dfbef8
Enable scrollbars for "Edit Commit Message" TextArea

Bug: Issue 2890
Change-Id: I5de5179d2c059ddd9ef26ec37dcf9891926e1c8e
Use current time for cherry picked commits

Cherry picking with the submitter time could cause massive clock skew
in the Git commit graph if the server is shutdown before the submit can
finish, and restarted hours later. In such a case Gerrit will write out
new cherry picks using hour-old committer times. This can confuse a Git
revision walker if there are many such badly dated commits, more than
the "slop bucket" the revision walker can tolerate (5-10).

Updating the commit time on each attempt also allows this strategy to
work around bugs elsewhere in Gerrit that does not handle patch sets
with the same commit SHA-1 well. Each new retry will get a new SHA-1,
as the timestamp is updated.

Change-Id: Ia0be365054cdc4692a8f5aa2afc2fb87f2e7888a
Fix exception when clicking on binary file without being signed in

The user preferences are only available if the user is signed in.

Change-Id: I2ec307d34464394cd902218a32de1afdf5314f86
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
ACL: Fix transitions check & a '1' in RefName

In determining which access pattern has precedence, the 1st check is
which pattern is closer via Levenshtein distance.  The 2nd criteria is
if they differ on finite vs inifite.  The 3rd criteria is based on
number of transitions in the pattern, where it is supposed to be the
pattern with the  greatest number of transitions having precedence.  The
check of using the number of transitions had the check reversed.  This
caused the pattern with the fewest number of transitions to have
precedence.

When determining the Levenshtein distance of a glob style pattern the
trailing '*' would be changed to a '1'.  The issue with doing this is
that it could cause a different access pattern to take precedence if a
RefName contained a '1' character as that would cause the Levenshtein
distance to become decreased by one.

Change-Id: Ibdcd483c303d24565ef43001b3831f6463c2ed8f
Signed-off-by: John L. Villalovos <john.l.villalovos@intel.com>
Honor expireAfterWrite in the H2CacheImpl

The H2CacheImpl didn't honor the expireAfterWrite. This had an effect
that persisted entries never expired. For example, the web_sessions
cache entries didn't expire after their maxAge was reached.

Change-Id: I3a7c754ee05fe9ac92d96652db4b862bb597eba1
Signed-off-by: Saša Živkov <sasa.zivkov@sap.com>
Signed-off-by: Adrian Görler <adrian.goerler@sap.com>