Documentation/ToolsForGit.txt: Tools for developing Git
This document gathers tips, scripts and configuration file to help people working on Git’s codebase use their favorite tools while following Git’s coding style. Move the part about Emacs configuration from CodingGuidelines to ToolsForGit.txt because it's the purpose of the new file centralize the information about tools. But, add a mention to Documentation/ToolsForGit.txt in CodingGuidelines because there is also information about the coding style in it. Helped-by: Matthieu Moy <Matthieu.Moy@univ-lyon1.fr> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: COGONI Guillaume <cogoni.guillaume@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
COGONI Guillaume committed
Apr 21, 2022 at 10:45 UTC
7a06a854ee1f167babadb7bdb116fa9c2d3e49eb
3 files changed
+56
-12
Documentation/CodingGuidelines
+4
-12
@@ -43,7 +43,10 @@ the overall style of existing code. Modifications to existing
43
code is expected to match the style the surrounding code already
44
uses (even if it doesn't match the overall style of existing code).
45
46
-But if you must have a list of rules, here they are.
46
+But if you must have a list of rules, here are some language
47
+specific ones. Note that Documentation/ToolsForGit.txt document
48
+has a collection of tips to help you use some external tools
49
+to conform to these guidelines.
50
51
For shell scripts specifically (not exhaustive):
52
@@ -492,17 +495,6 @@ For Perl programs:
495
496
- Learn and use Git.pm if you need that functionality.
497
495
- - For Emacs, it's useful to put the following in
496
- GIT_CHECKOUT/.dir-locals.el, assuming you use cperl-mode:
497
-
498
- ;; note the first part is useful for C editing, too
499
- ((nil . ((indent-tabs-mode . t)
500
- (tab-width . 8)
501
- (fill-column . 80)))
502
- (cperl-mode . ((cperl-indent-level . 8)
503
- (cperl-extra-newline-before-brace . nil)
504
- (cperl-merge-trailing-else . t))))
505
-
498
For Python scripts:
499
500
- We follow PEP-8 (http://www.python.org/dev/peps/pep-0008/).
Documentation/Makefile
+1
@@ -93,6 +93,7 @@ SP_ARTICLES += $(API_DOCS)
93
TECH_DOCS += MyFirstContribution
94
TECH_DOCS += MyFirstObjectWalk
95
TECH_DOCS += SubmittingPatches
96
+TECH_DOCS += ToolsForGit
97
TECH_DOCS += technical/bundle-format
98
TECH_DOCS += technical/hash-function-transition
99
TECH_DOCS += technical/http-protocol
Documentation/ToolsForGit.txt
new
+51
@@ -0,0 +1,51 @@
1
+Tools for developing Git
2
+========================
3
+:sectanchors:
4
+
5
+[[summary]]
6
+== Summary
7
+
8
+This document gathers tips, scripts and configuration file to help people
9
+working on Git's codebase use their favorite tools while following Git's
10
+coding style.
11
+
12
+[[author]]
13
+=== Author
14
+
15
+The Git community.
16
+
17
+[[table_of_contents]]
18
+== Table of contents
19
+
20
+- <<vscode>>
21
+- <<emacs>>
22
+
23
+[[vscode]]
24
+=== Visual Studio Code (VS Code)
25
+
26
+The contrib/vscode/init.sh script creates configuration files that enable
27
+several valuable VS Code features. See contrib/vscode/README.md for more
28
+information on using the script.
29
+
30
+[[emacs]]
31
+=== Emacs
32
+
33
+This is adapted from Linux's suggestion in its CodingStyle document:
34
+
35
+- To follow rules of the CodingGuideline, it's useful to put the following in
36
+GIT_CHECKOUT/.dir-locals.el, assuming you use cperl-mode:
37
+----
38
+;; note the first part is useful for C editing, too
39
+((nil . ((indent-tabs-mode . t)
40
+ (tab-width . 8)
41
+ (fill-column . 80)))
42
+ (cperl-mode . ((cperl-indent-level . 8)
43
+ (cperl-extra-newline-before-brace . nil)
44
+ (cperl-merge-trailing-else . t))))
45
+----
46
+
47
+For a more complete setup, since Git's codebase uses a coding style
48
+similar to the Linux kernel's style, tips given in Linux's CodingStyle
49
+document can be applied here too.
50
+
51
+==== https://www.kernel.org/doc/html/v4.10/process/coding-style.html#you-ve-made-a-mess-of-it