Add lsremote command.
PATCH 1/1 Add lsremote command.
This is a fairly trivial addition, but if users are adding remote repositories with git addremote, then those users should be able to list out the remote list without having to know the details of where the remotes file is kept.
Steven
Adds lsremote command to list remotes.
-------------
git +2 -0
@@ -41,6 +41,7 @@ log ls [TREE_ID] lsobj [OBJTYPE] + lsremote merge -b BASE_ID FROM_ID pull [RNAME] rm FILE...
@@ -105,6 +106,7 @@ "log") gitlog.sh "$@";; "ls") gitls.sh "$@";; "lsobj") gitlsobj.sh "$@";; +"lsremote") gitlsremote.sh "$@";; "merge") gitmerge.sh "$@";; "pull") gitpull.sh "$@";; "rm") gitrm.sh "$@";;
gitlsremote.sh +7 -0
@@ -0,0 +1,7 @@ +#!/bin/sh +# +# ls remotes in GIT repository +# +[ -e .git/remotes ] && cat .git/remotes && exit 1 + +echo 'List of remotes is empty. See git addremote.'
Dear diary, on Sun, Apr 17, 2005 at 07:36:51AM CEST, I got a letter where Steven Cole <[email protected]> told me that...
Quoted 3 lines
This is a fairly trivial addition, but if users are adding remote repositories with git addremote, then those users should be able to list out the remote list without having to know the details of where the remotes file is kept.
Could you please send your patches inline? (Either in the body or with correct content-disposition header.)
You got the return values other way around and you are missing a copyright notice at the top; you should also mention that you take no parameters.
Please use -s instead of -e, since it is more appropriate in this case. Also, you should report the "no remotes" message to stderr. And always exit when you found that .git/remotes exists, not only if cat succeeds.
Kind regards,
Signature · 3 lines
Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Quoted 13 lines · Petr Baudis
Dear diary, on Sun, Apr 17, 2005 at 07:36:51AM CEST, I got a letter where Steven Cole <[email protected]> told me that...
Quoted 3 lines
This is a fairly trivial addition, but if users are adding remote repositories with git addremote, then those users should be able to list out the remote list without having to know the details of where the remotes file is kept.
Could you please send your patches inline? (Either in the body or with correct content-disposition header.)
You got the return values other way around and you are missing a copyright notice at the top; you should also mention that you take no parameters.
Quoted 6 lines
Please use -s instead of -e, since it is more appropriate in this case. Also, you should report the "no remotes" message to stderr. And always exit when you found that .git/remotes exists, not only if cat succeeds.
Kind regards,
Thanks for the fixes. Here's a better version.
Steven
This is a fairly trivial addition, but if users are adding remote repositories with git addremote, then those users should be able to list out the remote list without having to know the details of where the remotes file is kept.
git +2 -0
@@ -41,6 +41,7 @@ log ls [TREE_ID] lsobj [OBJTYPE] + lsremote merge -b BASE_ID FROM_ID pull [RNAME] rm FILE...
@@ -105,6 +106,7 @@ "log") gitlog.sh "$@";; "ls") gitls.sh "$@";; "lsobj") gitlsobj.sh "$@";; +"lsremote") gitlsremote.sh "$@";; "merge") gitmerge.sh "$@";; "pull") gitpull.sh "$@";; "rm") gitrm.sh "$@";;
gitlsremote.sh +11 -0
@@ -0,0 +1,11 @@ +#!/bin/sh +# +# Lists remote GIT repositories +# Copyright (c) Steven Cole 2005 +# +# Takes no parameters +# +[ -s .git/remotes ] && cat .git/remotes +[ -s .git/remotes ] && exit + +echo "List of remotes is empty. See git addremote." >&2