summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-05-04 17:35:49 -0400
committerJames Moger <james.moger@gitblit.com>2011-05-04 17:35:49 -0400
commitcf9550d8df51d927c63176675280d69b86e7a6e2 (patch)
tree9974201aae08af4e46275465eff30793e13262aa
parentb5b4026628c50ffdfa3ceeb93badb613cdca18eb (diff)
downloadgitblit-cf9550d8df51d927c63176675280d69b86e7a6e2.tar.gz
gitblit-cf9550d8df51d927c63176675280d69b86e7a6e2.zip
Build infrastructure improvements. Setting to show remote branches.
The JGit team is now publishing 0.12.1 artifacts on the Eclipse Maven site. Yeah! That was the last missing piece for a slick Git:Blit deployment. The build has been reworked to download from Eclipse and to also download source and javadoc jars for setting up a development environment. Made the log4j pattern configurable by operating system. Moved Markdown utils to their own class since I need StringUtils for Build and that introduced a chicken-and-egg scenario.
-rw-r--r--.classpath81
-rw-r--r--build.xml13
-rw-r--r--gitblit.properties3
-rw-r--r--makepassword.cmd12
-rw-r--r--makerepository.cmd11
-rw-r--r--src/com/gitblit/Build.java276
-rw-r--r--src/com/gitblit/Constants.java2
-rw-r--r--src/com/gitblit/FileSettings.java2
-rw-r--r--src/com/gitblit/GitBlit.java11
-rw-r--r--src/com/gitblit/GitBlitServer.java20
-rw-r--r--src/com/gitblit/Launcher.java4
-rw-r--r--src/com/gitblit/WebXmlSettings.java2
-rw-r--r--src/com/gitblit/utils/JGitUtils.java6
-rw-r--r--src/com/gitblit/utils/MarkdownUtils.java53
-rw-r--r--src/com/gitblit/utils/StringUtils.java46
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp.properties3
-rw-r--r--src/com/gitblit/wicket/models/RepositoryModel.java1
-rw-r--r--src/com/gitblit/wicket/pages/BranchesPage.java2
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.html3
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.java1
-rw-r--r--src/com/gitblit/wicket/pages/MarkdownPage.java4
-rw-r--r--src/com/gitblit/wicket/pages/RepositoriesPage.java5
-rw-r--r--src/com/gitblit/wicket/pages/SummaryPage.java2
-rw-r--r--src/com/gitblit/wicket/panels/BranchesPanel.java19
-rw-r--r--src/com/gitblit/wicket/resources/welcome.mkd6
25 files changed, 382 insertions, 206 deletions
diff --git a/.classpath b/.classpath
index e1c4e4ae..26484c28 100644
--- a/.classpath
+++ b/.classpath
@@ -2,19 +2,72 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="lib" path="ext/log4j-1.2.16.jar"/>
- <classpathentry kind="lib" path="ext/servlet-api-2.5.jar"/>
- <classpathentry kind="lib" path="ext/slf4j-api-1.6.1.jar"/>
- <classpathentry kind="lib" path="ext/slf4j-log4j12-1.6.1.jar"/>
- <classpathentry kind="lib" path="ext/jetty-all-7.2.2.v20101205.jar"/>
- <classpathentry kind="lib" path="ext/jcommander-1.17.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
- <classpathentry kind="lib" path="ext/wicket-1.4.17.jar"/>
- <classpathentry kind="lib" path="ext/wicket-auth-roles-1.4.17.jar"/>
- <classpathentry kind="lib" path="ext/wicket-extensions-1.4.17.jar"/>
- <classpathentry kind="lib" path="ext/markdownpapers-core-1.0.0.jar"/>
- <classpathentry kind="lib" path="ext/googlecharts-1.4.17.jar"/>
- <classpathentry kind="lib" path="lib/jgit-0.12-stable.jar"/>
- <classpathentry kind="lib" path="lib/jgit-http-0.12-stable.jar"/>
+ <classpathentry kind="lib" path="ext/log4j-1.2.16.jar" sourcepath="ext/log4j-1.2.16-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/log4j-1.2.16-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/servlet-api-2.5.jar" sourcepath="ext/servlet-api-2.5-sources.jar"/>
+ <classpathentry kind="lib" path="ext/slf4j-api-1.6.1.jar" sourcepath="ext/slf4j-api-1.6.1-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/slf4j-api-1.6.1-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/slf4j-log4j12-1.6.1.jar" sourcepath="ext/slf4j-log4j12-1.6.1-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/slf4j-log4j12-1.6.1-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/jetty-all-7.2.2.v20101205.jar" sourcepath="ext/jetty-all-7.2.2.v20101205-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/jetty-all-7.2.2.v20101205-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/jcommander-1.17.jar" sourcepath="ext/jcommander-1.17-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/jcommander-1.17-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/wicket-1.4.17.jar" sourcepath="ext/wicket-1.4.17-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/wicket-1.4.17-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/wicket-auth-roles-1.4.17.jar" sourcepath="ext/wicket-auth-roles-1.4.17-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/wicket-auth-roles-1.4.17-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/wicket-extensions-1.4.17.jar" sourcepath="ext/wicket-extensions-1.4.17-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/wicket-extensions-1.4.17-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/markdownpapers-core-1.0.0.jar" sourcepath="ext/markdownpapers-core-1.0.0-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/markdownpapers-core-1.0.0-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/googlecharts-1.4.17.jar" sourcepath="ext/googlecharts-1.4.17-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/googlecharts-1.4.17-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/junit-3.8.2.jar"/>
+ <classpathentry kind="lib" path="ext/org.eclipse.jgit-0.12.1.jar" sourcepath="ext/org.eclipse.jgit-0.12.1-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/org.eclipse.jgit-0.12.1-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/org.eclipse.jgit.http.server-0.12.1.jar" sourcepath="ext/org.eclipse.jgit.http.server-0.12.1-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/org.eclipse.jgit.http.server-0.12.1-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib" path="ext/bcprov-jdk16-1.46.jar" sourcepath="ext/bcprov-jdk16-1.46-sources.jar">
+ <attributes>
+ <attribute name="javadoc_location" value="jar:platform:/resource/gitblit/ext/bcprov-jdk16-1.46-javadoc.jar!/"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/build.xml b/build.xml
index 08de19b2..caaf3437 100644
--- a/build.xml
+++ b/build.xml
@@ -23,9 +23,6 @@
<!-- Compile Project -->
<path id="master-classpath">
- <fileset dir="${basedir}/lib">
- <include name="*.jar" />
- </fileset>
<fileset dir="${basedir}/ext">
<include name="*.jar" />
</fileset>
@@ -40,16 +37,13 @@
<!-- Build jar -->
<delete file="${project.jar}" />
- <jar index="true" jarfile="${project.jar}">
+ <jar jarfile="${project.jar}">
<fileset dir="${project.build.dir}">
<include name="**/*" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${project.mainclass}" />
</manifest>
- <indexjars>
- <fileset dir="${basedir}/lib" />
- </indexjars>
</jar>
<!-- Delete the deploy folder -->
@@ -58,11 +52,6 @@
<!-- Create deployment folder structure -->
<mkdir dir="${basedir}/deploy" />
<copy todir="${basedir}/deploy" file="${project.jar}" />
- <copy todir="${basedir}/deploy/lib">
- <fileset dir="${basedir}/lib">
- <include name="**/*.jar" />
- </fileset>
- </copy>
<copy todir="${basedir}/deploy">
<fileset dir="${basedir}/service">
<include name="**/*" />
diff --git a/gitblit.properties b/gitblit.properties
index 99254997..67c3a095 100644
--- a/gitblit.properties
+++ b/gitblit.properties
@@ -122,6 +122,9 @@ regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!<a href="http://s
#
server.tempFolder = temp
server.log4jPattern = %-5p %d{MM-dd HH:mm:ss.SSS} %-20.20c{1} %m%n
+server.log4jPattern.windows = %-5p %m%n
+server.log4jPattern.linux =
+
#
# Jetty Settings
diff --git a/makepassword.cmd b/makepassword.cmd
deleted file mode 100644
index 0257e870..00000000
--- a/makepassword.cmd
+++ /dev/null
@@ -1,12 +0,0 @@
-@if [%1]==[] goto missingparameters
-@if [%2]==[] goto missingparameters
-
-@java -cp "%CD%\ext\*" org.eclipse.jetty.http.security.Password %1 %2
-@goto end
-
-:missingparameters
-@echo Usage:
-@echo makepassword username password
-@echo.
-
-:end \ No newline at end of file
diff --git a/makerepository.cmd b/makerepository.cmd
deleted file mode 100644
index 660e2d78..00000000
--- a/makerepository.cmd
+++ /dev/null
@@ -1,11 +0,0 @@
-@if [%1]==[] goto missingparameters
-
-@java -cp gitblit.jar;"%CD%\lib\*" com.gitblit.MakeRepository --create %1
-@goto end
-
-:missingparameters
-@echo Usage:
-@echo makerepository path_to_repository
-@echo.
-
-:end \ No newline at end of file
diff --git a/src/com/gitblit/Build.java b/src/com/gitblit/Build.java
index 604ee08f..8b7fe3c1 100644
--- a/src/com/gitblit/Build.java
+++ b/src/com/gitblit/Build.java
@@ -20,6 +20,10 @@ import com.gitblit.utils.StringUtils;
public class Build {
+ public static enum BuildType {
+ RUNTIME, COMPILETIME;
+ }
+
public static void main(String... args) {
runtime();
compiletime();
@@ -27,21 +31,40 @@ public class Build {
}
public static void runtime() {
- downloadFromMaven(MavenObject.JCOMMANDER);
- downloadFromMaven(MavenObject.JETTY);
- downloadFromMaven(MavenObject.SERVLET);
- downloadFromMaven(MavenObject.SLF4JAPI);
- downloadFromMaven(MavenObject.SLF4LOG4J);
- downloadFromMaven(MavenObject.LOG4J);
- downloadFromMaven(MavenObject.WICKET);
- downloadFromMaven(MavenObject.WICKET_EXT);
- downloadFromMaven(MavenObject.WICKET_AUTH_ROLES);
- downloadFromMaven(MavenObject.WICKET_GOOGLE_CHARTS);
- downloadFromMaven(MavenObject.MARKDOWNPAPERS);
+ downloadFromApache(MavenObject.JCOMMANDER, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.JETTY, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.SERVLET, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.SLF4JAPI, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.SLF4LOG4J, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.LOG4J, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.WICKET, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.WICKET_EXT, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.WICKET_AUTH_ROLES, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.WICKET_GOOGLE_CHARTS, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.MARKDOWNPAPERS, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.BOUNCYCASTLE, BuildType.RUNTIME);
+
+ downloadFromEclipse(MavenObject.JGIT, BuildType.RUNTIME);
+ downloadFromEclipse(MavenObject.JGIT_HTTP, BuildType.RUNTIME);
}
public static void compiletime() {
- downloadFromMaven(MavenObject.JUNIT);
+ downloadFromApache(MavenObject.JUNIT, BuildType.RUNTIME);
+ downloadFromApache(MavenObject.JCOMMANDER, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.JETTY, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.SERVLET, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.SLF4JAPI, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.SLF4LOG4J, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.LOG4J, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.WICKET, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.WICKET_EXT, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.WICKET_AUTH_ROLES, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.WICKET_GOOGLE_CHARTS, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.MARKDOWNPAPERS, BuildType.COMPILETIME);
+ downloadFromApache(MavenObject.BOUNCYCASTLE, BuildType.COMPILETIME);
+
+ downloadFromEclipse(MavenObject.JGIT, BuildType.COMPILETIME);
+ downloadFromEclipse(MavenObject.JGIT_HTTP, BuildType.COMPILETIME);
}
public static void buildSettingKeys() {
@@ -115,111 +138,214 @@ public class Build {
}
/**
+ * Download a file from the official Apache Maven repository.
+ *
+ * @param mo
+ * the maven object to download.
+ * @return
+ */
+ private static List<File> downloadFromApache(MavenObject mo, BuildType type) {
+ return downloadFromMaven("http://repo1.maven.org/maven2/", mo, type);
+ }
+
+ /**
+ * Download a file from the official Eclipse Maven repository.
+ *
+ * @param mo
+ * the maven object to download.
+ * @return
+ */
+ private static List<File> downloadFromEclipse(MavenObject mo, BuildType type) {
+ return downloadFromMaven("http://download.eclipse.org/jgit/maven/", mo, type);
+ }
+
+ /**
* Download a file from a Maven repository.
*
* @param mo
* the maven object to download.
* @return
*/
- private static File downloadFromMaven(MavenObject mo) {
- File targetFile = mo.getLocalFile("ext");
- if (targetFile.exists()) {
- return targetFile;
+ private static List<File> downloadFromMaven(String mavenRoot, MavenObject mo, BuildType type) {
+ List<File> downloads = new ArrayList<File>();
+ String[] jars = { "" };
+ if (BuildType.RUNTIME.equals(type)) {
+ jars = new String[] { "" };
+ } else if (BuildType.COMPILETIME.equals(type)) {
+ jars = new String[] { "-sources", "-javadoc" };
}
-
- String mavenURL = "http://repo1.maven.org/maven2/" + mo.getRepositoryPath();
- if (!targetFile.getAbsoluteFile().getParentFile().exists()) {
- boolean success = targetFile.getAbsoluteFile().getParentFile().mkdirs();
- if (!success) {
- throw new RuntimeException("Failed to create destination folder structure!");
+ for (String jar : jars) {
+ File targetFile = mo.getLocalFile("ext", jar);
+ if (targetFile.exists()) {
+ downloads.add(targetFile);
+ continue;
}
- }
- ByteArrayOutputStream buff = new ByteArrayOutputStream();
- try {
- System.out.println("Downloading " + mavenURL);
- URL url = new URL(mavenURL);
- InputStream in = new BufferedInputStream(url.openStream());
- long last = System.currentTimeMillis();
- int len = 0;
- while (true) {
- long now = System.currentTimeMillis();
- if (now > last + 200) {
- System.out.println(" downloaded " + len + " bytes");
- last = now;
+ String expectedSHA1 = mo.getSHA1(jar);
+ if (expectedSHA1 == null) {
+ // skip this jar
+ continue;
+ }
+ float approximateLength = mo.getApproximateLength(jar);
+ String mavenURL = mavenRoot + mo.getRepositoryPath(jar);
+ if (!targetFile.getAbsoluteFile().getParentFile().exists()) {
+ boolean success = targetFile.getAbsoluteFile().getParentFile().mkdirs();
+ if (!success) {
+ throw new RuntimeException("Failed to create destination folder structure!");
}
- int x = in.read();
- len++;
- if (x < 0) {
- break;
+ }
+ ByteArrayOutputStream buff = new ByteArrayOutputStream();
+ try {
+ URL url = new URL(mavenURL);
+ InputStream in = new BufferedInputStream(url.openStream());
+ byte[] buffer = new byte[4096];
+ int downloadedLen = 0;
+ float lastProgress = 0f;
+
+ updateDownload(0, targetFile);
+ while (true) {
+ int len = in.read(buffer);
+ if (len < 0) {
+ break;
+ }
+ downloadedLen += len;
+ buff.write(buffer, 0, len);
+ float progress = downloadedLen / approximateLength;
+ if (progress - lastProgress >= 0.1f) {
+ lastProgress = progress;
+ updateDownload(progress, targetFile);
+ }
}
- buff.write(x);
+ in.close();
+ updateDownload(1f, targetFile);
+
+ } catch (IOException e) {
+ throw new RuntimeException("Error downloading " + mavenURL + " to " + targetFile, e);
}
- in.close();
- } catch (IOException e) {
- throw new RuntimeException("Error downloading " + mavenURL + " to " + targetFile, e);
- }
- byte[] data = buff.toByteArray();
- String got = StringUtils.getSHA1(data);
- if (mo.sha1 != null && !got.equals(mo.sha1)) {
- throw new RuntimeException("SHA1 checksum mismatch; got: " + got);
+ byte[] data = buff.toByteArray();
+ String calculatedSHA1 = StringUtils.getSHA1(data);
+
+ System.out.println();
+
+ if (expectedSHA1.length() == 0) {
+ updateProgress(0, "sha: " + calculatedSHA1);
+ System.out.println();
+ } else {
+ if (!calculatedSHA1.equals(expectedSHA1)) {
+ throw new RuntimeException("SHA1 checksum mismatch; got: " + calculatedSHA1);
+ }
+ }
+ try {
+ RandomAccessFile ra = new RandomAccessFile(targetFile, "rw");
+ ra.write(data);
+ ra.setLength(data.length);
+ ra.close();
+ } catch (IOException e) {
+ throw new RuntimeException("Error writing to file " + targetFile, e);
+ }
+ downloads.add(targetFile);
}
- try {
- RandomAccessFile ra = new RandomAccessFile(targetFile, "rw");
- ra.write(data);
- ra.setLength(data.length);
- ra.close();
- } catch (IOException e) {
- throw new RuntimeException("Error writing to file " + targetFile, e);
+ return downloads;
+ }
+
+ private static void updateDownload(float progress, File file) {
+ updateProgress(progress, "d/l: " + file.getName());
+ }
+
+ private static void updateProgress(float progress, String url) {
+ String anim = "==========";
+ int width = Math.round(anim.length() * progress);
+ System.out.print("\r[");
+ System.out.print(anim.substring(0, width));
+ for (int i = 0; (i < anim.length() - width); i++) {
+ System.out.print(" ");
}
- return targetFile;
+ System.out.print("] " + url);
}
private static class MavenObject {
- public static final MavenObject JCOMMANDER = new MavenObject("jCommander", "com/beust", "jcommander", "1.17", "219a3540f3b27d7cc3b1d91d6ea046cd8723290e");
+ public static final MavenObject JCOMMANDER = new MavenObject("jCommander", "com/beust", "jcommander", "1.17", 34000, 32000, 141000, "219a3540f3b27d7cc3b1d91d6ea046cd8723290e", "0bb50eec177acf0e94d58e0cf07262fe5164331d", "c7adc475ca40c288c93054e0f4fe58f3a98c0cb5");
+
+ public static final MavenObject JETTY = new MavenObject("Jetty", "org/eclipse/jetty/aggregate", "jetty-all", "7.2.2.v20101205", 1430000, 965000, 3871000, "b9b7c812a732721c427e208c54fbb71ca17a2ee1", "cbc4fc72c4a646d8822bf7369c2101d4d5d1ff98", "34c87e11bba426fe97bfe23ccff12eda477c8f57");
- public static final MavenObject JETTY = new MavenObject("Jetty", "org/eclipse/jetty/aggregate", "jetty-all", "7.2.2.v20101205", "b9b7c812a732721c427e208c54fbb71ca17a2ee1");
+ public static final MavenObject SERVLET = new MavenObject("Servlet 2.5", "javax/servlet", "servlet-api", "2.5", 105000, 158000, 0, "5959582d97d8b61f4d154ca9e495aafd16726e34", "021599814ad9a605b86f3e6381571beccd861a32", null);
- public static final MavenObject SERVLET = new MavenObject("Servlet 2.5", "javax/servlet", "servlet-api", "2.5", "5959582d97d8b61f4d154ca9e495aafd16726e34");
+ public static final MavenObject SLF4JAPI = new MavenObject("SLF4J API", "org/slf4j", "slf4j-api", "1.6.1", 25500, 45000, 182000, "6f3b8a24bf970f17289b234284c94f43eb42f0e4", "46a386136c901748e6a3af67ebde6c22bc6b4524", "e223571d77769cdafde59040da235842f3326453");
- public static final MavenObject SLF4JAPI = new MavenObject("SLF4J API", "org/slf4j", "slf4j-api", "1.6.1", "6f3b8a24bf970f17289b234284c94f43eb42f0e4");
+ public static final MavenObject SLF4LOG4J = new MavenObject("SLF4J LOG4J", "org/slf4j", "slf4j-log4j12", "1.6.1", 9800, 9500, 52400, "bd245d6746cdd4e6203e976e21d597a46f115802", "7a26b08b265f55622fa1fed3bda68bbd37a465ba", "6e4b16bce7994e3692e82002f322a0dd2f32741e");
- public static final MavenObject SLF4LOG4J = new MavenObject("SLF4J LOG4J", "org/slf4j", "slf4j-log4j12", "1.6.1", "bd245d6746cdd4e6203e976e21d597a46f115802");
+ public static final MavenObject LOG4J = new MavenObject("Apache LOG4J", "log4j", "log4j", "1.2.16", 481000, 471000, 1455000, "7999a63bfccbc7c247a9aea10d83d4272bd492c6", "bf945d1dc995be7fe64923625f842fbb6bf443be", "78aa1cbf0fa3b259abdc7d87f9f6788d785aac2a");
- public static final MavenObject LOG4J = new MavenObject("Apache LOG4J", "log4j", "log4j", "1.2.16", "7999a63bfccbc7c247a9aea10d83d4272bd492c6");
+ public static final MavenObject WICKET = new MavenObject("Apache Wicket", "org/apache/wicket", "wicket", "1.4.17", 1960000, 1906000, 6818000, "39815e37a6f56465b2d2c3d3017c4f3bf17db50a", "a792ebae4123253ffd039c3be49e773f8622f94e", "f2f244ca72d10081529b017e89d6276eab62c621");
- public static final MavenObject WICKET = new MavenObject("Apache Wicket", "org/apache/wicket", "wicket", "1.4.17", "39815e37a6f56465b2d2c3d3017c4f3bf17db50a");
+ public static final MavenObject WICKET_EXT = new MavenObject("Apache Wicket Extensions", "org/apache/wicket", "wicket-extensions", "1.4.17", 1180000, 1118000, 1458000, "01111d0dbffdc425581b006a43864c22797ce72a", "f194f40ea6e361bb745dfa22e2f9171eb63a9355", "bd42e5ba9444a426bb2d7cacce91c6033b663b57");
- public static final MavenObject WICKET_EXT = new MavenObject("Apache Wicket Extensions", "org/apache/wicket", "wicket-extensions", "1.4.17", "01111d0dbffdc425581b006a43864c22797ce72a");
+ public static final MavenObject WICKET_AUTH_ROLES = new MavenObject("Apache Wicket Auth Roles", "org/apache/wicket", "wicket-auth-roles", "1.4.17", 44000, 45000, 166000, "86d20ff32f62d3026213ff11a78555da643bc676", "37e815350a2d6b97734b250a8a03d8bf3712bba7", "ac3896368bfb372d178041a4ac3ee2c44f62e21c");
- public static final MavenObject WICKET_AUTH_ROLES = new MavenObject("Apache Wicket Auth Roles", "org/apache/wicket", "wicket-auth-roles", "1.4.17", "86d20ff32f62d3026213ff11a78555da643bc676");
+ public static final MavenObject WICKET_GOOGLE_CHARTS = new MavenObject("Apache Wicket Google Charts Add-On", "org/wicketstuff", "googlecharts", "1.4.17", 34000, 18750, 161000, "c567b98b0c5efe4147e77ef2d0d3c2d45c49dea5", "3d32d958b2f7aa58388af5701ea3aafc433e573f", "c37518b67ea85af485dd61fe854137eeacc50318");
- public static final MavenObject WICKET_GOOGLE_CHARTS = new MavenObject("Apache Wicket Google Charts Add-On", "org/wicketstuff", "googlecharts", "1.4.17", "c567b98b0c5efe4147e77ef2d0d3c2d45c49dea5");
+ public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "3.8.2", 120000, 0, 0, "07e4cde26b53a9a0e3fe5b00d1dbbc7cc1d46060", "", "");
- public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "3.8.2", "07e4cde26b53a9a0e3fe5b00d1dbbc7cc1d46060");
+ public static final MavenObject MARKDOWNPAPERS = new MavenObject("MarkdownPapers", "org/tautua/markdownpapers", "markdownpapers-core", "1.0.0", 87000, 58000, 278000, "feda63bd149f3315da210e397d45d02277038ad5", "a9a6c4d163af81e265a15138fcaeafa9829c6054", "f932656266a7f9593488d3f89e815d0af44d0853");
+
+ public static final MavenObject BOUNCYCASTLE = new MavenObject("BouncyCastle", "org/bouncycastle", "bcprov-jdk16", "1.46", 1900000, 1400000, 4670000, "ce091790943599535cbb4de8ede84535b0c1260c", "d2b70567594225923450d7e3f80cd022c852725e", "873a6fe765f33fc27df498a5d1f5bf077e503b2f");
- public static final MavenObject MARKDOWNPAPERS = new MavenObject("MarkdownPapers", "org/tautua/markdownpapers", "markdownpapers-core", "1.0.0", "feda63bd149f3315da210e397d45d02277038ad5");
+ public static final MavenObject JGIT = new MavenObject("JGit", "org/eclipse/jgit", "org.eclipse.jgit", "0.12.1", 1318000, 1354000, 2993000, "fd77699699b9651d2fc31c7ed63af98b14fc1975", "c8b3d84922c7802cfe6a661e13a002641a78583d", "5609aa3ce3ac3d52030befd27ddd2941f6c07570");
+
+ public static final MavenObject JGIT_HTTP = new MavenObject("JGit", "org/eclipse/jgit", "org.eclipse.jgit.http.server", "0.12.1", 68000, 62000, 99000, "384058ca906dffb8b8708c2db8849c9754359b28", "7b026658ed8de2eccc2d11d647d43d7c84a56911", "6c19e37b3caafd70c1b7b024ae1858c725181688");
public final String name;
public final String group;
public final String artifact;
public final String version;
- public final String sha1;
+ public final int len_library;
+ public final int len_sources;
+ public final int len_javadoc;
+ public final String sha1_library;
+ public final String sha1_sources;
+ public final String sha1_javadoc;
- private MavenObject(String name, String group, String artifact, String version, String sha1) {
+ private MavenObject(String name, String group, String artifact, String version, int len_library, int len_sources, int len_javadoc, String sha1_library, String sha1_sources, String sha1_javadoc) {
this.name = name;
this.group = group;
this.artifact = artifact;
this.version = version;
- this.sha1 = sha1;
+ this.len_library = len_library;
+ this.len_sources = len_sources;
+ this.len_javadoc = len_javadoc;
+ this.sha1_library = sha1_library;
+ this.sha1_sources = sha1_sources;
+ this.sha1_javadoc = sha1_javadoc;
+ }
+
+ private String getRepositoryPath(String jar) {
+ return group + "/" + artifact + "/" + version + "/" + artifact + "-" + version + jar + ".jar";
}
- private String getRepositoryPath() {
- return group + "/" + artifact + "/" + version + "/" + artifact + "-" + version + ".jar";
+ private File getLocalFile(String basePath, String jar) {
+ return new File(basePath, artifact + "-" + version + jar + ".jar");
}
- private File getLocalFile(String basePath) {
- return new File(basePath, artifact + "-" + version + ".jar");
+ private String getSHA1(String jar) {
+ if (jar.equals("")) {
+ return sha1_library;
+ } else if (jar.equals("-sources")) {
+ return sha1_sources;
+ } else if (jar.equals("-javadoc")) {
+ return sha1_javadoc;
+ }
+ return sha1_library;
+ }
+
+ private int getApproximateLength(String jar) {
+ if (jar.equals("")) {
+ return len_library;
+ } else if (jar.equals("-sources")) {
+ return len_sources;
+ } else if (jar.equals("-javadoc")) {
+ return len_javadoc;
+ }
+ return len_library;
}
@Override
diff --git a/src/com/gitblit/Constants.java b/src/com/gitblit/Constants.java
index 4ad46636..38f2e7db 100644
--- a/src/com/gitblit/Constants.java
+++ b/src/com/gitblit/Constants.java
@@ -19,7 +19,7 @@ public class Constants {
}
public static String getJGitVersion() {
- return "JGit 0.12-stable";
+ return "JGit 0.12.1";
}
public static String getRunningVersion() {
diff --git a/src/com/gitblit/FileSettings.java b/src/com/gitblit/FileSettings.java
index 371b7348..5cf54a7b 100644
--- a/src/com/gitblit/FileSettings.java
+++ b/src/com/gitblit/FileSettings.java
@@ -138,6 +138,6 @@ public class FileSettings implements IStoredSettings {
@Override
public String toString() {
- return getClass().getSimpleName() + ": " + new File(Constants.PROPERTIES_FILE).getAbsolutePath();
+ return new File(Constants.PROPERTIES_FILE).getAbsolutePath();
}
}
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index 32ee73c4..c633f6e9 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -137,6 +137,7 @@ public class GitBlit implements ServletContextListener {
model.useTickets = config.getBoolean("gitblit", "useTickets", false);
model.useDocs = config.getBoolean("gitblit", "useDocs", false);
model.useRestrictedAccess = config.getBoolean("gitblit", "restrictedAccess", false);
+ model.showRemoteBranches = config.getBoolean("gitblit", "showRemoteBranches", false);
}
r.close();
return model;
@@ -170,6 +171,7 @@ public class GitBlit implements ServletContextListener {
config.setBoolean("gitblit", null, "useTickets", repository.useTickets);
config.setBoolean("gitblit", null, "useDocs", repository.useDocs);
config.setBoolean("gitblit", null, "restrictedAccess", repository.useRestrictedAccess);
+ config.setBoolean("gitblit", null, "showRemoteBranches", repository.showRemoteBranches);
try {
config.save();
} catch (IOException e) {
@@ -178,8 +180,8 @@ public class GitBlit implements ServletContextListener {
r.close();
}
- public void setupContext(IStoredSettings settings) {
- logger.info("Setting up GitBlit context from " + settings.toString());
+ public void configureContext(IStoredSettings settings) {
+ logger.info("Configure GitBlit from " + settings.toString());
this.storedSettings = settings;
repositoriesFolder = new File(settings.getString(Keys.git.repositoriesFolder, "repos"));
exportAll = settings.getBoolean(Keys.git.exportAll, true);
@@ -188,12 +190,9 @@ public class GitBlit implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent contextEvent) {
- logger.info("GitBlit context initialization by servlet container...");
if (storedSettings == null) {
WebXmlSettings webxmlSettings = new WebXmlSettings(contextEvent.getServletContext());
- setupContext(webxmlSettings);
- } else {
- logger.info("GitBlit context already setup by " + storedSettings.toString());
+ configureContext(webxmlSettings);
}
}
diff --git a/src/com/gitblit/GitBlitServer.java b/src/com/gitblit/GitBlitServer.java
index a82b595f..9a9f63e2 100644
--- a/src/com/gitblit/GitBlitServer.java
+++ b/src/com/gitblit/GitBlitServer.java
@@ -110,7 +110,23 @@ public class GitBlitServer {
* Start Server.
*/
private static void start(Params params) {
- PatternLayout layout = new PatternLayout(fileSettings.getString(Keys.server.log4jPattern, "%-5p %d{MM-dd HH:mm:ss.SSS} %-20.20c{1} %m%n"));
+ String pattern = fileSettings.getString(Keys.server.log4jPattern, "%-5p %d{MM-dd HH:mm:ss.SSS} %-20.20c{1} %m%n");
+
+ // allow os override of logging pattern
+ String os = System.getProperty("os.name").toLowerCase();
+ if (os.indexOf("windows") > -1) {
+ String winPattern = fileSettings.getString(Keys.server.log4jPattern_windows, pattern);
+ if (!StringUtils.isEmpty(winPattern)) {
+ pattern = winPattern;
+ }
+ } else if (os.indexOf("linux") > -1) {
+ String linuxPattern = fileSettings.getString(Keys.server.log4jPattern_linux, pattern);
+ if (!StringUtils.isEmpty(linuxPattern)) {
+ pattern = linuxPattern;
+ }
+ }
+
+ PatternLayout layout = new PatternLayout(pattern);
org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger.getRootLogger();
rootLogger.addAppender(new ConsoleAppender(layout));
@@ -244,7 +260,7 @@ public class GitBlitServer {
// Setup the GitBlit context
GitBlit gitblit = GitBlit.self();
- gitblit.setupContext(fileSettings);
+ gitblit.configureContext(fileSettings);
rootContext.addEventListener(gitblit);
// Start the Server
diff --git a/src/com/gitblit/Launcher.java b/src/com/gitblit/Launcher.java
index a55056d5..3173dc33 100644
--- a/src/com/gitblit/Launcher.java
+++ b/src/com/gitblit/Launcher.java
@@ -101,6 +101,10 @@ public class Launcher {
* @throws IOException
*/
public static void addJarFile(File f) throws IOException {
+ if (f.getName().indexOf("-sources") > -1 || f.getName().indexOf("-javadoc") > -1) {
+ // don't add source or javadoc jars to runtime classpath
+ return;
+ }
URL u = f.toURI().toURL();
if (debug)
System.out.println("load=" + u.toExternalForm());
diff --git a/src/com/gitblit/WebXmlSettings.java b/src/com/gitblit/WebXmlSettings.java
index 00084bf6..03e2a922 100644
--- a/src/com/gitblit/WebXmlSettings.java
+++ b/src/com/gitblit/WebXmlSettings.java
@@ -60,6 +60,6 @@ public class WebXmlSettings implements IStoredSettings {
@Override
public String toString() {
- return getClass().getSimpleName() + ": web.xml";
+ return "WEB.XML";
}
}
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index 71fa20e1..f86596d5 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -63,12 +63,6 @@ import com.gitblit.wicket.models.TicketModel.Comment;
public class JGitUtils {
- /** Prefix for notes refs */
- public static final String R_NOTES = "refs/notes/";
-
- /** Standard notes ref */
- public static final String R_NOTES_COMMITS = R_NOTES + "commits";
-
private final static Logger LOGGER = LoggerFactory.getLogger(JGitUtils.class);
public static Repository createRepository(File repositoriesFolder, String name, boolean bare) {
diff --git a/src/com/gitblit/utils/MarkdownUtils.java b/src/com/gitblit/utils/MarkdownUtils.java
new file mode 100644
index 00000000..6cdb3bea
--- /dev/null
+++ b/src/com/gitblit/utils/MarkdownUtils.java
@@ -0,0 +1,53 @@
+package com.gitblit.utils;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import org.tautua.markdownpapers.Markdown;
+import org.tautua.markdownpapers.parser.ParseException;
+
+public class MarkdownUtils {
+
+ public static String transformMarkdown(String markdown) throws java.text.ParseException {
+ // Read raw markdown content and transform it to html
+ StringReader reader = new StringReader(markdown);
+ StringWriter writer = new StringWriter();
+ try {
+ Markdown md = new Markdown();
+ md.transform(reader, writer);
+ return writer.toString();
+ } catch (ParseException p) {
+ throw new java.text.ParseException(p.getMessage(), 0);
+ } finally {
+ reader.close();
+ try {
+ writer.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+
+ public static String transformMarkdown(Reader markdownReader) throws java.text.ParseException {
+ // Read raw markdown content and transform it to html
+ StringWriter writer = new StringWriter();
+ try {
+ Markdown md = new Markdown();
+ md.transform(markdownReader, writer);
+ return writer.toString();
+ } catch (ParseException p) {
+ throw new java.text.ParseException(p.getMessage(), 0);
+ } finally {
+ try {
+ markdownReader.close();
+ } catch (IOException e) {
+ }
+ try {
+ writer.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+
+}
diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java
index d52be0e4..ff47a51e 100644
--- a/src/com/gitblit/utils/StringUtils.java
+++ b/src/com/gitblit/utils/StringUtils.java
@@ -1,16 +1,10 @@
package com.gitblit.utils;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
-import org.tautua.markdownpapers.Markdown;
-import org.tautua.markdownpapers.parser.ParseException;
public class StringUtils {
@@ -113,44 +107,4 @@ public class StringUtils {
throw new RuntimeException(t);
}
}
-
- public static String transformMarkdown(String markdown) throws java.text.ParseException {
- // Read raw markdown content and transform it to html
- StringReader reader = new StringReader(markdown);
- StringWriter writer = new StringWriter();
- try {
- Markdown md = new Markdown();
- md.transform(reader, writer);
- return writer.toString();
- } catch (ParseException p) {
- throw new java.text.ParseException(p.getMessage(), 0);
- } finally {
- reader.close();
- try {
- writer.close();
- } catch (IOException e) {
- }
- }
- }
-
- public static String transformMarkdown(Reader markdownReader) throws java.text.ParseException {
- // Read raw markdown content and transform it to html
- StringWriter writer = new StringWriter();
- try {
- Markdown md = new Markdown();
- md.transform(markdownReader, writer);
- return writer.toString();
- } catch (ParseException p) {
- throw new java.text.ParseException(p.getMessage(), 0);
- } finally {
- try {
- markdownReader.close();
- } catch (IOException e) {
- }
- try {
- writer.close();
- } catch (IOException e) {
- }
- }
- }
}
diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties
index 17bbdecb..39bdd29b 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp.properties
@@ -76,4 +76,5 @@ gb.group = group
gb.description = description
gb.enableTickets = enable tickets
gb.enableDocs = enable docs
-gb.save = save \ No newline at end of file
+gb.save = save
+gb.showRemoteBranches = show remote branches \ No newline at end of file
diff --git a/src/com/gitblit/wicket/models/RepositoryModel.java b/src/com/gitblit/wicket/models/RepositoryModel.java
index 8efa58dc..d21cff61 100644
--- a/src/com/gitblit/wicket/models/RepositoryModel.java
+++ b/src/com/gitblit/wicket/models/RepositoryModel.java
@@ -12,6 +12,7 @@ public class RepositoryModel implements Serializable {
public String group;
public Date lastChange;
public boolean hasCommits;
+ public boolean showRemoteBranches;
public boolean useTickets;
public boolean useDocs;
public boolean useRestrictedAccess;
diff --git a/src/com/gitblit/wicket/pages/BranchesPage.java b/src/com/gitblit/wicket/pages/BranchesPage.java
index 49088f0d..928765c3 100644
--- a/src/com/gitblit/wicket/pages/BranchesPage.java
+++ b/src/com/gitblit/wicket/pages/BranchesPage.java
@@ -10,7 +10,7 @@ public class BranchesPage extends RepositoryPage {
public BranchesPage(PageParameters params) {
super(params);
- add(new BranchesPanel("branchesPanel", repositoryName, getRepository(), -1));
+ add(new BranchesPanel("branchesPanel", getRepositoryModel(), getRepository(), -1));
}
@Override
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.html b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
index 6c622455..bc965e7a 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.html
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
@@ -21,7 +21,8 @@
<tr><th><wicket:message key="gb.group"></wicket:message></th><td class="edit"><input type="text" wicket:id="group" size="30" tabindex="4" /></td></tr>
<tr><th><wicket:message key="gb.enableTickets"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useTickets" tabindex="5" /> &nbsp;<i>distributed Ticgit issues</i></td></tr>
<tr><th><wicket:message key="gb.enableDocs"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useDocs" tabindex="6" /> &nbsp;<i>enumerates repository Markdown documentation</i></td></tr>
- <tr><td class="edit" colspan="2"><input type="submit" value="Save" wicket:message="value:gb.save" tabindex="7" /></td></tr>
+ <tr><th><wicket:message key="gb.showRemoteBranches"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="showRemoteBranches" tabindex="7" /> &nbsp;<i>show remote branches</i></td></tr>
+ <tr><td class="edit" colspan="2"><input type="submit" value="Save" wicket:message="value:gb.save" tabindex="8" /></td></tr>
</tbody>
</table>
</form>
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
index 45fe9e2e..6bf16599 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
@@ -67,6 +67,7 @@ public class EditRepositoryPage extends BasePage {
form.add(new TextField<String>("group"));
form.add(new CheckBox("useTickets"));
form.add(new CheckBox("useDocs"));
+ form.add(new CheckBox("showRemoteBranches"));
add(form);
}
diff --git a/src/com/gitblit/wicket/pages/MarkdownPage.java b/src/com/gitblit/wicket/pages/MarkdownPage.java
index 64d3ce3f..81e53f55 100644
--- a/src/com/gitblit/wicket/pages/MarkdownPage.java
+++ b/src/com/gitblit/wicket/pages/MarkdownPage.java
@@ -10,7 +10,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import com.gitblit.utils.JGitUtils;
-import com.gitblit.utils.StringUtils;
+import com.gitblit.utils.MarkdownUtils;
import com.gitblit.wicket.RepositoryPage;
import com.gitblit.wicket.WicketUtils;
@@ -34,7 +34,7 @@ public class MarkdownPage extends RepositoryPage {
String markdownText = JGitUtils.getRawContentAsString(r, commit, markdownPath);
String htmlText;
try {
- htmlText = StringUtils.transformMarkdown(markdownText);
+ htmlText = MarkdownUtils.transformMarkdown(markdownText);
} catch (ParseException p) {
error(p.getMessage());
htmlText = markdownText;
diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.java b/src/com/gitblit/wicket/pages/RepositoriesPage.java
index 2edb3e8c..111084c3 100644
--- a/src/com/gitblit/wicket/pages/RepositoriesPage.java
+++ b/src/com/gitblit/wicket/pages/RepositoriesPage.java
@@ -25,6 +25,7 @@ import org.apache.wicket.resource.ContextRelativeResource;
import com.gitblit.GitBlit;
import com.gitblit.Keys;
+import com.gitblit.utils.MarkdownUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.utils.TimeUtils;
import com.gitblit.wicket.BasePage;
@@ -68,7 +69,7 @@ public class RepositoriesPage extends BasePage {
ContextRelativeResource res = WicketUtils.getResource("welcome.mkd");
InputStream is = res.getResourceStream().getInputStream();
InputStreamReader reader = new InputStreamReader(is);
- message = StringUtils.transformMarkdown(reader);
+ message = MarkdownUtils.transformMarkdown(reader);
} catch (Throwable t) {
message = "Failed to read default welcome message!";
error(message, t, false);
@@ -80,7 +81,7 @@ public class RepositoriesPage extends BasePage {
if (file.exists()) {
try {
FileReader reader = new FileReader(file);
- message = StringUtils.transformMarkdown(reader);
+ message = MarkdownUtils.transformMarkdown(reader);
} catch (Throwable t) {
message = "Failed to read " + file;
error(message, t, false);
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java
index 78a58f77..c0193dbe 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.java
+++ b/src/com/gitblit/wicket/pages/SummaryPage.java
@@ -70,7 +70,7 @@ public class SummaryPage extends RepositoryPage {
add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));
add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs));
- add(new BranchesPanel("branchesPanel", repositoryName, r, numberRefs));
+ add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs));
// Display an activity line graph
insertActivityGraph(metrics);
diff --git a/src/com/gitblit/wicket/panels/BranchesPanel.java b/src/com/gitblit/wicket/panels/BranchesPanel.java
index ff4679f5..aff28ec8 100644
--- a/src/com/gitblit/wicket/panels/BranchesPanel.java
+++ b/src/com/gitblit/wicket/panels/BranchesPanel.java
@@ -18,6 +18,7 @@ import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.LinkPanel;
import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.models.RefModel;
+import com.gitblit.wicket.models.RepositoryModel;
import com.gitblit.wicket.pages.BranchesPage;
import com.gitblit.wicket.pages.LogPage;
import com.gitblit.wicket.pages.SummaryPage;
@@ -27,13 +28,15 @@ public class BranchesPanel extends BasePanel {
private static final long serialVersionUID = 1L;
- public BranchesPanel(String wicketId, final String repositoryName, Repository r, final int maxCount) {
+ public BranchesPanel(String wicketId, final RepositoryModel model, Repository r, final int maxCount) {
super(wicketId);
// branches
List<RefModel> branches = new ArrayList<RefModel>();
branches.addAll(JGitUtils.getLocalBranches(r, maxCount));
- branches.addAll(JGitUtils.getRemoteBranches(r, maxCount));
+ if (model.showRemoteBranches) {
+ branches.addAll(JGitUtils.getRemoteBranches(r, maxCount));
+ }
Collections.sort(branches);
Collections.reverse(branches);
if (maxCount > 0 && branches.size() > maxCount) {
@@ -43,11 +46,11 @@ public class BranchesPanel extends BasePanel {
if (maxCount > 0) {
// summary page
// show branches page link
- add(new LinkPanel("branches", "title", new StringResourceModel("gb.branches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
+ add(new LinkPanel("branches", "title", new StringResourceModel("gb.branches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(model.name)));
} else {
// branches page
// show repository summary page link
- add(new LinkPanel("branches", "title", repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
+ add(new LinkPanel("branches", "title", model.name, SummaryPage.class, WicketUtils.newRepositoryParameter(model.name)));
}
ListDataProvider<RefModel> branchesDp = new ListDataProvider<RefModel>(branches);
@@ -60,14 +63,14 @@ public class BranchesPanel extends BasePanel {
item.add(WicketUtils.createDateLabel("branchDate", entry.getDate(), getTimeZone()));
- item.add(new LinkPanel("branchName", "list name", StringUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));
+ item.add(new LinkPanel("branchName", "list name", StringUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newObjectParameter(model.name, entry.getName())));
// only show branch type on the branches page
boolean remote = entry.getName().startsWith(Constants.R_REMOTES);
item.add(new Label("branchType", remote ? getString("gb.remote") : getString("gb.local")).setVisible(maxCount <= 0));
- item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));
- item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));
+ item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newObjectParameter(model.name, entry.getName())));
+ item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newObjectParameter(model.name, entry.getName())));
WicketUtils.setAlternatingBackground(item, counter);
counter++;
@@ -77,7 +80,7 @@ public class BranchesPanel extends BasePanel {
if (branches.size() < maxCount || maxCount <= 0) {
add(new Label("allBranches", "").setVisible(false));
} else {
- add(new LinkPanel("allBranches", "link", new StringResourceModel("gb.allBranches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
+ add(new LinkPanel("allBranches", "link", new StringResourceModel("gb.allBranches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(model.name)));
}
}
}
diff --git a/src/com/gitblit/wicket/resources/welcome.mkd b/src/com/gitblit/wicket/resources/welcome.mkd
index 7f744068..a9248acb 100644
--- a/src/com/gitblit/wicket/resources/welcome.mkd
+++ b/src/com/gitblit/wicket/resources/welcome.mkd
@@ -1,5 +1,5 @@
-## Welcome to Git:Blit ##
+## Welcome to Git:Blit
-A quick and easy way to host your own Git repositories.
+A quick and easy way to host or view your own Git repositories.
-Built with [JGit](http://eclipse.org/jgit), [Wicket](http://wicket.apache.org), [WicketStuff GoogleCharts](https://github.com/wicketstuff/core/wiki/GoogleCharts), [markitup](http://markitup.jaysalvat.com), [MarkdownPapers](http://markdown.tautua.org), [Jetty](http://eclipse.org/jetty), [SLF4J](http://www.slf4j.org), [Log4j](http://logging.apache.org/log4j), [google-code-prettify](http://code.google.com/p/google-code-prettify), [JCommander](http://jcommander.org), Most icons courtesy of [FatCow Hosting](http://www.fatcow.com/free-icons) \ No newline at end of file
+Built with [JGit](http://eclipse.org/jgit), [Wicket](http://wicket.apache.org), [WicketStuff GoogleCharts](https://github.com/wicketstuff/core/wiki/GoogleCharts), [MarkdownPapers](http://markdown.tautua.org), [Jetty](http://eclipse.org/jetty), [SLF4J](http://www.slf4j.org), [Log4j](http://logging.apache.org/log4j), [google-code-prettify](http://code.google.com/p/google-code-prettify), [JCommander](http://jcommander.org), [BouncyCastle](http://www.bouncycastle.org), [JavaService](http://forge.ow2.org/projects/javaservice), and most icons courtesy of [FatCow Hosting](http://www.fatcow.com/free-icons) \ No newline at end of file