Hi Kyle,

Yeah, that works really well! Thanks a lot :-)

I've added an issue for it here with your patch:
https://github.com/magit/magit/issues/2872

I hope to submit it as a patch later when I'm home -- but others are
of course free to jump in an do it sooner :-)


On Wed, Nov 23, 2016 at 3:59 PM, Kyle Meyer <[email protected]> wrote:
> Hello,
>
> Martin Geisler <[email protected]> writes:
>
>> Hi all,
>>
>> Does Magit have an option to sort branch names by the order they have
>> been used?
>
> No, not that I'm aware of.
>
>>
>> I'm using magit-ido-completing-read and as far as I can tell, the
>> order of the branches is alphabetically. That is normally not such a
>> big problem since typing a few characters narrows the list down.
>> However, I recently started having both a "release-2.0" and a
>> "release-2.1" branch in my repository -- and now find myself
>> repeatedly typing "rel21" to pick the right one :-)
>>
>> Any hints on how to have the completion function order the branches in
>> a smarter way?
>
> Does sorting by the committer date get you the behavior you want?
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/magit-git.el b/lisp/magit-git.el
> index af9134c..7af3975 100644
> --- a/lisp/magit-git.el
> +++ b/lisp/magit-git.el
> @@ -1012,6 +1012,7 @@ (defun magit-list-unmerged-to-upstream-branches ()
>
>  (defun magit-list-refnames (&rest args)
>    (magit-git-lines "for-each-ref" "--format=%(refname:short)"
> +                   "--sort=-committerdate"
>                     (or args magit-list-refs-namespaces)))
>
>  (defun magit-list-branch-names ()
> --8<---------------cut here---------------end--------------->8---
>
> If so, you could create a feature request for this to be added as an
> option.
>
> --
> Kyle



-- 
Martin Geisler

-- 
You received this message because you are subscribed to the Google Groups 
"magit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to