improve scripted-diff check #19815
improve scripted-diff check #19815
Comments
|
You can also use append empty string directly after
I want to work on this, but I think it is good to recommend people to do the above for portability for now. |
|
@Z5483 hi! thanks for taking a look & opening a PR! I tried this trick out locally (macOS), but got an error... actually, I'm getting different errors on each try my attempts, incase you're curiousexample 1: example 2: example 3: but I see you've opened a patch to update the script, so I'll check that out :) |
|
@Z5483 Thanks for working on this! I've ran into some @amitiuttarwar I'm a MacOS user as well, and I ran into the following issue; did you ever encounter this as well?
I fixed it locally by installing After making this change, here's the new output:
|
|
I'm signing up for this task (if still open) because @bliotti wants me to work on it as "I'm way overdue for a bitcoin commit" as a Jimmy Song Alumni, using my public face here. |
|
@bitkarrot Awesome! Looks like a good one. @amitiuttarwar or @Z5483 where does this one stand? We would like to pick this one up if still available. Thanks! |
|
Feel free to work on this. I scrapped my PR because I didn't put time into it so it's horrible. I'm busy with schools for the rest of the school year so I don't think I will pick this up again anytime soon. I hope you guys can produce something better than mine. |
|
Catching sed syntax usage that leads to unexpected results is not a low hanging fruit I guess :) Maybe you should pimp your own script like so:
With that, you can define all specialities needed for different environments. You could pimp it even more like checking the the version etc. Maybe you could create a PR to add this as a template to https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#suggestions-and-examples |

Context:
Scripted diffs are a way to automate some types of reformatting or refactoring changes. When a commit message matches a specific format (begins with
scripted-diff:), CI will run commit-script-check.sh.sedis platform dependent. One significant difference is when using the-iflag. On BSD (eg. macOS), you have to insert an empty string, but with GNU sed (used by Travis), this is compatible.example of a working command for these two platforms-
macOS:
sed -i '' 's/a oneshot/an addrfetch/g' src/chainparams.cppTravis:
sed -i 's/a oneshot/an addrfetch/g' src/chainparams.cppTask:
Add logic to the
commit-script-check.shto detect if the scripted diff is using the BSD sed syntax and print a helpful error message.Useful skills:
Bash
Want to work on this issue?
For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.
The text was updated successfully, but these errors were encountered: