3 # List configured remote branches
4 # Copyright (c) Steven Cole 2005
6 # Print a listing of all known branches.
8 # The output has the following format:
14 # origin http://www.kernel.org/pub/scm/cogito/cogito.git
16 # Terminology note: This command concerns remote branches, not the local
17 # ones (those managed by `cg-switch` and listed by `cg-status -g`).
24 .
"${COGITO_LIB}"cg-Xlib ||
exit 1
25 msg_no_branches
="list of branches is empty (see cg-branch-add(1))"
27 [ -d "$_git/branches" ] || die
"$msg_no_branches"
29 [ "$(find "$_git/branches
" -follow -type f)" ] \
30 || die
"$msg_no_branches"
32 maxlen
="$(find "$_git/branches
" -name '*' -a ! -type d |
33 column_width "$_git/branches
/")"
35 find "$_git/branches" -name '*' -a ! -type d |
sort |
while read branch
; do
36 name
="${branch#$_git/branches/}"
37 url
="$(cat "$branch")"
38 columns_print
"$name" t
$maxlen "$url" -