Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remoteBranchOrder config #3158

Closed
wants to merge 1 commit into from

Conversation

hosaka
Copy link
Contributor

@hosaka hosaka commented Dec 12, 2023

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • Docs (specifically docs/Config.md) have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

docs/Config.md Outdated Show resolved Hide resolved
@hosaka hosaka force-pushed the remote-branch-order branch from 66528e0 to 3d58543 Compare December 12, 2023 09:14
docs/Config.md Outdated Show resolved Hide resolved
@hosaka hosaka force-pushed the remote-branch-order branch from 3d58543 to cef1547 Compare December 12, 2023 09:24
Takes alphabetical or lastCommit order, defaults to alphabetical
@hosaka hosaka force-pushed the remote-branch-order branch from cef1547 to 88f04be Compare December 12, 2023 09:27
@hosaka
Copy link
Contributor Author

hosaka commented Dec 14, 2023

Also worth noting that git branch --remote --sort=-authordate can be used to get the same output.

@stefanhaller
Copy link
Collaborator

This is a very welcome addition, I wanted this myself too. Thanks for the contribution.

However, I think it shouldn't be a config. I'd like us to move away from adding config options for things that we could also save in state.yml (see #3166 for more examples). So what I would like to have is a menu that lets users change the sort order at runtime, and then persist this in state.yml. It seems that s is still free in the branches panel, so this could bring up a "Sort order..." menu.

BTW, we also would like to have the sort order configurable for local branches (see here for some discussion about that; click "Load more" to see all of it). It's a little more involved there, as we're currently sorting by recency based on the local reflog, so we'd want three entries (recency, commit date, alphabetic). I'm not asking you to do that in this PR too, it could be a separate one later.

And finally, I think we should sort by committer date instead of author date. The rationale here is that any kind of activity on a branch should move it to the top, including rebasing it, amending commits, or rewording commit messages.

@hosaka
Copy link
Contributor Author

hosaka commented Dec 19, 2023

Hi @stefanhaller thanks for your comment! A runtime option persistent in state.yml is a better approach to this, agree on that. I am not familiar with how the menus are managed in lazygit TUI but I can have a go at it.

s for Sort order in remote branches is what i'll start with, and I'll open a new PR instead, this one should be closed in that case

@stefanhaller
Copy link
Collaborator

Sounds good! Let me know if you need any help.

@hosaka hosaka mentioned this pull request Dec 20, 2023
6 tasks
@hosaka
Copy link
Contributor Author

hosaka commented Dec 20, 2023

Closing in favour of #3171

@hosaka hosaka closed this Dec 20, 2023
@hosaka hosaka deleted the remote-branch-order branch December 28, 2023 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants