Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

Latest commit

 

History

History
117 lines (93 loc) · 2.85 KB

HACKING.MD

File metadata and controls

117 lines (93 loc) · 2.85 KB

#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

Supplying patches

Patches are only accepted through GitHub pull requests.

  1. Following the Hacking section above.

  2. Go to the clash-prelude GitHub repository page, and click on Fork.

    This will create a new remote git repository.

  3. Add your forked repository as a new remote:

    $ git remote add <GITHUB_USERNAME> [email protected]:<GITHUB_USERNAME>/clash-prelude.git
    
  4. Create a new branch in which you will be working on your patch:

    $ git checkout -b <BRANCH_NAME>
    
  5. Start hacking.

  6. 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.
    
  7. Push to your remote GitHub repository:

    $ git push -u <GITHUB_USERNAME> <BRANCH_NAME>
    
  8. Hack some more

  9. Commit and push some more:

$ git add -p
$ git commit
$ git add -p
$ git commit
$ git push
  1. 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
  1. Create a pull request:
  • Go to https://github.com/<GITHUB_USERNAME>/clash-prelude

  • Select the <BRANCH_NAME>

  • Click the Compare & review button

  • Click the Create pull request button.

  1. 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