Re: [PATCH 5/5] branch: show more information when HEAD is detached
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:17
Nguyễn Thái Ngọc Duy [off-list ref] writes:
quoted hunk
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 <redacted> --- 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.