diff options
author | Johannes Sixt <j6t@kdbg.org> | 2008-10-22 09:39:47 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-10-22 18:05:38 -0700 |
commit | 20244ea2d09a3f5c3c83133014ca1e1b7b3d0227 (patch) | |
tree | 58d3ac35a6449f02769956d407542c73579495cc /builtin-remote.c | |
parent | f55527f80223178d1837bae08addc57bed76d236 (diff) | |
download | git-20244ea2d09a3f5c3c83133014ca1e1b7b3d0227.tar.gz git-20244ea2d09a3f5c3c83133014ca1e1b7b3d0227.tar.xz |
git-remote: list branches in vertical lists
Previously, branches were listed on a single line in each section. But
if there are many branches, then horizontal, line-wrapped lists are very
inconvenient to scan for a human. This makes the lists vertical, i.e one
branch per line is printed.
Since "git remote" is porcelain, we can easily make this
backwards-incompatible change.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-remote.c')
-rw-r--r-- | builtin-remote.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/builtin-remote.c b/builtin-remote.c index 6b3325dfa..df2be068b 100644 --- a/builtin-remote.c +++ b/builtin-remote.c @@ -412,10 +412,9 @@ static void show_list(const char *title, struct string_list *list, return; printf(title, list->nr > 1 ? "es" : "", extra_arg); - printf("\n "); - for (i = 0; i < list->nr; i++) - printf("%s%s", i ? " " : "", list->items[i].string); printf("\n"); + for (i = 0; i < list->nr; i++) + printf(" %s\n", list->items[i].string); } static int get_remote_ref_states(const char *name, @@ -511,17 +510,17 @@ static int show(int argc, const char **argv) show_list(" Tracked remote branch%s", &states.tracked, ""); if (states.remote->push_refspec_nr) { - printf(" Local branch%s pushed with 'git push'\n ", + printf(" Local branch%s pushed with 'git push'\n", states.remote->push_refspec_nr > 1 ? "es" : ""); for (i = 0; i < states.remote->push_refspec_nr; i++) { struct refspec *spec = states.remote->push + i; - printf(" %s%s%s%s", spec->force ? "+" : "", + printf(" %s%s%s%s\n", + spec->force ? "+" : "", abbrev_branch(spec->src), spec->dst ? ":" : "", spec->dst ? abbrev_branch(spec->dst) : ""); } - printf("\n"); } /* NEEDSWORK: free remote */ |