Skip to content

How to commit Your Code

RM edited this page Jul 27, 2020 · 4 revisions

We host the project on GitHub, so it is recommended you:

  • Get a a GitHub account.
  • Familiarize yourself with Git.

Get a clone

  • Get an account on GitHub.
  • Fork the ET:Legacy repository.
  • Clone your copy locally with git clone https://github.com/yourusername/etlegacy.

Configure git to deal with lines ending

Refer to Dealing with line endings to configure git for your platform.

On Windows:

$ git config --global core.autocrlf true

On Linux and macOS:

$ git config --global core.autocrlf input

Before you push

Uncrustify

Before you do git commit, uncrustify your code. See Coding Conventions.

Rebase

Unless you are about to commit a big change in the code use git pull --rebase to update your local repo. In that way there won't be an unnecessary 'merge' commit when you do git push.

Send us a pull request

  • Do your changes and push to your remote fork of GitHub.
  • Simply send us a pull request.

Using Git

Pulling existing code

Before pushing, pulling code should be done, and ideally with rebasing:

$ git pull --rebase

Merging code

Patches from other developers should be merged automatically using Github's pull requests. If that is not possible, make sure to add --author "First Last <email@example.com>" flag. Only if you are using a small part of other developer's code or the developer does not have a Github account, add "patch by ..." to the commit message.

How to write a commit message

Example:

client: changed xyz, fixes #111

Commit category

The first word in a commit message defines its category in our automatically generated changelog.

Main categories:

  • client - committed code affects only the client part
  • server - committed code affects only the server part
  • mod - committed code affects only the mod code
    • ui
    • cgame
    • game
  • general - committed code affects both
  • misc - committed code is non-specific, e.g. code clean ups, documentation, ...

Referencing commits

The last part of a commit message consists of a hash with a number linking the commit to the issue in the bugtracker.

Using keywords fixes and closes before the hash number will automatically close the issue in the bugtracker.

For example, for issue #1234:

  • Referencing: refs #1234 or simply #1234
  • Fixing: fixes #1234 or closes #1234

Release tag

For release tag, the following formats are used:

  • Release
    • v%i.%i
    • v2.71
  • Patch level
    • v%i.%i.%i
    • v2.71.1