Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15

Re: [PATCH] display the subject of the commit just made

From: Michael S. Tsirkin <hidden>
Date: 2016-06-15 22:43:04

Possibly related (same subject, not in this thread)

Quoting Junio C Hamano [off-list ref]:
Subject: Re: [PATCH] display the subject of the commit just made

"Michael S. Tsirkin" [off-list ref] writes:
quoted
Better?
diff --git a/git-commit.sh b/git-commit.sh
index 9e0959a..32257b0 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -649,8 +649,9 @@ then
 	fi
 	if test -z "$quiet"
 	then
+		commit=`git-diff-tree --shortstat --pretty="format:%h: %s"\
+		       --summary --root HEAD --`
 		echo "Created${initial_commit:+ initial} commit $commit"
-		git-diff-tree --shortstat --summary --root --no-commit-id HEAD --
 	fi
 fi
Close but no cigar.  You broke it for a merge commit, I think.
Yes, you are right.
Perhaps

	pretty="format:Created${initial_commit:+ initial} commit %h: %s%n"
	git-diff-tree --always --shortstart --summary --root --pretty="$pretty" HEAD
Aha, --always should do the trick. I'll check this.
BTW, a couple of questions:
1. do we really need the shortstat info?
2. why is there "--" at the end do in the original version?

-- 
MST
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help