|
| 1 | +# Contributing to Git-Sim |
| 2 | + |
| 3 | +Thanks for checking out Git-Sim and for your interest in contributing! I hope |
| 4 | +that we can work together to build an incredible tool for developers to |
| 5 | +visualize Git commands. |
| 6 | + |
| 7 | +## Reporting bugs |
| 8 | + |
| 9 | +To report a bug you found, please open a [GitHub issue](https://github.com/initialcommit-com/git-sim/issues/new) |
| 10 | +and describe the error or problem in detail. Please check [existing issues](https://github.com/initialcommit-com/git-sim/issues) |
| 11 | +to make sure it hasn't already been reported. |
| 12 | + |
| 13 | +When submitting a new issue, it helps to include: |
| 14 | + |
| 15 | +1) The steps you took that lead to the issue |
| 16 | +2) Any error message(s) that you received |
| 17 | +3) A description of any unexpected behavior |
| 18 | +4) The version of Git-Sim you're running |
| 19 | +5) The version of Python you're running and whether it's system-level or in a virtual environment |
| 20 | +6) The operating system and version you're running |
| 21 | + |
| 22 | +## Suggesting enhancements or new features |
| 23 | + |
| 24 | +If you've got a cool idea for a feature that you'd like to see implemented in |
| 25 | +Git-Sim, we'd love to hear about it! |
| 26 | + |
| 27 | +To suggest an enhancement or new feature, please open a [GitHub issue](https://github.com/initialcommit-com/git-sim/issues/new) |
| 28 | +and describe your proposed idea in detail. Please include why you think this |
| 29 | +idea would be beneficial to the Git-Sim user base. |
| 30 | + |
| 31 | +## Your first code contribution |
| 32 | + |
| 33 | +Note: Git-Sim is a new project so these steps are not fully optimized yet, but |
| 34 | +they should get you going. |
| 35 | + |
| 36 | +To start contributing code to Git-Sim, you'll need to perform the following |
| 37 | +steps: |
| 38 | + |
| 39 | +1) Install [manim and manim dependencies for your OS](https://www.manim.community/) |
| 40 | +2) [Fork the Git-Sim codebase](https://github.com/initialcommit-com/git-sim/fork) |
| 41 | +so that you have a copy on GitHub that you can clone and work with |
| 42 | +3) Clone the codebase down to your local machine |
| 43 | +4) For the code to run locally without getting a `ModuleNotFoundError`, |
| 44 | +you need to remove the import prefix `git_sim.` from imports (for example |
| 45 | +`from git_sim_base_command import GitSimBaseCommand`) in the following files: |
| 46 | + |
| 47 | +- __main.py__ |
| 48 | +- git_sim.py |
| 49 | +- git_sim_add.py |
| 50 | +- git_sim_branch.py |
| 51 | +- git_sim_cherrypick.py |
| 52 | +- git_sim_commit.py |
| 53 | +- git_sim_log.py |
| 54 | +- git_sim_merge.py |
| 55 | +- git_sim_rebase.py |
| 56 | +- git_sim_reset.py |
| 57 | +- git_sim_restore.py |
| 58 | +- git_sim_revert.py |
| 59 | +- git_sim_stash.py |
| 60 | +- git_sim_status.py |
| 61 | +- git_sim_tag.py |
| 62 | + |
| 63 | +There is probably a way around this. When I figure it out I'll update this guide. |
| 64 | + |
| 65 | +5) You can run your local Git-Sim commands from within other local repos like this: |
| 66 | + |
| 67 | +``` |
| 68 | +$ python ~/path/to/git-sim/git_sim/__main__.py [global options] <subcommand> [subcommand options] |
| 69 | +``` |
| 70 | + |
| 71 | +For example, you can simulate the `git add` command locally like this: |
| 72 | + |
| 73 | +``` |
| 74 | +$ cd path/to/any/local/git/repo |
| 75 | +$ python ~/path/to/git-sim/git_sim/__main__.py --animate add newfile.txt |
| 76 | +``` |
| 77 | + |
| 78 | +6) After pushing your code changes up to your fork, [submit a pull request](https://github.com/initialcommit-com/git-sim/compare) for me |
| 79 | +to review your code, provide feedback, and integrate it into the codebase! |
| 80 | + |
| 81 | +## Code style guide |
| 82 | + |
| 83 | +Since Git-Sim is a new project, we don't have an official code style set in |
| 84 | +stone. For now just try and make your new code fit in with the existing style |
| 85 | +you find in the codebase, and we'll update this section later if that changes. |
| 86 | + |
| 87 | +## Commit conventions |
| 88 | + |
| 89 | +We have a few simple rules for Git-Sim commit messages: |
| 90 | + |
| 91 | +1) Write commit messages in the [imperative mood](https://initialcommit.com/blog/Git-Commit-Message-Imperative-Mood) |
| 92 | +2) Add a signoff trailer to your commits by using the `-s` flag when you make |
| 93 | +your commits, like this: |
| 94 | + |
| 95 | +``` |
| 96 | +$ git commit -sm "Fixed xyz..." |
| 97 | +``` |
0 commit comments