Skip to content

Adding swap_divergence flag#98

Merged
arl merged 4 commits into
arl:mainfrom
hqkhan:main
Apr 10, 2023
Merged

Adding swap_divergence flag#98
arl merged 4 commits into
arl:mainfrom
hqkhan:main

Conversation

@hqkhan

@hqkhan hqkhan commented Apr 7, 2023

Copy link
Copy Markdown
Contributor

Purpose

Adding swap_divergence option to allow users to customize whether "upstream behind count" should be displayed first or "upstream ahead count".

Main motivation behind this was that I use gitmux in conjunction with lazygit. Lazygit's branch menu always shows ahead count first followed by behind count. I thought it'd be nice to be able to sync them up.

swap_divergence: false:
image

swap_divergence: true:
image

Approach

Added swap_divergence boolean flag for yaml file. Instead of appending to the returned string s right away, saving ahead and behind strings in separate vars then appending to original string s based on swap_divergence flag.

Thank you!

@arl arl left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hqkhan
That looks good.
I've let 2 style comments, and do you think you can add you a test case in formatter_test.go in which divergences strings are swapped, please?

Thank you

Comment thread tmux/formater.go Outdated
Comment thread tmux/formater.go Outdated
@hqkhan

hqkhan commented Apr 7, 2023

Copy link
Copy Markdown
Contributor Author

@arl

I've let 2 style comments, and do you think you can add you a test case in formatter_test.go in which divergences strings are swapped, please?

Thanks for the review! Yes, I will add a test and also update README to make the option more visible.

@arl

arl commented Apr 7, 2023

Copy link
Copy Markdown
Owner

@arl

I've let 2 style comments, and do you think you can add you a test case in formatter_test.go in which divergences strings are swapped, please?

Thanks for the review! Yes, I will add a test and also update README to make the option more visible.

Of course! Yes good catch about the readme, that'd be nice.

Comment thread tmux/formater_test.go
@hqkhan
hqkhan requested a review from arl April 9, 2023 18:34

@arl arl left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks for the extensive testing 👍
But i forgot to ask you, sorry my bad, can you add swap_divergence: false with a doc string to the default config in gitmux.yml (at project root).

@hqkhan

hqkhan commented Apr 9, 2023

Copy link
Copy Markdown
Contributor Author

LGTM thanks for the extensive testing 👍 But i forgot to ask you, sorry my bad, can you add swap_divergence: false with a doc string to the default config in gitmux.yml (at project root).

Absolutely, will do

@hqkhan
hqkhan requested a review from arl April 10, 2023 02:36

@arl arl left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you

@arl
arl merged commit 5479145 into arl:main Apr 10, 2023
@arl

arl commented Apr 10, 2023

Copy link
Copy Markdown
Owner

@hqkhan
I'll cut a release with this and #97 resolution (when I'll have done it).

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.

2 participants