summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 92cf956)
raw | patch | inline | side by side (parent: 92cf956)
author | Nicolas Pitre <nico@cam.org> | |
Thu, 1 Feb 2007 17:31:26 +0000 (12:31 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 2 Feb 2007 05:36:47 +0000 (21:36 -0800) |
Those new messages are certainly nice, but there might be cases where
they are simply unwelcome, like when git-commit is used within scripts.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
they are simply unwelcome, like when git-commit is used within scripts.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-checkout.txt | patch | blob | history | |
git-checkout.sh | patch | blob | history |
index 4ea2b315d29957a4287d697bf50ab9cfea3a7ef1..55c9289438e65d62d960ac909f6481b178f1d80e 100644 (file)
SYNOPSIS
--------
[verse]
-'git-checkout' [-f] [-b <new_branch> [-l]] [-m] [<branch>]
+'git-checkout' [-q] [-f] [-b <new_branch> [-l]] [-m] [<branch>]
'git-checkout' [<tree-ish>] <paths>...
DESCRIPTION
OPTIONS
-------
+-q::
+ Quiet, supress feedback messages.
+
-f::
Force a re-read of everything.
diff --git a/git-checkout.sh b/git-checkout.sh
index 97c26adba9e876c40de487a23ae96c51dd0a7bc8..99a81f509a081481c9ab96bd6d0d39a6afec93e1 100755 (executable)
--- a/git-checkout.sh
+++ b/git-checkout.sh
#!/bin/sh
-USAGE='[-f] [-b <new_branch>] [-m] [<branch>] [<paths>...]'
+USAGE='[-q] [-f] [-b <new_branch>] [-m] [<branch>] [<paths>...]'
SUBDIRECTORY_OK=Sometimes
. git-sh-setup
require_work_tree
newbranch=
newbranch_log=
merge=
+quiet=
LF='
'
while [ "$#" != "0" ]; do
-m)
merge=1
;;
+ "-q")
+ quiet=1
+ ;;
--)
break
;;
if test -z "$branch$newbranch" && test "$new" != "$old"
then
detached="$new"
- if test -n "$oldbranch"
+ if test -n "$oldbranch" && test -z "$quiet"
then
detach_warn="Note: moving to \"$new_name\" which isn't a local branch
If you want to create a new branch from this checkout, you may do so
if [ "X$old" = X ]
then
- echo >&2 "warning: You appear to be on a branch yet to be born."
- echo >&2 "warning: Forcing checkout of $new_name."
+ if test -z "$quiet"
+ then
+ echo >&2 "warning: You appear to be on a branch yet to be born."
+ echo >&2 "warning: Forcing checkout of $new_name."
+ fi
force=1
fi
exit 0
)
saved_err=$?
- if test "$saved_err" = 0
+ if test "$saved_err" = 0 && test -z "$quiet"
then
git diff-index --name-status "$new"
fi
if test -n "$branch"
then
GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD "refs/heads/$branch"
- if test -n "$newbranch"
+ if test -z "$quiet"
then
- echo >&2 "Switched to a new branch \"$branch\""
- else
- echo >&2 "Switched to branch \"$branch\""
+ echo >&2 "Switched to${newbranch:+ a new} branch \"$branch\""
fi
elif test -n "$detached"
then