Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> writes: > This prints more helpful info when HEAD is detached: is it detached > because of bisect or rebase? What is the original branch name in those > cases? Is it detached because the user checks out a remote ref or a > tag (and which one)? > > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> > --- > builtin/branch.c | 25 ++++++++++++++++++++++++- > t/t6030-bisect-porcelain.sh | 2 +- > 2 files changed, 25 insertions(+), 2 deletions(-) > > diff --git a/builtin/branch.c b/builtin/branch.c > index 6371bf9..02dee0d 100644 > --- a/builtin/branch.c > +++ b/builtin/branch.c > @@ -18,6 +18,7 @@ > #include "string-list.h" > #include "column.h" > #include "utf8.h" > +#include "wt-status.h" > > static const char * const builtin_branch_usage[] = { > N_("git branch [options] [-r | -a] [--merged | --no-merged]"), > @@ -550,6 +551,28 @@ static int calc_maxwidth(struct ref_list *refs) > return w; > } > > +static char *get_head_description() s/()/(void)/; I think the series is much easier to read than the previous round (except for some nits, which I'll send separately). We would want to add tests to protect the "where did we detach from" feature done by [PATCH 4/5], which does not seem to have any. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html