Skip to content

Latest commit

 

History

History
123 lines (79 loc) · 3.11 KB

CONTRIBUTING.md

File metadata and controls

123 lines (79 loc) · 3.11 KB

contributing

submitting issues

  • if it's a bug, please include sufficient information to reproduce the problem.
    it would help a lot if you can attach a trace log. check out the trace/debug section to see how to do it.

  • for issues with text formatting or colors, post at the styli.sh repo.

development

environment setup

  1. clone the repository locally, including submodules:

    git clone --recursive https://github.com/eliranmal/git-flux.git
  2. run the dev-env.sh script:

    ./bin/dev-env.sh [nohooks]

    it only needs to run once, and its job is to:

    • initialize git-hooks
      this is optional - if you run into issues, or you just hate git-hooks, you can pass nohooks as the first argument.
      to see what each hook does, go to git-hooks.

    • ensure submodules are in place
      in case you forgot to clone it with --recursive, or whatever.

  3. create a brand new repository on github and clone it locally (you can call it git-flux-playground).
    its sole purpose will be playing around with git-flux commands and test your new awesome code.

  4. install shellcheck, to make sure your code is analyzed and checked for errors.

lifecycle / workflow

  1. make some changes to the source (a.k.a. "your new awesome code").

  2. install git-flux from the source; use the setup-dev.sh script for that:

    ./bin/setup-dev.sh update
  3. test your changes in the playground repository by running the updated commands.

    see trace/debug for easier debugging.

  4. iterate the last three steps until you've made peace with your code.

  5. open a pull-request, and i'll check it out ❤️

code style

in lieu of a formal styleguide, take care to maintain the existing coding style.

the code is analyzed with shellcheck to check for common errors and enforce general style conventions.

tips & tricks

trace/debug

you can get a (much) more detailed log in the terminal if you prepend trace or debug to any subcommand. under the hood, it will set -x and run bash in debug mode.

for example, to investigate git flux feature start foo, type:

git flux debug feature start foo

you can also dump everything to a log file:

git flux trace <subcommand> [<args>] > trace.log 2>&1

git-hooks

lints the code of changed files with shellcheck (if you have it installed), and takes care of updating the auto-generated documentation when you make changes to the help text (the output of -h).

created to bypass an issue with JetBrains IDE's - they use --only in the commit command, so the auto-generated files seem to have changes after the commit. we fool them by updating these files from the index if they were changed.