-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support regex or globs for MainBranches config #3659
Comments
I understand the wish, but it's tricky to implement, and I'm concerned about performance and correctness. To elaborate: we have code that takes the configured main branches and determines which of these actually exist, and what their full refs are. It is important to get this right, because:
The code for this is here, and the logic currently depends on being able to loop over the configured main branches; this would no longer be possible if it's a pattern, so you would have to turn the logic around and loop over the existing branches to see which ones match the pattern. (Probably first over the local branches, and then over the ones in the And the whole thing needs to be as fast as possible. This is tricky because we can't just use the model information about branches that we have in memory, because that's refreshed independently in another background thread and might not be available yet. So we'd have to make our own call to To sum it up: it might be possible to do, but feels really tricky to me. If you do want to give it a try, I'd suggest to discuss the approach here first and hash out all the details before you start coding. (Maybe the scheduled job to update the configuration file periodically would be easier after all? 😉) |
Thank you for the helpful pointers and background. I've done a cursory scan through the code you referenced and cross-referenced it with the background/advice you've provided. I think I've come to a similar appreciation of the potential complexities at play here. I may circle back and look at this, but think I'll probably look for a different (safer) way to contribute to this project to start and perhaps re-consider after I'm more familiar with the code base. So, if anyone else reads this and has an idea, consider the issue available for the taking :) |
Is your feature request related to a problem? Please describe.
My organization's upstream branches change somewhat frequency as different ones are created for each major version of our product we release. It is tedious to update the lazygit configuration to add each new version with each new release.
Describe the solution you'd like
I would like to be able to express main branches in configuration via a glob pattern or regular expression.
Describe alternatives you've considered
A scheduled job to update the configuration file periodically - seems like overkill
Additional context
I would like to develop and submit this PR assuming the overall idea is considered okay to add to this project.
The text was updated successfully, but these errors were encountered: