Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chanwit/simple-patch
https://github.com/chanwit/simple-patch
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/chanwit/simple-patch
- Owner: chanwit
- License: apache-2.0
- Created: 2014-11-17T12:43:37.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-22T13:28:12.000Z (almost 10 years ago)
- Last Synced: 2024-10-11T00:31:57.344Z (about 1 month ago)
- Language: Groovy
- Homepage:
- Size: 160 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple Patch Toolkit
====================SPT or Simple Patch Toolkit is a tool for writing a robust patch with its Domain Specific Language (DSL).
With the SPT language, we can easily patch a text file with search and replace syntax.
This allows us to write robust patches to support multiple-version and frequently-evolved source codes.For example,
useTabs = true
name "001 Add new splitter ID to allfilters"
patch "include/mediastreamer2/allfilters.h"
check "\tMS_SPLITTER_ID"find "} MSFilterId;"
offset (-1) append ","
insert "\tMS_SPLITTER_ID"commit
donePatch in the example check to see if there exists `MS_SPLITTER_ID` defined in `MSFilterId`.
If there's a line containing `MS_SPLITTER_ID`, SPT will throw an exception and stop the patching process.If not, it then locates the line `} MSFilterId;` as the current line.
Then appends `,` to the line prior the current line.
Next, the patch inserts a new line containing to `MS_SPLITTER_ID` prefixed with a TAB just before the current line.
Then saves this change as a `Git` commit and automatically generate a `diff` file for us.
The `name` command will be used as the commit's message, and the diff's filename.With SPT, we'll have a Git-compatible robust patch DSL engine to help maintain our changesets against the fast moving projects.