Re: [PATCH] display the subject of the commit just made
- From
- Michael S. Tsirkin <mst@dev.mellanox.co.il>
- Date
- Apr 16, 2007, 05:51 UTC
- Message-ID
- <20070416055111.GC23255@mellanox.co.il>
- In-Reply-To
- <7vwt0cx5jr.fsf@assigned-by-dhcp.cox.net>
Display the subject of the commit just made.
Useful e.g. to figure out what I did from screen history, or to make sure subject line is short enough and makes sense on its own.
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
---
Show 7 quoted lines
> Quoting Junio C Hamano <junkio@cox.net>:
> Close but no cigar. You broke it for a merge commit, I think.
>
> Perhaps
>
> pretty="format:Created${initial_commit:+ initial} commit %h: %s%n"
> git-diff-tree --always --shortstart --summary --root --pretty="$pretty" HEADOK, thanks fo rpointing this out. But why the extra %n at the end? The following seems to work well for me:
diff --git a/git-commit.sh b/git-commit.sh index 9e0959a..f28fc24 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -649,8 +649,9 @@ then fi if test -z "$quiet" then + commit=`git-diff-tree --always --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
-- MST