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

Feature/rename branch menu #621

Merged
merged 12 commits into from
Aug 30, 2023
Merged

Conversation

mwerle
Copy link
Contributor

@mwerle mwerle commented Aug 18, 2023

Adds a right-click menu item to the Commit List to rename branches.
Also adds a menu item to rename the current branch in the main menu's "Branch" submenu.

Yes, this functionality is already available in the "MENU->Branch->Configure Branches" dialog, but this is something I semi-regularly use and it actually took me some time to discover the functionality in the dialog, especially since clicking on the branch name does not work reliably to edit it.

I feel that by adding it to the right-click menu it is much more discoverable.

I also refactored the menu so that the "Delete Branch", "Delete Tag", and "Checkout" menu items turn into sub-menus when there are several references on a commit, making the menu more manageable. Again, this is something I encounter a bit in the repos I work with.

@Murmele Murmele self-requested a review August 22, 2023 11:50
@Murmele
Copy link
Owner

Murmele commented Aug 23, 2023

which version of clang-format are you using to format the code, Version 13 is required, otherwise it makes some problems

@mwerle
Copy link
Contributor Author

mwerle commented Aug 23, 2023

Whichever is the default on my dev pc. At home it's v14.

Apologies if this version requirement is documented, I'll see if i can get v13 of clang-format.

Interesting if a different version of clang-format produces different results for the same configuration though..

Also if Gittyup requires a very specific build/verification environment, perhaps setting up a docker based build environment might be useful?

@Murmele
Copy link
Owner

Murmele commented Aug 24, 2023

Also if Gittyup requires a very specific build/verification environment, perhaps setting up a docker based build environment might be useful?

Yes this is a good idea. Just revert all changes in the wrong formatted file and then it should work again. For Arch linux clang-format 13 binaries are available

@mwerle
Copy link
Contributor Author

mwerle commented Aug 25, 2023

Also if Gittyup requires a very specific build/verification environment, perhaps setting up a docker based build environment might be useful?

Yes this is a good idea. Just revert all changes in the wrong formatted file and then it should work again. For Arch linux clang-format 13 binaries are available

So I did all the clean up and adding optional git hook in my other PR (#618) - if you are happy with my changes there, I'll merge them into this PR as well and/or create a separate PR just to fix the clang-format issue separately. As you prefer :)

@Murmele
Copy link
Owner

Murmele commented Aug 28, 2023

This feature is fine, would you like to add an entry to the changelog and fix the formatting, then I will merge it.

@mwerle mwerle force-pushed the feature/rename_branch_menu branch from 97d75e8 to f4d5608 Compare August 28, 2023 23:44
@mwerle
Copy link
Contributor Author

mwerle commented Aug 28, 2023

Fixed the formatting, cherry-picked my change to force usage of clang-format v13 from my other PR, updated changelog.md, and rebased on the current master branch.

@Murmele
Copy link
Owner

Murmele commented Aug 29, 2023

I will fix the linux build error whit this: #627

@Murmele
Copy link
Owner

Murmele commented Aug 29, 2023

Can you rebase on master? I fixed the changelog problem there

mwerle added 12 commits August 30, 2023 07:27
Instead of having a big list of references which can be deleted or renamed in the main popup menu  we add a sub-menu for each kind of operation if there is more than one reference for an operation.  If there is only a single reference for an operation, it is added directly to the menu as per the previous implementation.

There's a pro/con here:
* pro: best use of menu with easiest operation in the most common scenario (a single reference).
* con: menu dynamically changes depending on the data, which means users can't learn muscle-memory. For that it's best to maintain a constant top-level menu and enable/disable menu items as required. This might also make the code a little cleaner.
Ideally I would like the dialog to start with a suitable size based on the current branch name, but not force it to be the minimum. However, I could not find a way to do this.

Secondly, it would be nice if the dialog automatically expanded up to some maximum size as the name gets longer, again, there seems to be no easy way to do this.
Similar to `Delete` and `Rename`, create a sub-menu if the list of branches available to checkout is larger.

TODO: Perhaps make the collapsible branches an option?
The `Checkout` submenu entries all had "Checkout" as part of their entry; remove it since it's overly verbose.
…ments

Fix the copyright information in the files authored by myself.
TODO: add clang-format as a pre-commit and/or pre-push git hook
The script was designed to find the latest version of clang-format, however, this project currently specifically requires the use of v13. We now only check for v13 of clang-format.

Secondly, for cmake-format the script also requires a specific version. Instead of installing that unmanaged version globally we now install it inside a python venv.
Revert incorrect formatting changes due to use of clang-format v14 in
6ed70b2.
@mwerle mwerle force-pushed the feature/rename_branch_menu branch from f4d5608 to 4ef8b60 Compare August 29, 2023 22:30
@mwerle
Copy link
Contributor Author

mwerle commented Aug 29, 2023

Can you rebase on master? I fixed the changelog problem there

Huh.. I thought I already rebased on master before my last push.. done.

@Murmele
Copy link
Owner

Murmele commented Aug 30, 2023

Yes, I had to fix something there, otherwise the CI would not run through

@Murmele Murmele merged commit e6b5f83 into Murmele:master Aug 30, 2023
11 checks passed
@Murmele
Copy link
Owner

Murmele commented Aug 30, 2023

@mwerle Thanks for the feature!

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