Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-17 Thread Karthik Nayak
On Wed, Sep 16, 2015 at 11:53 AM, Karthik Nayak wrote: > On Tue, Sep 15, 2015 at 1:05 AM, Junio C Hamano wrote: >> Karthik Nayak writes: >> >>> + /* >>> + * First we obtain all regular branch refs and if the HEAD is >>> +

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-17 Thread Matthieu Moy
Junio C Hamano writes: > Matthieu Moy writes: > >> Karthik Nayak writes: >> >>> So either we could introduce a new atom for sorting something like >>> `branch_sort` which uses the FILTER_REFS_(DETACHED_HEAD | BRANCHES |

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-17 Thread Matthieu Moy
Karthik Nayak writes: > So either we could introduce a new atom for sorting something like > `branch_sort` which uses the FILTER_REFS_(DETACHED_HEAD | BRANCHES | > REMOTES) I don't think you need a new atom. You can just change the sorting function to consider that

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-17 Thread Junio C Hamano
Matthieu Moy writes: > Karthik Nayak writes: > >> So either we could introduce a new atom for sorting something like >> `branch_sort` which uses the FILTER_REFS_(DETACHED_HEAD | BRANCHES | >> REMOTES) > > I don't think you need a new atom.

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-17 Thread Junio C Hamano
Matthieu Moy writes: > But that's still workable: struct ref_sorting could contain a flag > "head_first" that would be set by ref_default_sorting() and only it, and > then read by cmp_ref_sorting. Hmm, I am still puzzled. "refname" atom would expand to things like

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-17 Thread Matthieu Moy
Junio C Hamano writes: > Matthieu Moy writes: > >> But that's still workable: struct ref_sorting could contain a flag >> "head_first" that would be set by ref_default_sorting() and only it, and >> then read by cmp_ref_sorting. > > Hmm, I am still

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-17 Thread Junio C Hamano
Matthieu Moy writes: > ... But we can decide "if sorting on refname, then > HEAD always comes first anyway". Sure. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-17 Thread Karthik Nayak
On Thu, Sep 17, 2015 at 10:38 PM, Matthieu Moy wrote: > Junio C Hamano writes: > >> Matthieu Moy writes: >> >>> But that's still workable: struct ref_sorting could contain a flag >>> "head_first" that would be set by

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-16 Thread Karthik Nayak
On Tue, Sep 15, 2015 at 1:05 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> + /* >> + * First we obtain all regular branch refs and if the HEAD is >> + * detached then we insert that ref to the end of the ref_fist >> + * so

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-14 Thread Matthieu Moy
Karthik Nayak writes: > On Mon, Sep 14, 2015 at 12:01 AM, Eric Sunshine > wrote: >> Specifically, I think you're referring to [1] (?). >> >> [1]: >> http://thread.gmane.org/gmane.comp.version-control.git/276363/focus=276676 > > No not that, that

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-14 Thread Karthik Nayak
On Mon, Sep 14, 2015 at 12:01 AM, Eric Sunshine wrote: > On Sun, Sep 13, 2015 at 12:46 PM, Eric Sunshine > wrote: >> On Sun, Sep 13, 2015 at 8:12 AM, Matthieu Moy >> wrote: >>> Karthik Nayak

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-14 Thread Junio C Hamano
Karthik Nayak writes: > + /* > + * First we obtain all regular branch refs and if the HEAD is > + * detached then we insert that ref to the end of the ref_fist > + * so that it can be printed and removed first. > + */ >

[PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-13 Thread Karthik Nayak
Remove show_detached() and make detached HEAD to be rolled into regular ref_list by adding REF_DETACHED_HEAD as a kind of branch and supporting the same in append_ref(). This eliminates the need for an extra function and helps in easier porting of branch.c to use ref-filter APIs. Before

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-13 Thread Karthik Nayak
On Sun, Sep 13, 2015 at 5:42 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> @@ -679,15 +682,20 @@ static int print_ref_list(int kinds, int detached, int >> verbose, int abbrev, stru >> if (verbose) >> maxwidth =

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-13 Thread Eric Sunshine
On Sun, Sep 13, 2015 at 8:12 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> @@ -679,15 +682,20 @@ static int print_ref_list(int kinds, int detached, int >> verbose, int abbrev, stru >> if (verbose) >> maxwidth =

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-13 Thread Matthieu Moy
Karthik Nayak writes: > @@ -679,15 +682,20 @@ static int print_ref_list(int kinds, int detached, int > verbose, int abbrev, stru > if (verbose) > maxwidth = calc_maxwidth(_list, strlen(remote_prefix)); > > - qsort(ref_list.list, ref_list.index,

Re: [PATCH v4 3/8] branch: roll show_detached HEAD into regular ref_list

2015-09-13 Thread Eric Sunshine
On Sun, Sep 13, 2015 at 12:46 PM, Eric Sunshine wrote: > On Sun, Sep 13, 2015 at 8:12 AM, Matthieu Moy > wrote: >> Karthik Nayak writes: >> >>> @@ -679,15 +682,20 @@ static int print_ref_list(int kinds, int detached,