Merge "Fix typo that was causing right side of diff to not render during tests"
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 29f93b2..8c488e4 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -3143,6 +3143,8 @@
+
A size of 0 bytes disables rules, same as rules.enable = false.
+
+Common unit suffixes of 'k', 'm', or 'g' are supported.
++
Default is 128 KiB.
[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/BuckUtils.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/BuckUtils.java
index a182663..0b4a02e 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/BuckUtils.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/BuckUtils.java
@@ -14,9 +14,9 @@
package com.google.gerrit.httpd.raw;
+import static com.google.common.base.MoreObjects.firstNonNull;
import static java.nio.charset.StandardCharsets.UTF_8;
-import com.google.common.base.MoreObjects;
import com.google.common.escape.Escaper;
import com.google.common.html.HtmlEscapers;
import com.google.common.io.ByteStreams;
@@ -27,12 +27,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.io.PrintWriter;
+import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;
@@ -47,7 +47,7 @@
throws IOException, BuildFailureException {
log.info("buck build " + target);
Properties properties = loadBuckProperties(gen);
- String buck = MoreObjects.firstNonNull(properties.getProperty("buck"), "buck");
+ String buck = firstNonNull(properties.getProperty("buck"), "buck");
ProcessBuilder proc = new ProcessBuilder(buck, "build", target)
.directory(root.toFile())
.redirectErrorStream(true);
@@ -77,12 +77,13 @@
log.info(String.format("UPDATED %s in %.3fs", target, time / 1000.0));
}
- private static Properties loadBuckProperties(Path gen)
- throws FileNotFoundException, IOException {
+ private static Properties loadBuckProperties(Path gen) throws IOException {
Properties properties = new Properties();
- try (InputStream in = new FileInputStream(
- gen.resolve(Paths.get("tools/buck/buck.properties")).toFile())) {
+ Path p = gen.resolve(Paths.get("tools/buck/buck.properties"));
+ try (InputStream in = Files.newInputStream(p)) {
properties.load(in);
+ } catch (NoSuchFileException e) {
+ // Ignore; will be run from PATH, with a descriptive error if it fails.
}
return properties;
}
diff --git a/gerrit-openid/BUCK b/gerrit-openid/BUCK
index 78abce8..0a6363b 100644
--- a/gerrit-openid/BUCK
+++ b/gerrit-openid/BUCK
@@ -3,6 +3,9 @@
srcs = glob(['src/main/java/**/*.java']),
resources = glob(['src/main/resources/**/*']),
deps = [
+ '//lib/openid:consumer',
+ ],
+ provided_deps = [
'//gerrit-common:annotations',
'//gerrit-common:server',
'//gerrit-extension-api:api',
@@ -12,13 +15,12 @@
'//gerrit-server:server',
'//lib:guava',
'//lib:gwtorm',
+ '//lib:servlet-api-3_1',
'//lib/commons:codec',
'//lib/guice:guice',
'//lib/guice:guice-servlet',
'//lib/jgit:jgit',
'//lib/log:api',
- '//lib/openid:consumer',
],
- provided_deps = ['//lib:servlet-api-3_1'],
visibility = ['PUBLIC'],
)
diff --git a/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg b/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg
index 6988459..5370156 100644
--- a/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg
+++ b/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks/commit-msg
@@ -63,6 +63,10 @@
AWK=/usr/xpg4/bin/awk
fi
+ # Get core.commentChar from git config or use default symbol
+ commentChar=`git config --get core.commentChar`
+ commentChar=${commentChar:-#}
+
# How this works:
# - parse the commit message as (textLine+ blankLine*)*
# - assume textLine+ to be a footer until proven otherwise
@@ -81,8 +85,8 @@
blankLines = 0
}
- # Skip lines starting with "#" without any spaces before it.
- /^#/ { next }
+ # Skip lines starting with commentChar without any spaces before it.
+ /^'"$commentChar"'/ { next }
# Skip the line starting with the diff command and everything after it,
# up to the end of the file, assuming it is only patch data.