Skip to content

Commit 7ec4a9e

Browse files
committed
Merge branch 'cg/tools-for-git-doc'
A new doc that lists tips for tools to work with Git's codebase. * cg/tools-for-git-doc: Documentation/ToolsForGit.txt: Tools for developing Git
2 parents f49c478 + 7a06a85 commit 7ec4a9e

File tree

3 files changed

+56
-12
lines changed

3 files changed

+56
-12
lines changed

Documentation/CodingGuidelines

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ the overall style of existing code. Modifications to existing
4343
code is expected to match the style the surrounding code already
4444
uses (even if it doesn't match the overall style of existing code).
4545

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.
4750

4851
For shell scripts specifically (not exhaustive):
4952

@@ -492,17 +495,6 @@ For Perl programs:
492495

493496
- Learn and use Git.pm if you need that functionality.
494497

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-
506498
For Python scripts:
507499

508500
- We follow PEP-8 (http://www.python.org/dev/peps/pep-0008/).

Documentation/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ SP_ARTICLES += $(API_DOCS)
9393
TECH_DOCS += MyFirstContribution
9494
TECH_DOCS += MyFirstObjectWalk
9595
TECH_DOCS += SubmittingPatches
96+
TECH_DOCS += ToolsForGit
9697
TECH_DOCS += technical/bundle-format
9798
TECH_DOCS += technical/hash-function-transition
9899
TECH_DOCS += technical/http-protocol

Documentation/ToolsForGit.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)