Skip to content

Commit 00d3278

Browse files
committed
Merge commit 'b319ef7' into jc/maint-fix-test-perm
* commit 'b319ef7': (8132 commits) Add a small patch-mode testing library git-apply--interactive: Refactor patch mode code t8005: Nobody writes Russian in shift_jis Fix severe breakage in "git-apply --whitespace=fix" Update release notes for 1.6.4 After renaming a section, print any trailing variable definitions Make section_name_match start on '[', and return the length on success send-email: detect cycles in alias expansion Show the presence of untracked files in the bash prompt. SunOS grep does not understand -C<n> nor -e Fix export_marks() error handling. git repack: keep commits hidden by a graft Add a test showing that 'git repack' throws away grafted-away parents git branch: clean up detached branch handling git branch: avoid unnecessary object lookups git branch: fix performance problem git svn: fix shallow clone when upstream revision is too new do_one_ref(): null_sha1 check is not about broken ref configure.ac: properly unset NEEDS_SSL_WITH_CRYPTO when sha1 func is missing janitor: useless checks before free ...
2 parents b9b727d + b319ef7 commit 00d3278

File tree

1,466 files changed

+223615
-52971
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,466 files changed

+223615
-52971
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* whitespace=!indent,trail,space
2+
*.[ch] whitespace=indent,trail,space

.gitignore

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
GIT-BUILD-OPTIONS
12
GIT-CFLAGS
23
GIT-GUI-VARS
34
GIT-VERSION-FILE
@@ -7,15 +8,15 @@ git-add--interactive
78
git-am
89
git-annotate
910
git-apply
10-
git-applymbox
11-
git-applypatch
1211
git-archimport
1312
git-archive
1413
git-bisect
14+
git-bisect--helper
1515
git-blame
1616
git-branch
1717
git-bundle
1818
git-cat-file
19+
git-check-attr
1920
git-check-ref-format
2021
git-checkout
2122
git-checkout-index
@@ -26,7 +27,6 @@ git-clone
2627
git-commit
2728
git-commit-tree
2829
git-config
29-
git-convert-objects
3030
git-count-objects
3131
git-cvsexportcommit
3232
git-cvsimport
@@ -36,12 +36,15 @@ git-diff
3636
git-diff-files
3737
git-diff-index
3838
git-diff-tree
39+
git-difftool
40+
git-difftool--helper
3941
git-describe
42+
git-fast-export
4043
git-fast-import
4144
git-fetch
4245
git-fetch--tool
4346
git-fetch-pack
44-
git-findtags
47+
git-filter-branch
4548
git-fmt-merge-msg
4649
git-for-each-ref
4750
git-format-patch
@@ -51,14 +54,14 @@ git-gc
5154
git-get-tar-commit-id
5255
git-grep
5356
git-hash-object
57+
git-help
5458
git-http-fetch
5559
git-http-push
5660
git-imap-send
5761
git-index-pack
5862
git-init
5963
git-init-db
6064
git-instaweb
61-
git-local-fetch
6265
git-log
6366
git-lost-found
6467
git-ls-files
@@ -76,9 +79,9 @@ git-merge-one-file
7679
git-merge-ours
7780
git-merge-recursive
7881
git-merge-resolve
79-
git-merge-stupid
8082
git-merge-subtree
8183
git-mergetool
84+
git-mergetool--lib
8285
git-mktag
8386
git-mktree
8487
git-name-rev
@@ -96,6 +99,7 @@ git-push
9699
git-quiltimport
97100
git-read-tree
98101
git-rebase
102+
git-rebase--interactive
99103
git-receive-pack
100104
git-reflog
101105
git-relink
@@ -109,7 +113,6 @@ git-rev-list
109113
git-rev-parse
110114
git-revert
111115
git-rm
112-
git-runstatus
113116
git-send-email
114117
git-send-pack
115118
git-sh-setup
@@ -119,14 +122,12 @@ git-show
119122
git-show-branch
120123
git-show-index
121124
git-show-ref
122-
git-ssh-fetch
123-
git-ssh-pull
124-
git-ssh-push
125-
git-ssh-upload
125+
git-stage
126+
git-stash
126127
git-status
127128
git-stripspace
129+
git-submodule
128130
git-svn
129-
git-svnimport
130131
git-symbolic-ref
131132
git-tag
132133
git-tar-tree
@@ -140,23 +141,30 @@ git-upload-pack
140141
git-var
141142
git-verify-pack
142143
git-verify-tag
144+
git-web--browse
143145
git-whatchanged
144146
git-write-tree
145147
git-core-*/?*
146148
gitk-wish
147149
gitweb/gitweb.cgi
148150
test-chmtime
151+
test-ctype
149152
test-date
150153
test-delta
151154
test-dump-cache-tree
155+
test-genrandom
152156
test-match-trees
157+
test-parse-options
158+
test-path-utils
159+
test-sha1
160+
test-sigchain
153161
common-cmds.h
154162
*.tar.gz
155163
*.dsc
156164
*.deb
157-
git-core.spec
165+
git.spec
158166
*.exe
159-
*.[ao]
167+
*.[aos]
160168
*.py[co]
161169
config.mak
162170
autom4te.cache
@@ -166,3 +174,6 @@ config.status
166174
config.mak.autogen
167175
config.mak.append
168176
configure
177+
tags
178+
TAGS
179+
cscope*

.mailmap

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,60 @@
55
# same person appearing not to be so.
66
#
77

8+
Alexander Gavrilov <[email protected]>
89
Aneesh Kumar K.V <[email protected]>
10+
Brian M. Carlson <[email protected]>
911
Chris Shoemaker <[email protected]>
12+
Dana L. How <[email protected]>
13+
Dana L. How <[email protected]>
1014
Daniel Barkalow <[email protected]>
15+
David D. Kilzer <[email protected]>
1116
David Kågedal <[email protected]>
17+
David S. Miller <[email protected]>
18+
Dirk Süsserott <[email protected]>
1219
Fredrik Kuivinen <[email protected]>
1320
H. Peter Anvin <[email protected]>
1421
H. Peter Anvin <[email protected]>
1522
H. Peter Anvin <[email protected]>
1623
Horst H. von Brand <[email protected]>
24+
İsmail Dönmez <[email protected]>
25+
Jay Soffian <[email protected]>
1726
Joachim Berdal Haga <[email protected]>
1827
Jon Loeliger <[email protected]>
1928
Jon Seymour <[email protected]>
29+
Jonathan Nieder <[email protected]>
30+
Junio C Hamano <[email protected]>
2031
Karl Hasselström <[email protected]>
2132
Kent Engstrom <[email protected]>
22-
Lars Doelle <[email protected]>
2333
Lars Doelle <lars.doelle@on-line ! de>
34+
Lars Doelle <[email protected]>
35+
2436
Lukas Sandström <[email protected]>
2537
Martin Langhoff <[email protected]>
38+
Michael Coleman <[email protected]>
39+
Michael W. Olson <[email protected]>
40+
Michele Ballabio <[email protected]>
41+
Nanako Shiraishi <[email protected]>
42+
Nanako Shiraishi <[email protected]>
2643
Nguyễn Thái Ngọc Duy <[email protected]>
44+
Philippe Bruhat <[email protected]>
2745
Ramsay Allan Jones <[email protected]>
2846
René Scharfe <[email protected]>
2947
Robert Fitzsimons <[email protected]>
3048
Sam Vilain <[email protected]>
3149
Santi Béjar <[email protected]>
3250
Sean Estabrooks <[email protected]>
3351
Shawn O. Pearce <[email protected]>
52+
Steven Grimm <[email protected]>
3453
Theodore Ts'o <[email protected]>
3554
Tony Luck <[email protected]>
55+
Uwe Kleine-König <[email protected]>
56+
Uwe Kleine-König <[email protected]>
57+
Uwe Kleine-König <[email protected]>
58+
Uwe Kleine-König <[email protected]>
3659
Uwe Kleine-König <[email protected]>
3760
Ville Skyttä <[email protected]>
61+
William Pursell <[email protected]>
3862
YOSHIFUJI Hideaki <[email protected]>
3963
anonymous <[email protected]>
4064
anonymous <[email protected]>

Documentation/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.txt whitespace

Documentation/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
*.xml
22
*.html
3-
*.1
4-
*.7
3+
*.[1-8]
54
*.made
5+
*.texi
6+
git.info
7+
gitman.info
68
howto-index.txt
79
doc.dep
810
cmds-*.txt

Documentation/CodingGuidelines

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
Like other projects, we also have some guidelines to keep to the
2+
code. For git in general, three rough rules are:
3+
4+
- Most importantly, we never say "It's in POSIX; we'll happily
5+
ignore your needs should your system not conform to it."
6+
We live in the real world.
7+
8+
- However, we often say "Let's stay away from that construct,
9+
it's not even in POSIX".
10+
11+
- In spite of the above two rules, we sometimes say "Although
12+
this is not in POSIX, it (is so convenient | makes the code
13+
much more readable | has other good characteristics) and
14+
practically all the platforms we care about support it, so
15+
let's use it".
16+
17+
Again, we live in the real world, and it is sometimes a
18+
judgement call, the decision based more on real world
19+
constraints people face than what the paper standard says.
20+
21+
22+
As for more concrete guidelines, just imitate the existing code
23+
(this is a good guideline, no matter which project you are
24+
contributing to). It is always preferable to match the _local_
25+
convention. New code added to git suite is expected to match
26+
the overall style of existing code. Modifications to existing
27+
code is expected to match the style the surrounding code already
28+
uses (even if it doesn't match the overall style of existing code).
29+
30+
But if you must have a list of rules, here they are.
31+
32+
For shell scripts specifically (not exhaustive):
33+
34+
- We prefer $( ... ) for command substitution; unlike ``, it
35+
properly nests. It should have been the way Bourne spelled
36+
it from day one, but unfortunately isn't.
37+
38+
- We use ${parameter-word} and its [-=?+] siblings, and their
39+
colon'ed "unset or null" form.
40+
41+
- We use ${parameter#word} and its [#%] siblings, and their
42+
doubled "longest matching" form.
43+
44+
- We use Arithmetic Expansion $(( ... )).
45+
46+
- No "Substring Expansion" ${parameter:offset:length}.
47+
48+
- No shell arrays.
49+
50+
- No strlen ${#parameter}.
51+
52+
- No regexp ${parameter/pattern/string}.
53+
54+
- We do not use Process Substitution <(list) or >(list).
55+
56+
- We prefer "test" over "[ ... ]".
57+
58+
- We do not write the noiseword "function" in front of shell
59+
functions.
60+
61+
- As to use of grep, stick to a subset of BRE (namely, no \{m,n\},
62+
[::], [==], nor [..]) for portability.
63+
64+
- We do not use \{m,n\};
65+
66+
- We do not use -E;
67+
68+
- We do not use ? nor + (which are \{0,1\} and \{1,\}
69+
respectively in BRE) but that goes without saying as these
70+
are ERE elements not BRE (note that \? and \+ are not even part
71+
of BRE -- making them accessible from BRE is a GNU extension).
72+
73+
For C programs:
74+
75+
- We use tabs to indent, and interpret tabs as taking up to
76+
8 spaces.
77+
78+
- We try to keep to at most 80 characters per line.
79+
80+
- When declaring pointers, the star sides with the variable
81+
name, i.e. "char *string", not "char* string" or
82+
"char * string". This makes it easier to understand code
83+
like "char *string, c;".
84+
85+
- We avoid using braces unnecessarily. I.e.
86+
87+
if (bla) {
88+
x = 1;
89+
}
90+
91+
is frowned upon. A gray area is when the statement extends
92+
over a few lines, and/or you have a lengthy comment atop of
93+
it. Also, like in the Linux kernel, if there is a long list
94+
of "else if" statements, it can make sense to add braces to
95+
single line blocks.
96+
97+
- We try to avoid assignments inside if().
98+
99+
- Try to make your code understandable. You may put comments
100+
in, but comments invariably tend to stale out when the code
101+
they were describing changes. Often splitting a function
102+
into two makes the intention of the code much clearer.
103+
104+
- Double negation is often harder to understand than no negation
105+
at all.
106+
107+
- Some clever tricks, like using the !! operator with arithmetic
108+
constructs, can be extremely confusing to others. Avoid them,
109+
unless there is a compelling reason to use them.
110+
111+
- Use the API. No, really. We have a strbuf (variable length
112+
string), several arrays with the ALLOC_GROW() macro, a
113+
string_list for sorted string lists, a hash map (mapping struct
114+
objects) named "struct decorate", amongst other things.
115+
116+
- When you come up with an API, document it.
117+
118+
- The first #include in C files, except in platform specific
119+
compat/ implementations, should be git-compat-util.h or another
120+
header file that includes it, such as cache.h or builtin.h.
121+
122+
- If you are planning a new command, consider writing it in shell
123+
or perl first, so that changes in semantics can be easily
124+
changed and discussed. Many git commands started out like
125+
that, and a few are still scripts.
126+
127+
- Avoid introducing a new dependency into git. This means you
128+
usually should stay away from scripting languages not already
129+
used in the git core command set (unless your command is clearly
130+
separate from it, such as an importer to convert random-scm-X
131+
repositories to git).
132+
133+
- When we pass <string, length> pair to functions, we should try to
134+
pass them in that order.

0 commit comments

Comments
 (0)