mirror of
https://github.com/tildeclub/site.git
synced 2026-07-30 09:59:24 +00:00
It is good etiquette to remove whitespaces from files before
committing changes. Adding a section in wiki.md teaching how to do this. Signed-off-by: keyboardan <keyboardan@tilde.club>
This commit is contained in:
@@ -4,6 +4,7 @@ author:
|
|||||||
- benharri
|
- benharri
|
||||||
- audiodude
|
- audiodude
|
||||||
- xwindows
|
- xwindows
|
||||||
|
- keyboardan
|
||||||
category: tilde.club
|
category: tilde.club
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -79,6 +80,26 @@ You can do this right from the Github GUI!
|
|||||||
it. if you're working locally on Tilde.club, you won't have to configure
|
it. if you're working locally on Tilde.club, you won't have to configure
|
||||||
anything; git will use the system's sendmail to handle the email.
|
anything; git will use the system's sendmail to handle the email.
|
||||||
|
|
||||||
|
# Removing unnecessary spaces in git patches is important
|
||||||
|
|
||||||
|
Removing unnecessary whitespace in git patches is a common civilized thing to do when contributing. This makes it easier for people reading or modifying the same file, making it clear what changes are being made, by the patch.
|
||||||
|
|
||||||
|
Before committing a file, do run:
|
||||||
|
|
||||||
|
<!-- This code excerpt need improvement (with process substitution?). Do test your snippet before putting here. -->
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tmpfile=$(mktemp)
|
||||||
|
editedfile="path/to/file-to-commit"
|
||||||
|
|
||||||
|
git stripspace < "$editedfile" > $tmpfile
|
||||||
|
mv $tmpfile "$editedfile"
|
||||||
|
|
||||||
|
unset tmpfile editedfile
|
||||||
|
```
|
||||||
|
|
||||||
|
and you are alright. Do remember doing this.
|
||||||
|
|
||||||
# Most importantly
|
# Most importantly
|
||||||
|
|
||||||
Ask on irc if you have questions!
|
Ask on irc if you have questions!
|
||||||
|
|||||||
Reference in New Issue
Block a user