Skip to content

Commit 1d17507

Browse files
authored
Add a "Commit history" section to CONTRIBUTING.md (#5022)
I see too many PRs with terrible commit histories; maybe this will help a bit with that.
2 parents aa2bdb0 + 6ff18bb commit 1d17507

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ See [here](./VISION.md) for a set of design principles that we want to consider
1717
## Codebase guide
1818

1919
[This doc](./docs/dev/Codebase_Guide.md) explains:
20-
* what the different packages in the codebase are for
21-
* where important files live
22-
* important concepts in the code
23-
* how the event loop works
24-
* other useful information
20+
21+
- what the different packages in the codebase are for
22+
- where important files live
23+
- important concepts in the code
24+
- how the event loop works
25+
- other useful information
2526

2627
## All code changes happen through Pull Requests
2728

@@ -38,15 +39,26 @@ Please do not raise pull request from your fork's master branch: make a feature
3839

3940
If you've never written Go in your life, then join the club! Lazygit was the maintainer's first Go program, and most contributors have never used Go before. Go is widely considered an easy-to-learn language, so if you're looking for an open source project to gain dev experience, you've come to the right place.
4041

42+
## Commit history
43+
44+
We value a clean and useful commit history, so please take some time to organize your commits so that they make sense. Don't assume that they will be squashed on merge anyway; we don't do that here.
45+
46+
In particular:
47+
48+
- Refactorings and behavior changes should be in separate commits. There are very few exceptions where this is not possible, but in my experience they are very rare.
49+
- Strive for minimal commits; every change that is independent from other changes should be in a commit of its own (with a good commit message that explains why the change is made).
50+
- When you need to iterate over your implementation during review (e.g. because you discovered a bug, or a maintainer requested changes), don't just pile new commits on top. Use fixup commits to make your changes transparent while still maintaining a good commit history. If you don't know what that means, [here's a brief introduction](docs/Fixup_Commits.md).
51+
4152
## Running in a VSCode dev container
4253

4354
If you want to spare yourself the hassle of setting up your dev environment yourself (i.e. installing Go, extensions, and extra tools), you can run the Lazygit code in a VSCode dev container like so:
4455

4556
![image](https://user-images.githubusercontent.com/8456633/201500508-0d55f99f-5035-4a6f-a0f8-eaea5c003e5d.png)
4657

4758
This requires that:
48-
* you have docker installed
49-
* you have the dev containers extension installed in VSCode
59+
60+
- you have docker installed
61+
- you have the dev containers extension installed in VSCode
5062

5163
See [here](https://code.visualstudio.com/docs/devcontainers/containers) for more info about dev containers.
5264

@@ -69,9 +81,10 @@ nix develop
6981
```
7082

7183
This will drop you into a development shell that includes:
72-
* Latest Go toolchain
73-
* golangci-lint for code linting
74-
* git and make
84+
85+
- Latest Go toolchain
86+
- golangci-lint for code linting
87+
- git and make
7588

7689
You can also build and run lazygit using nix:
7790

@@ -143,7 +156,7 @@ Lazygit supports [Nerd Fonts](https://www.nerdfonts.com) to render certain icons
143156

144157
## Internationalisation
145158

146-
Boy that's a hard word to spell. Anyway, lazygit is translated into several languages within the pkg/i18n package.
159+
Boy that's a hard word to spell. Anyway, lazygit is translated into several languages within the pkg/i18n package.
147160

148161
### For developers adding new text
149162

0 commit comments

Comments
 (0)