Re: [PATCH v2 3/4] status: show more info than currently not on any branch

2013-03-08 Thread Duy Nguyen
On Thu, Mar 7, 2013 at 2:16 AM, Junio C Hamano gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: +static void wt_status_get_detached_from(struct wt_status_state *state) +{ + struct grab_1st_switch_cbdata cb; + struct commit *commit; + unsigned char

Re: [PATCH v2 3/4] status: show more info than currently not on any branch

2013-03-08 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: It should be more like this, I would think: for_each_recent_reflog_ent(); if (!found) for_each_reflog_ent(); if (!found) return; Yes. This recent optimization is tricky. Not really. What is

Re: [PATCH v2 3/4] status: show more info than currently not on any branch

2013-03-06 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: +static void wt_status_get_detached_from(struct wt_status_state *state) +{ + struct grab_1st_switch_cbdata cb; + struct commit *commit; + unsigned char sha1[20]; + char *ref = NULL; + + strbuf_init(cb.buf, 0); + if