shithub: git9

Download patch

ref: 84c120a96312c5fdd73c3ae8f2cf7e0143e47206
parent: d90da7bc1a7f9815f131d4f2c28a206e234d1a46
author: Ori Bernstein <[email protected]>
date: Mon Jan 4 00:13:13 EST 2021

git/commit: change -a flag to -r

While '-a' works perfectly well to denote amending
a commmit in a vaccuum, unix users with muscle memory
may silently mangle their last commit. Using '-r' is
at least going to avoid that trap.

--- a/commit
+++ b/commit
@@ -75,7 +75,7 @@
 }
 
 fn parents{
-	if(! ~ $#amend 0)
+	if(! ~ $#revise 0)
 		parents=`{cat /mnt/git/HEAD/parent}
 	if not if(test -f .git/index9/merge-parents)
 		parents=`{cat .git/index9/merge-parents | sort | uniq}
@@ -118,7 +118,7 @@
 
 gitup
 
-flagfmt='m:msg message, a:amend'; args='file ...'
+flagfmt='m:msg message, r:revise'; args='file ...'
 eval `''{aux/getflags $*} || exec aux/usage
 if(~ $#* 0)
 	exec aux/usage
@@ -126,8 +126,9 @@
 msgfile=/tmp/git-msg.$pid
 if(~ $#msg 1)
 	echo $msg >$msgfile.tmp
-if not if(~ $#amend 1){
+if not if(~ $#revise 1){
 	msg=1
+	echo revising commit `{cat /mnt/git/HEAD/hash}
 	cat /mnt/git/HEAD/msg >$msgfile.tmp
 }
 
--- a/git.1.man
+++ b/git.1.man
@@ -36,7 +36,7 @@
 .PP
 .B git/commit
 [
-.B -a
+.B -r
 ]
 [
 .B -m msg
@@ -329,8 +329,8 @@
 .I -m
 supplies the commit message directly.
 The
-.I -a
-flag amends the contents of the previous commit, reusing the message.
+.I -r
+flag revises the contents of the previous commit, reusing the message.
 To a commit message,
 .I -a
 can be used in conjuction with