#Hacking
Download sources:
git clone https://github.com/clash-lang/clash-prelude.git
git clone https://github.com/clash-lang/ghc-tcplugins-extra.git
git clone https://github.com/clash-lang/ghc-typelits-natnormalise.git
Go to clash-prelude dir:
cd clash-prelude
Run:
cabal sandbox init
cabal sandbox add-source ../ghc-tcplugins-extra
cabal sandbox add-source ../ghc-typelits-natnormalise
cabal install --dependencies-only --enable-tests
Configure the package with testing enabled:
cabal configure --enable-tests
Once you've finished hacking, build and test:
cabal build
cabal test
Patches are only accepted through GitHub pull requests.
-
Following the Hacking section above.
-
Go to the clash-prelude GitHub repository page, and click on Fork.
This will create a new remote
git
repository. -
Add your forked repository as a new remote:
$ git remote add <GITHUB_USERNAME> [email protected]:<GITHUB_USERNAME>/clash-prelude.git
-
Create a new branch in which you will be working on your patch:
$ git checkout -b <BRANCH_NAME>
-
Start hacking.
-
Commit changes sensibly!
$ git add -p ... add small changes ... $ git commit ... sensible commit message for small change ... $ git add -p ... small changes ... $ git commit etc.
-
Push to your remote GitHub repository:
$ git push -u <GITHUB_USERNAME> <BRANCH_NAME>
-
Hack some more
-
Commit and push some more:
$ git add -p
$ git commit
$ git add -p
$ git commit
$ git push
- Sync with central repository:
$ git pull --rebase origin master
Fix any conflicts that might arise.
Then push to your remote repository.
$ git push
If the above complains do:
$ git push --force
- Create a pull request:
- Updating the pull request:
- Once you've created a pull request, any changes to your branch will automatically be added to the pull request.
- To push your updated changes to your branch, always do:
$ git pull --rebase origin master
... fix any conflicts ...
$ git push --force