Diff of /post-receive-email [d9395b] .. [54f667] Maximize Restore

  Switch to side-by-side view

--- a/post-receive-email
+++ b/post-receive-email
@@ -1,6 +1,4 @@
 #!/bin/sh
-#
-# (Modified for SBCL.)
 #
 # Copyright (c) 2007 Andy Parkins
 #
@@ -174,11 +172,6 @@
 	if [ -z "$describe" ]; then
 		describe=$rev
 	fi
-	# SBCL: Also grab the commit title.
-	title=$(git log -n1 --pretty=format:%s $rev)
-	if [ -z "$title" ]; then
-	        title=$rev
-	fi
 
 	generate_email_header
 
@@ -201,24 +194,19 @@
 {
 	# --- Email (all stdout will be the email)
 	# Generate header
-
-        # SBCL: branch updates get the commit title in the subject
-        if [ "branch" = "$refname_type" ] && [ "update" = "$change_type" ]
-	then
-	    subject="${emailprefix} $short_refname: $title"
-        else
-	    subject="${emailprefix} $refname_type $short_refname: ${change_type}d. $describe"
-	fi
-
 	cat <<-EOF
 	To: $recipients
-	Subject: $subject
+	Subject: ${emailprefix}$projectdesc $refname_type, $short_refname, ${change_type}d. $describe
 	X-Git-Refname: $refname
 	X-Git-Reftype: $refname_type
 	X-Git-Oldrev: $oldrev
 	X-Git-Newrev: $newrev
 
-The $refname_type "$short_refname" has been ${change_type}d in $projectdesc:
+	This is an automated email from the git hooks/post-receive script. It was
+	generated because a ref change was pushed to the repository containing
+	the project "$projectdesc".
+
+	The $refname_type, $short_refname has been ${change_type}d
 	EOF
 }
 
@@ -348,8 +336,8 @@
 	# the base revision and then forward to the new revision
 	for rev in $(git rev-list $oldrev..$newrev)
 	do
-	    revtype=$(git cat-file -t "$rev")
-	    echo "       via  $rev ($revtype)"
+		revtype=$(git cat-file -t "$rev")
+		echo "       via  $rev ($revtype)"
 	done
 
 	if [ "$fast_forward" ]; then
@@ -400,13 +388,11 @@
 
 	echo ""
 	if [ -z "$rewind_only" ]; then
-	        # Silenced for SBCL.
-	        #
-		# echo "Those revisions listed above that are new to this repository have"
-		# echo "not appeared on any other notification email; so we list those"
-		# echo "revisions in full, below."
-		# echo ""
-
+		echo "Those revisions listed above that are new to this repository have"
+		echo "not appeared on any other notification email; so we list those"
+		echo "revisions in full, below."
+
+		echo ""
 		echo $LOGBEGIN
 		show_new_revisions
 
@@ -426,14 +412,9 @@
 	# point - the user will be interested in what this revision changed
 	# - including the undoing of previous revisions in the case of
 	# non-fast-forward updates.
-        #
-        # Silenced for SBCL: we use "git show -p --stat -C %s" to generate
-        # revision information, getting the diffstat between the commit message
-        # and the diff. This would just duplicate that.
-        #
-	# echo ""
-	# echo "Summary of changes:"
-	# git diff-tree --stat --summary --find-copies-harder $oldrev..$newrev
+	echo ""
+	echo "Summary of changes:"
+	git diff-tree --stat --summary --find-copies-harder $oldrev..$newrev
 }
 
 #
@@ -640,13 +621,12 @@
 
 	other_branches=$(git for-each-ref --format='%(refname)' refs/heads/ |
 	    grep -F -v $refname)
-	# SBCL: show oldest first via --reverse
 	git rev-parse --not $other_branches |
 	if [ -z "$custom_showrev" ]
 	then
-		git rev-list --reverse --pretty --stdin $revspec
+		git rev-list --pretty --stdin $revspec
 	else
-		git rev-list --reverse --stdin $revspec |
+		git rev-list --stdin $revspec |
 		while read onerev
 		do
 			eval $(printf "$custom_showrev" $onerev)
@@ -704,46 +684,6 @@
 else
 	while read oldrev newrev refname
 	do
-          echo "Sending mail for $refname: $oldrev -> $newrev"
-	  # SBCL KLUDGE: the default script sends one email per
-	  # push. We want one per commit. As long as we're
-	  # in fast-forward-only world, this should do the
-	  # right thing.
-	  if (expr "$oldrev" : '0*$' >/dev/null ||                  # create
-	      expr "$newrev" : '0*$' >/dev/null ||                  # delete
-              ! expr "$refname" : "refs/heads/" > /dev/null)        # not a branch
-	  then
-	      # Just one email.
-              echo "Not a branch update: all changes in one email."
-	      generate_email $oldrev $newrev $refname | send_mail
-	  else
-              # Get all revisions from old to new.
-              revlist=$(git rev-list --reverse $oldrev..$newrev)
-              no_merges=true
-              # Check for merges.
-              for rev in $revlist
-              do
-                  if ($no_merges && git rev-parse --verify --quiet "$rev"^2 > /dev/null)
-                  then
-                      echo "Merge detected: $rev. Sending all commits in a single email."
-                      no_merges=false
-                  fi
-              done
-              if $no_merges
-              then
-                  # Simple branch update, one mail per commit.
-                  echo "Sending one email per commit."
-	          lastrev=$oldrev
-	          for step in $revlist
-	          do
-                      echo "Sending: $(git log -n1 --oneline $step)"
-		      generate_email $lastrev $step $refname | send_mail
-		      lastrev=$step
-	          done
-              else
-                  # There's a merge -- just one email.
-	          generate_email $oldrev $newrev $refname | send_mail
-              fi
-	  fi
+		generate_email $oldrev $newrev $refname | send_mail
 	done
 fi