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
Implement ability to exclude config files through the HAB_CONFIG_EXCLUDE variable #1389
Conversation
Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
Hey - we're getting some eyeballs on this, @efyang - thanks for contributing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @fnichol needs to give this a once over, as he's got the 💯 bash skills.
My only comment is that the defaults might be overly broad.
cp -r "$PLAN_CONTEXT/config" $pkg_prefix | ||
if [ -z "${HAB_CONFIG_EXCLUDE:-}" ]; then | ||
# HAB_CONFIG_EXCLUDE not set, use defaults | ||
config_exclude_exts=("*.sw*" "*~" "*.bak") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think .sw is too broad as a default, given that it will match anything with an .sw* extension. If we're trying to match .swp and .swap, I would rather we be explicit about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vim will use .swp
, and if that doesn't exist try .swo
, and move backward through the alphabet. I've heard of people using .sw?
, but according to http://vimdoc.sourceforge.net/htmldoc/recover.html#recovery, if it needs to, it will keep going through the alphabet in reverse until .saa
is reached. 🍭
For other programs, I have this feature turned off in vim, and ignore .sw?
in my global gitignore and spare individual programs from having to worry about my specific editor settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would an alternative to a set default be no set default? This would allow users of their editor to tweak for themselves. I'd tend to agree with @adamhjk here (it feels too broad), however in this specific case (filtering entries under the config/
directory) I'm more okay with the chances of false positives.
It might make more sense to take @smith's suggestion and change *.sw*
to .sw?
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smith's suggestion seems good. If you have more than 20 temp files for your vim in one directory you're probably doing something wrong 😁
Signed-off-by: Edward Yang <edward.yang6771@gmail.com>
Swapped out |
Thanks @efyang, looking good! |
@thesentinels approve |
🤘 I am testing your branch against master before merging it. We do this to ensure that the master branch is never failing tests. |
Travis CI has started testing this PR. |
💖 Travis CI reports this PR passed. It always makes me feel nice when humans approve of one anothers work. I'm merging this PR now. I just want you and the contributor to answer me one question: |
This implements the
HAB_CONFIG_EXCLUDE
variable, as discussed in #1120, which goes by the format of ",,,...", and provides a few reasonable defaults.