Commits

Sebastian Sdorra  committed 2fae90d Merge

merge with branch issue-474

  • Participants
  • Parent commits a7420cd, 0bf419b

Comments (0)

Files changed (4)

File scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitChangesetConverter.java

    *
    *
    * @param repository
-   * @param idLength
    */
   public GitChangesetConverter(org.eclipse.jgit.lib.Repository repository)
   {
    *
    * @param repository
    * @param revWalk
-   * @param idLength
    */
   public GitChangesetConverter(org.eclipse.jgit.lib.Repository repository,
     RevWalk revWalk)
     PersonIdent authorIndent = commit.getAuthorIdent();
     Person author = new Person(authorIndent.getName(),
                       authorIndent.getEmailAddress());
-    String message = commit.getShortMessage();
+    String message = commit.getFullMessage();
+
+    if (message != null)
+    {
+      message = message.trim();
+    }
+
     Changeset changeset = new Changeset(id, date, author, message);
 
     if (parentList != null)
 
     if (Util.isNotEmpty(tagCollection))
     {
+
       // create a copy of the tag collection to reduce memory on caching
       changeset.getTags().addAll(Lists.newArrayList(tagCollection));
     }

File scm-webapp/src/main/webapp/resources/js/override/ext.util.format.js

   
   id: function(value){
     return this.substr(value, 0, 12);
+  },
+  
+  convertLineBreaks: function(value){
+    if (value){
+      value = value.replace(/(\r\n|\n|\r)/gm, "<br />");
+    }
+    return value;
   }
   
 });

File scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.changesetviewergrid.js

       }
     }
     var description = record.data.description;
-    // if ( description ){
-    //  description = Ext.util.Format.htmlEncode(description);
-    // }
+    if ( description ){
+      //  description = Ext.util.Format.htmlEncode(description);
+      var index = description.indexOf('\n');
+      if ( index > 0 ){
+        description = description.substring(0, index) + " ...";
+      }
+    }
     var date = record.data.date;
     if ( date ){
       date = Ext.util.Format.formatTimestamp(date);

File scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.commitpanel.js

                        </div>\n\
                        <div class="left-content left-side">\n\
                         <h1>Commit {id}</h1>\n\
-                        <p>{description}</p>\n\
+                        <p>{description:convertLineBreaks}</p>\n\
                         <p>\n\
                           <tpl for="author">\n\
                             {name}<tpl if="mail"> &lt;<a href="mailto:{mail}">{mail}</a>&gt;</tpl>\n\