Re: "git revert" (Re: pci_update_resource() getting called on sparc64)
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 9, 2005, 00:03 UTC
- Message-ID
- <Pine.LNX.4.63.0508090202140.3860@wgmdd8.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7vd5oo11wj.fsf@assigned-by-dhcp.cox.net>
Hi,
On Mon, 8 Aug 2005, Junio C Hamano wrote:
Show 11 quoted lines
> Linus Torvalds <torvalds@osdl.org> writes: > > > Or if you want to be more CVS-like, use "-F", and accept "-" for stdin? > > Yes my vote goes: > > -m "message" > -c "from this commit, literally." > -C "from this commit, but let me edit the log further." > -F "from this file." > -F - <stdin
The royal penguin speaketh, and the little blue penguin gets a fish:
[PATCH] git commit usage is more like cvs's
Teach git-commit-script about different ways to provide a commit message, including the famous -m flag from CVS.
---
git-commit-script | 48 ++++++++++++++++++++++++++++++++++-------------- 1 files changed, 34 insertions(+), 14 deletions(-)
457d879496cb5f742ed6bccc9a435f414b0fd2a7
diff --git a/git-commit-script b/git-commit-script --- a/git-commit-script +++ b/git-commit-script @@ -6,20 +6,41 @@ . git-sh-setup-script || die "Not a git archive" usage () { - die 'git commit [--all] [-m existing-commit] [<path>...]' + die 'git commit [options] [<path>...] +Options: + --all automatically do a git-update-cache on all modified + files + -m <message> use this message in the commit + -c <commit> use the same message as in the given commit + -C <commit> as -c, but let me edit it + -F <file> take the message from file + -F - take the message from stdin' } files=() +call_editor=true +rm -f .editmsg || die "Could not write edit message" while case "$#" in 0) break ;; esac do case "$1" in + -m|-c|-C|-F) + [ "$#" -ne 1 ] || usage;; + esac + + case "$1" in -m) shift - case "$#" in - 0) usage ;; - *) use_commit=`git-rev-parse --verify "$1"` || - exit ;; - esac - ;; + call_editor="" + echo "$1" >> .editmsg;; + -c) shift + call_editor="" + use_commit=`git-rev-parse --verify "$1"` || + exit ;; + -C) shift + use_commit=`git-rev-parse --verify "$1"` || + exit ;; + -F) shift + call_editor="" + cat "$1" >> .editmsg;; --all) files=($(git-diff-files --name-only))\ ;; @@ -42,7 +63,7 @@ if [ ! -r "$GIT_DIR/HEAD" ]; then echo "#" git-ls-files | sed 's/^/# New file: /' echo "#" - ) > .editmsg + ) >> .editmsg PARENTS="" else if [ -f "$GIT_DIR/MERGE_HEAD" ]; then @@ -83,7 +104,7 @@ else export GIT_AUTHOR_DATE git-cat-file commit "$use_commit" | sed -e '1,/^$/d' - fi >.editmsg + fi >> .editmsg git-status-script >>.editmsg fi if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ] @@ -92,11 +113,10 @@ then rm .editmsg exit 1 fi -case "$use_commit" in -'') - ${VISUAL:-${EDITOR:-vi}} .editmsg - ;; -esac + +[ -z "$use_commit" -o "$call_editor" = true ] && +${VISUAL:-${EDITOR:-vi}} .editmsg + grep -v '^#' < .editmsg | git-stripspace > .cmitmsg [ -s .cmitmsg ] && tree=$(git-write-tree) &&