-
Notifications
You must be signed in to change notification settings - Fork 2.3k
themes/base: don't invoke svn if possible #1909
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
Conversation
|
I think that test |
I agree that the test can be changed. I do not think it should only run on macs though- we should mock the conditions for the check and test it, imitating that it is indeed a problematic Mac |
|
As an alternative to my patch here, we could check for |
xcrun --find svnOk, so how about: (1) if |
|
Sounds like a good idea! |
d565213 to
9b7e373
Compare
|
I'm sorry, I haven't had much time to learn BATS so this is just sitting waiting for me to circle back to it. |
There is not much to learn actually, you can look at our docs for reference |
3ca6c24 to
7df115d
Compare
734080b to
4f25249
Compare
|
Done and passing. |
If we are specifically in the situation Bash-it#1612, then check for a working `svn` command. If we're not in that situation, then don't waste time on it.
This reduces the need to invoke subprocesses
NoahGorny
left a comment
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 left one comment, otherwise looks great!
|
And now I think I'm going to change the test local setup function too. If we're testing that the file loads properly, then loading the file should be part of the test not the setup. See? This is why I didn't touch BATS at first. Once I start, my brain drags me down the rabbit hole! I may need to start a whole branch just for BATS cleanup! 🙃 (I have a love/hate relationship with my brain. I'll spare you my further whining about my brain.) |
|
Serious question: although it doesn't matter for this particular PR, what are your thoughts on naming the library init function? Several plugins use init functions (and call them immediately, like I do here) and I very much do like the paradigm of keeping the definition separate from the invocation. I alsö want to introduce a library init hook and plugin init hook (later, in a future PR) such that loading a file doesn't do anything besides declare/define variables and functions and then the we separately run all the init hooks afterwards. This would solve most(?) of the need for explicit ordering of file load (default priorities, &c.), and would make I'd like a common prefix for init functions so that Should I name the one I introduce here |
f4ed705 to
40ba1f8
Compare
Wrap init code in a function and call the function immediately. Several plugins do this, and it allows us to more easily implement a hooks-based system in the future. Alsö, avoid external binary `which`. Use built-in `type -P` instead. Uppercase `-P` forces a path search to avoid hashed matches and functions/aliases and whatnot.
NoahGorny
left a comment
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 have another small comment 😄
About the init function- i am pretty sure it will take a long refactor to get bash-it-reload to just call the init of each file and I am not sure it will be worth the effort. I am okay with adding init functions like you did, not sure that changing the reload will happen.
That's a whole other discussion that is wildly out of scope here...I only mentioned it because it's on my mind. Functions have scope! (I've shot myself in the foot with this one, can you tell? 😉) |
NoahGorny
left a comment
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.
Well done @gaelicWizard!
Another great work by you (or your brain worms)
|
Anything else needed for this PR? |
|
nope- well done! |
Description
If we are specifically in the situation #1612 (where Xcode's
xcrunis masquerading assvn), then check for a workingsvncommand. If we're not in that situation, then don't waste time on it. This check was added in #1613.Motivation and Context
This is one of the causes of my shell taking several seconds to start.
How Has This Been Tested?
Tested locally.
Screenshots (if appropriate):
Types of changes
Checklist:
clean_files.txtand formatted it usinglint_clean_files.sh.