On Mon, Jan 1, 2018 at 5:54 PM, SZEDER Gábor <szeder.dev@xxxxxxxxx> wrote: > 'git branch' has an option to edit a branch's description, but lacks > the option to show that description. > > Therefore, add a new '--show-description' option to do just that, as a > more user-friendly alternative to 'git config --get > branch.$branchname.description': > [...] > - errors out with a proper error message when the given branch > doesn't exist (but exits quietly with an error code when the > branch does exit but has no description, just like the 'git config' s/exit/exist/ > query does). > > Signed-off-by: SZEDER Gábor <szeder.dev@xxxxxxxxx> > --- > diff --git a/builtin/branch.c b/builtin/branch.c > @@ -737,6 +741,35 @@ int cmd_branch(int argc, const char **argv, const char *prefix) > + } else if (show_description) { > + [...] > + if (!argc) { > + if (filter.detached) > + die(_("cannot show description on detached HEAD")); > + branch_name = head; > + } else if (argc == 1) > + branch_name = argv[0]; > + else > + die(_("cannot show description of more than one branch")); Aside from paralleling the single branch accepted by --edit-description, why this limitation? (Just curious; I don't feel strongly one way or the other.)