[RFC] implement branch.sort config option

2 messages, 2 authors, 2018-08-13 · open the first message on its own page

[RFC] implement branch.sort config option

From: Samuel Maftoul <hidden>
Date: 2018-08-13 09:57:18

Currently, you can:

git tag --sort=$sorting_key

You can also do this on branches:

git branch --sort=$sorting_key

For tags, you can also configure it with a config key:

git config tag.sort $sorting_key

But there is no corresponding config for sorting branches.

Locally, I have a (pretty simple) patch that implements the
branch.sort config key.
Should I contribute that ?
Judging the number of votes and the complexity of answers to this
question https://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit,
 I would say it's a wanted and useful feature.
I'm still missing tests and docs, but if agreed the feature is useful,
I will write them.

Thanks

Re: [RFC] implement branch.sort config option

From: Jeff King <hidden>
Date: 2018-08-13 17:46:47

On Mon, Aug 13, 2018 at 11:56:58AM +0200, Samuel Maftoul wrote:
Currently, you can:

git tag --sort=$sorting_key

You can also do this on branches:

git branch --sort=$sorting_key

For tags, you can also configure it with a config key:

git config tag.sort $sorting_key

But there is no corresponding config for sorting branches.

Locally, I have a (pretty simple) patch that implements the
branch.sort config key.
Should I contribute that ?
Yes, that seems like a useful feature to me, and as you point out it
makes the overall interface more consistent.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help