aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJay Soffian <jaysoffian@gmail.com>2009-02-25 03:32:27 -0500
committerJunio C Hamano <gitster@pobox.com>2009-02-27 15:19:42 -0800
commit7ecbbf877c9a0716ccccd25609b01023eecd27c0 (patch)
tree59c5c16e543e0db6eebb193b3171e6fc1db446f4 /t
parentfbb074c25352627f650d2ea528ed694e77bece0f (diff)
downloadgit-7ecbbf877c9a0716ccccd25609b01023eecd27c0.tar.gz
git-7ecbbf877c9a0716ccccd25609b01023eecd27c0.tar.xz
builtin-remote: new show output style
The existing output of "git remote show <remote>" is too verbose for the information it provides. This patch teaches it to provide more information in less space. The output for push refspecs is addressed in the next patch. Before the patch: $ git remote show origin * remote origin URL: git://git.kernel.org/pub/scm/git/git.git HEAD branch: master Remote branch merged with 'git pull' while on branch master master Remote branch merged with 'git pull' while on branch next next Remote branches merged with 'git pull' while on branch octopus foo bar baz frotz New remote branch (next fetch will store in remotes/origin) html Stale tracking branch (use 'git remote prune') bogus Tracked remote branches maint man master next pu todo After this patch: $ git remote show origin * remote origin URL: git://git.kernel.org/pub/scm/git/git.git HEAD branch: master Remote branches: bogus stale (use 'git remote prune' to remove) html new (next fetch will store in remotes/origin) maint tracked man tracked master tracked next tracked pu tracked todo tracked Local branches configured for 'git pull': master rebases onto remote master next rebases onto remote next octopus merges with remote foo and with remote bar and with remote baz and with remote frotz $ git remote show origin -n * remote origin URL: git://git.kernel.org/pub/scm/git/git.git HEAD branch: (not queried) Remote branches: (status not queried) bogus maint man master next pu todo Local branches configured for 'git pull': master rebases onto remote master next rebases onto remote next octopus merges with remote foo and with remote bar and with remote baz and with remote frotz Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5505-remote.sh38
1 files changed, 21 insertions, 17 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index de1d0fcf4..69e241a0a 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -28,7 +28,7 @@ tokens_match () {
}
check_remote_track () {
- actual=$(git remote show "$1" | sed -e '1,/Tracked/d') &&
+ actual=$(git remote show "$1" | sed -ne 's|^ \(.*\) tracked$|\1|p')
shift &&
tokens_match "$*" "$actual"
}
@@ -137,13 +137,15 @@ cat > test/expect << EOF
* remote origin
URL: $(pwd)/one
HEAD branch: master
- Remote branch merged with 'git pull' while on branch master
- master
- New remote branch (next fetch will store in remotes/origin)
- master
- Tracked remote branches
- master
- side
+ Remote branches:
+ master new (next fetch will store in remotes/origin)
+ side tracked
+ Local branches configured for 'git pull':
+ master merges with remote master
+ octopus merges with remote topic-a
+ and with remote topic-b
+ and with remote topic-c
+ rebase rebases onto remote master
Local branches pushed with 'git push'
master:upstream
+refs/tags/lastbackup
@@ -156,20 +158,22 @@ EOF
test_expect_success 'show' '
(cd test &&
- git config --add remote.origin.fetch \
- refs/heads/master:refs/heads/upstream &&
+ git config --add remote.origin.fetch refs/heads/master:refs/heads/upstream &&
git fetch &&
+ git branch --track octopus origin/master &&
+ git branch --track rebase origin/master &&
git branch -d -r origin/master &&
git config --add remote.two.url ../two &&
+ git config branch.rebase.rebase true &&
+ git config branch.octopus.merge "topic-a topic-b topic-c" &&
(cd ../one &&
echo 1 > file &&
test_tick &&
git commit -m update file) &&
- git config remote.origin.push \
- refs/heads/master:refs/heads/upstream &&
- git config --add remote.origin.push \
- +refs/tags/lastbackup &&
+ git config remote.origin.push refs/heads/master:refs/heads/upstream &&
+ git config --add remote.origin.push +refs/tags/lastbackup &&
git remote show origin two > output &&
+ git branch -d rebase octopus &&
test_cmp expect output)
'
@@ -177,11 +181,11 @@ cat > test/expect << EOF
* remote origin
URL: $(pwd)/one
HEAD branch: (not queried)
- Remote branch merged with 'git pull' while on branch master
- master
- Tracked remote branches
+ Remote branches: (status not queried)
master
side
+ Local branch configured for 'git pull':
+ master merges with remote master
Local branches pushed with 'git push'
master:upstream
+refs/tags/lastbackup