[sysadmin-bin: 43/168] Include more of the Git subject in the Subject:



commit a4e50e28134fafe8e3d1a848301cd990bfa8fa95
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Mar 16 18:14:04 2009 -0400

    Include more of the Git subject in the Subject:
    
    Include up to 100 characters of the git subject in the Subject:
    line rather than truncating at 50. This should provide a good balance
    between preserving legitimate subjects and not going completely
    crazy if someone has a paragraph for a subject.

 gnome-post-receive-email |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gnome-post-receive-email b/gnome-post-receive-email
index e5f8387..55f9ff7 100755
--- a/gnome-post-receive-email
+++ b/gnome-post-receive-email
@@ -332,6 +332,9 @@ def end_email():
 
 ######################################################################
 
+# When we put a git subject into the Subject: line, where to truncate
+SUBJECT_MAX_SUBJECT_CHARS = 100
+
 CREATE = 0
 UPDATE = 1
 DELETE = 2
@@ -607,7 +610,7 @@ class BranchChange(RefChange):
                 'projectshort' : projectshort,
                 'branch' : branch,
                 'count_string' : count_string,
-                'subject' : commit.subject[0:50]
+                'subject' : commit.subject[0:SUBJECT_MAX_SUBJECT_CHARS]
                 }
 
             # If there is a cover email, it has the X-Git-OldRev/X-Git-NewRev in it
@@ -676,10 +679,10 @@ class BranchUpdate(BranchChange):
             #
             last_commit = self.added_commits[-1]
             if len(self.added_commits) > 1:
-                return self.get_count_string() + "..." + last_commit.subject[0:50]
+                return self.get_count_string() + "..." + last_commit.subject[0:SUBJECT_MAX_SUBJECT_CHARS]
             else:
                 # The ... indicates we are only showing one of many, don't need it for a single commit
-                return last_commit.subject[0:50]
+                return last_commit.subject[0:SUBJECT_MAX_SUBJECT_CHARS]
 
     def generate_body_normal(self, out):
         print >>out, s("""



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]