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

Support exclude-regex #120

Open
mcico opened this issue Feb 20, 2023 · 2 comments
Open

Support exclude-regex #120

mcico opened this issue Feb 20, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mcico
Copy link

mcico commented Feb 20, 2023

Hello,

I recently switched to use git-delete-merged-branches (from git-trim). I like the approach of git-dmb, in particular the safety net we get.

In #52 the support of --include-regex was added. I would appreciate the same feature, but for the exclusion.

In our company we work on many git repository (on many different projects), while we all follow a common branch naming pattern, where we for example use release/<version> as a pattern for branches we must keep for a longer time around.

Based on that I would like to add an --exclude-pattern which skips all branches of the given pattern, in my case release/.* from deletion.
While I could add entries to the git config with a few bash commands, I would have to do that for each and every git repository and update it regularly, whereas with the pattern I could just add it to my global git config and be sure that such branches are not deleted by accident.

cheers & thanks,
marco

@hartwork
Copy link
Owner

Hi @mcico,

I'll just do a quick braindump here so you have a reply quicker, if that's okay:

  • I'm glad you consider the safety net helpful.
  • I'd be curious to learn more about what made you look for alternatives to git-trim and how you found git-delete-merged-branches. If you feel like elaborating here or via e-mail (see profile) I wold be curious to learn more for sure.
  • --include-regex has no Git config equivalent right now and is not easy to fit into the --configure dialog. Pattern include and exclude is a bit off the road compared to the rest of the feature set.
  • Once we have both includes and excludes, order and multiple instances start to matter, e.g. think of include a*, exclude aa*, include aaa*.

Let me digest this more, best, Sebastian

@hartwork hartwork added the enhancement New feature or request label Feb 20, 2023
@mcico
Copy link
Author

mcico commented Mar 4, 2023

Hoi @hartwork,

I'd be curious to learn more about what made you look for alternatives to git-trim and how you found git-delete-merged-branches. If you feel like elaborating here or via e-mail (see profile) I wold be curious to learn more for sure.

At the company I we work with older linux distributions (red hat 7 and 8) where I installed git-trim through linuxbrew. Unfortunately linuxbrew started to break on red hat 7 and 8, which is why I was looking for another solution. I think I came accross git-dmb through googling.

--include-regex has no Git config equivalent right now and is not easy to fit into the --configure dialog. Pattern include and exclude is a bit off the road compared to the rest of the feature set.

This is what I arealized as well, which is why I raised the request. When working with dozens of repositories, it would be nice to configure the default behaviour through a global config (e.g. in .gitconfig) or even in a separate configuration file. So I am looking for a way to automate cleaning up multiple repositories.

Once we have both includes and excludes, order and multiple instances start to matter, e.g. think of include a*, exclude aa*, include aaa*.

I understand that, I would expect that safety should win an din case of doubt to not delete a branch. Which means if a pattern would be used to exclude a branch it should win over a pattern that would include the same branch.

cheers & thanks
marco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants