Re: [PATCH v3] branch: show rebase/bisect info when possible instead of "(no branch)"

2013-02-14 Thread Duy Nguyen
On Sat, Feb 9, 2013 at 1:35 AM, Junio C Hamano wrote: > We may want to refactor wt_status_print_state() and its callee a bit > so that it and this part can share the logic without duplication and > risk implementing subtly different decision. wt_status used to have > clean separation between coll

Re: [PATCH v3] branch: show rebase/bisect info when possible instead of "(no branch)"

2013-02-11 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > +static char *get_head_description() > +{ > + struct stat st; > + struct strbuf sb = STRBUF_INIT; > + struct strbuf result = STRBUF_INIT; > + int bisect = 0; > + int ret; > + if (!stat(git_path("rebase-merge"), &st) && S_ISDIR(st.st_mode)) >

Re: [PATCH v3] branch: show rebase/bisect info when possible instead of "(no branch)"

2013-02-08 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy 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? > > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > Keep "no branch" in all cases. Just append "rebasing/bisecting [%

[PATCH v3] branch: show rebase/bisect info when possible instead of "(no branch)"

2013-02-08 Thread Nguyễn Thái Ngọc Duy
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? Signed-off-by: Nguyễn Thái Ngọc Duy --- Keep "no branch" in all cases. Just append "rebasing/bisecting [%s]" when applicable. builtin/branch.c