-
Notifications
You must be signed in to change notification settings - Fork 331
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
Clean up the headers to indicate a file was added/removed/modified #90
Conversation
My sed skills are seriously lacking, but Perl skills are decent. I went ahead and took a stab at addressing #28 by calling a Perl script I put in Let me know if I'm going down the wrong path here. |
28e1845
to
550c6d1
Compare
i believe this would qualify as first-party code, unless you're releasing this separately. :) I hesitate a bit to 👍 adding perl to our sourcebase. I'm certainly way less comfortable in it than bash. Would you consider porting your work here to bash? |
curious what others think, too. I'm flexible if the consensus leans toward the perl implementation. |
I'm concerned with how we can handle one extra dependency... (I miss nodejs 😄) We need to update the install section in README and might need to deal with related issues, etc. |
|
yeah install-wise it wont be a problem, so that's an upside. @scottchiefbaker wanna write a few tests? |
As |
I don't know enough bash to make this sort of thing. Someone with more bash skills wouldn't have too much of a problem, the script is pretty simple. If we're comfortable with a Perl implementation I can take a look at adding tests. Otherwise I'm happy to work with someone who wants to write a bash implementation, to explain my logic. |
yeah i am feeling the pain of bash as well. i'm into porting everything into perl. |
I know enough Perl that I can contribute more if we go down that road. What's the next/first step to going down that road? Do we want to land this change for clickable headers and start a separate issue for migrating some of the other pieces to Perl? |
I was curious about this so I ran some numbers. perf of diff-so-fancyI took a fairly busy diff of ~10 files as my example. I broke apart the 4 pieces of the pipeline, and ran them a few times. These are the rough medians:
(I was running them with Pretty interesting. Bash is certainly not giving us speed here. :) |
Multiple calls to |
I count 9 calls to sed in diff-so-fancy. At least four of them (in |
I'm +1 for merging this. I'm also interested in migrating the rest of the script into perl, as I think maintenance and readability would improve. @scottchiefbaker can you move the script to a new Also. a test? :) |
Yes I can move this to a I looked at adding tests, and I can't even get the existing tests to run locally. No matter what I do I get:
Any tips on setting up a testing environ so I can start writing tests? |
@scottchiefbaker did you |
Also makes the file name "clickable" by removing the leading a/ and /b
fb42b9c
to
d293ed7
Compare
I cleaned up my pull request and added tests for the functionality I added. This should address all the outstanding issues/questions, and should be ready to merge. |
lookin sharp. merging… |
Clean up the headers to indicate a file was added/removed/modified
@scottchiefbaker can you have a look at Homebrew/legacy-homebrew#49712? Thanks. |
Checking it out now... |
Also makes the file name "clickable" by removing the leading a/ and /b