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

Allow --skip to work with regular expressions #24

Open
Amwam opened this issue Jul 7, 2014 · 3 comments
Open

Allow --skip to work with regular expressions #24

Amwam opened this issue Jul 7, 2014 · 3 comments

Comments

@Amwam
Copy link

Amwam commented Jul 7, 2014

Having an option to be able to specify which branches to skip based on a regular expression.
For example being able to skip any branch beginning with "release", rather than having to specify each branch individually.

@ejoncas
Copy link

ejoncas commented Mar 31, 2016

I ended up doing this manually with grep but it would be pretty cool if the skip option would support regex instead. +1

@MithrilTuxedo
Copy link

How should it work?

I'm looking at how this works now, and the meat of the --skip value check is here:
https://github.com/arc90/git-sweep/blob/master/src/gitsweep/base.py#L40

This project is really easy to understand and this looks like an easy thing to change, but I'm thinking of several ways to do it:

  • arguments to --skip are treated like regexes
    • introduces false positives if . is in a name
  • --skip takes just a regex
    • --skip=x,y,z -> --skip='(x|y|z)'
  • prefix regexes in list with something like re:
    • --skip=develop,re:release/.*
  • separate --skip-re argument that takes just a regex
    • git-sweep preview --skip=develop --skip-re='release/.*'

@Amwam
Copy link
Author

Amwam commented Feb 27, 2017

@MithrilTuxedo Its been a while since I tried using this tool, but If I remember correctly, my expectation was just that --skip accepted just a regex (option 2).

Adding another option would work, but probably be a bit confusing, as the new option would be able to do the same as the original, and more.

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

No branches or pull requests

3 participants