]> source.dussan.org Git - gitblit.git/commitdiff
Make activity page respect short commit id setting and lower default from 8 to 6
authorJames Moger <james.moger@gitblit.com>
Tue, 27 Nov 2012 21:58:14 +0000 (16:58 -0500)
committerJames Moger <james.moger@gitblit.com>
Tue, 27 Nov 2012 21:58:14 +0000 (16:58 -0500)
distrib/gitblit.properties
src/com/gitblit/wicket/pages/RepositoryPage.java
src/com/gitblit/wicket/panels/ActivityPanel.java

index 65e19ed42ebd694b37eeaca1956b2623dd2fd84a..b830bd57234d408d6fd2d257037bcb059c44774e 100644 (file)
@@ -494,7 +494,7 @@ web.allowLuceneIndexing = true
 # Controls the length of shortened commit hash ids\r
 #\r
 # SINCE 1.2.0\r
-web.shortCommitIdLength = 8\r
+web.shortCommitIdLength = 6\r
 \r
 # Use Clippy (Flash solution) to provide a copy-to-clipboard button.\r
 # If false, a button with a more primitive JavaScript-based prompt box will\r
index 0a3998509f9f07cbd6c036dd0386c4963dd78d1f..c90e35309d9d418f8ee3de49f5d60864fa77756a 100644 (file)
@@ -425,7 +425,7 @@ public abstract class RepositoryPage extends BasePage {
        }\r
 \r
        protected String getShortObjectId(String objectId) {\r
-               return objectId.substring(0, GitBlit.getInteger(Keys.web.shortCommitIdLength, 8));\r
+               return objectId.substring(0, GitBlit.getInteger(Keys.web.shortCommitIdLength, 6));\r
        }\r
 \r
        protected void addRefs(Repository r, RevCommit c) {\r
index 2e70a9a01f05553115274bd599ed76bd325c44a8..9a123d8e0c75283cf24556cbf46da05b1bfc215b 100644 (file)
@@ -24,6 +24,8 @@ import org.apache.wicket.markup.repeater.data.DataView;
 import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
 \r
 import com.gitblit.Constants;\r
+import com.gitblit.GitBlit;\r
+import com.gitblit.Keys;\r
 import com.gitblit.models.Activity;\r
 import com.gitblit.models.Activity.RepositoryCommit;\r
 import com.gitblit.utils.StringUtils;\r
@@ -50,6 +52,7 @@ public class ActivityPanel extends BasePanel {
 \r
                Collections.sort(recentActivity);\r
                \r
+               final int shortHashLen = GitBlit.getInteger(Keys.web.shortCommitIdLength, 6);\r
                DataView<Activity> activityView = new DataView<Activity>("activity",\r
                                new ListDataProvider<Activity>(recentActivity)) {\r
                        private static final long serialVersionUID = 1L;\r
@@ -105,7 +108,7 @@ public class ActivityPanel extends BasePanel {
                                                commitItem.add(branchLink);\r
 \r
                                                LinkPanel commitid = new LinkPanel("commitid", "list subject",\r
-                                                               commit.getShortName(), CommitPage.class,\r
+                                                               commit.getName().substring(0,  shortHashLen), CommitPage.class,\r
                                                                WicketUtils.newObjectParameter(commit.repository, commit.getName()), true);\r
                                                commitItem.add(commitid);\r
 \r