summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3afd169)
raw | patch | inline | side by side (parent: 3afd169)
author | Linus Torvalds <torvalds@osdl.org> | |
Fri, 18 Nov 2005 16:31:55 +0000 (08:31 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 18 Nov 2005 19:21:22 +0000 (11:21 -0800) |
When doing something like
git fetch --tags origin
the excessively verbose output of git fetch makes the result totally
unreadable. It's impossible to tell if it actually fetched anything new or
not, since the screen will fill up with an endless supply of
...
* committish: 9165ec17fde255a1770886189359897dbb541012
tag 'v0.99.7c' of master.kernel.org:/pub/scm/git/git
* refs/tags/v0.99.7c: same as tag 'v0.99.7c' of master.kernel.org:/pub/scm/git/git
...
and any new tags that got fetched will be totally hidden.
So add a new "--verbose" flag to "git fetch" to enable this verbose mode,
but make the default be quiet.
NOTE! The quiet mode will still report about new or changed heads, so if
you are really fetching a new head, you'll see something like this:
[torvalds@g5 git]$ git fetch --tags parent
Packing 6 objects
Unpacking 6 objects
100% (6/6) done
* refs/tags/v1.0rc2: storing tag 'v1.0rc2' of master.kernel.org:/pub/scm/git/git
* refs/tags/v1.0rc3: storing tag 'v1.0rc3' of master.kernel.org:/pub/scm/git/git
* refs/tags/v1.0rc1: storing tag 'v1.0rc1' of master.kernel.org:/pub/scm/git/git
which actually tells you something useful that isn't hidden by all the
useless crud that you already had.
Extensively tested (hey, for me, this _is_ extensive) by doing a
rm .git/refs/tags/v1.0rc*
and re-fetching with both --verbose and without.
NOTE! This means that if the fetch didn't actually fetch anything at all,
git fetch will be totally quiet. I think that's much better than being so
verbose that you can't even tell whether something was fetched or not, but
some people might prefer to get a "nothing to fetch" message in that case.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git fetch --tags origin
the excessively verbose output of git fetch makes the result totally
unreadable. It's impossible to tell if it actually fetched anything new or
not, since the screen will fill up with an endless supply of
...
* committish: 9165ec17fde255a1770886189359897dbb541012
tag 'v0.99.7c' of master.kernel.org:/pub/scm/git/git
* refs/tags/v0.99.7c: same as tag 'v0.99.7c' of master.kernel.org:/pub/scm/git/git
...
and any new tags that got fetched will be totally hidden.
So add a new "--verbose" flag to "git fetch" to enable this verbose mode,
but make the default be quiet.
NOTE! The quiet mode will still report about new or changed heads, so if
you are really fetching a new head, you'll see something like this:
[torvalds@g5 git]$ git fetch --tags parent
Packing 6 objects
Unpacking 6 objects
100% (6/6) done
* refs/tags/v1.0rc2: storing tag 'v1.0rc2' of master.kernel.org:/pub/scm/git/git
* refs/tags/v1.0rc3: storing tag 'v1.0rc3' of master.kernel.org:/pub/scm/git/git
* refs/tags/v1.0rc1: storing tag 'v1.0rc1' of master.kernel.org:/pub/scm/git/git
which actually tells you something useful that isn't hidden by all the
useless crud that you already had.
Extensively tested (hey, for me, this _is_ extensive) by doing a
rm .git/refs/tags/v1.0rc*
and re-fetching with both --verbose and without.
NOTE! This means that if the fetch didn't actually fetch anything at all,
git fetch will be totally quiet. I think that's much better than being so
verbose that you can't even tell whether something was fetched or not, but
some people might prefer to get a "nothing to fetch" message in that case.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-fetch.sh | patch | blob | history |
diff --git a/git-fetch.sh b/git-fetch.sh
index 8564cbfd7abaf0c5aff8d79d660f40b6747d25a0..6586e773e6b3979463d5cc6537e6ddc5700de25a 100755 (executable)
--- a/git-fetch.sh
+++ b/git-fetch.sh
tags=
append=
force=
+verbose=
update_head_ok=
while case "$#" in 0) break ;; esac
do
--update-head-o|--update-head-ok)
update_head_ok=t
;;
+ -v|--verbose)
+ verbose=Yes
+ ;;
*)
break
;;
then
headc_=$(git-rev-parse --verify "$head_^0") || exit
echo "$headc_ $not_for_merge_ $note_" >>"$GIT_DIR/FETCH_HEAD"
- echo >&2 "* committish: $head_"
- echo >&2 " $note_"
+ [ "$verbose" ] && echo >&2 "* committish: $head_"
+ [ "$verbose" ] && echo >&2 " $note_"
else
echo "$head_ not-for-merge $note_" >>"$GIT_DIR/FETCH_HEAD"
- echo >&2 "* non-commit: $head_"
- echo >&2 " $note_"
+ [ "$verbose" ] && echo >&2 "* non-commit: $head_"
+ [ "$verbose" ] && echo >&2 " $note_"
fi
if test "$local_name_" != ""
then
then
if now_=$(cat "$GIT_DIR/$1") && test "$now_" = "$2"
then
- echo >&2 "* $1: same as $3"
+ [ "$verbose" ] && echo >&2 "* $1: same as $3"
else
echo >&2 "* $1: updating with $3"
fi