shithub: git9

Download patch

ref: 9ed1de787575844337635c56902006622c6856e1
parent: 90d3000296c6dbc5b6c77d86805e6576dfb5e7ef
author: kvik <kvik@a-b.xyz>
date: Sat Feb 15 10:07:10 EST 2020

Tidy up the commit comment construction

--- a/commit
+++ b/commit
@@ -40,14 +40,15 @@
 }
 
 fn editmsg{
-	echo '# Author: '$"name' <'$"email'>' >> $msgfile.tmp
-	echo '#' >> $msgfile.tmp
-	for(p in $parents)
-		echo '# parent: '$p >> $msgfile.tmp
-	for(m in `$nl{git/walk -fAMR $files})
-		echo '# '$m  >> $msgfile.tmp
-	echo '#' >> $msgfile.tmp
-	echo '# Commit message:' >> $msgfile.tmp
+	>$msgfile.tmp {
+		echo '# Author:' $name '<'$email'>'
+		echo '#'
+		for(p in $parents)
+			echo '# parent:' $p
+		git/walk -fAMR | sed 's/^/# /g'
+		echo '#'
+		echo '# Commit message:'
+	}
 	giteditor=`{git/conf core.editor}
 	if(~ $#editor 0)
 		editor=$giteditor