Skip to content

Commit 77f143b

Browse files
committed
Merge 'build-in git-mktree'
* commit '633e3556ccbc': (5835 commits) build-in git-mktree allow -t abbreviation for --track in git branch gitweb: Remove function prototypes (cleanup) Documentation: cloning to empty directory is allowed Clarify kind of conflict in merge-one-file helper git config: clarify --add and --get-color archive-tar.c: squelch a type mismatch warning Start 1.6.4 development Start 1.6.3.1 maintenance series. GIT 1.6.3 t4029: use sh instead of bash t4200: convert sed expression which operates on non-text file to perl t4200: remove two unnecessary lines t/annotate-tests.sh: avoid passing a non-newline terminated file to sed t4118: avoid sed invocation on file without terminating newline t4118: add missing '&&' t8005: use egrep when extended regular expressions are required git-clean doc: the command only affects paths under $(cwd) improve error message in config.c t4018-diff-funcname: add cpp xfuncname pattern to syntax test ...
2 parents cd9519b + 633e355 commit 77f143b

File tree

1,366 files changed

+172957
-45557
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,366 files changed

+172957
-45557
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

.gitignore

Lines changed: 16 additions & 11 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
@@ -10,6 +11,7 @@ git-apply
1011
git-archimport
1112
git-archive
1213
git-bisect
14+
git-bisect--helper
1315
git-blame
1416
git-branch
1517
git-bundle
@@ -25,7 +27,6 @@ git-clone
2527
git-commit
2628
git-commit-tree
2729
git-config
28-
git-convert-objects
2930
git-count-objects
3031
git-cvsexportcommit
3132
git-cvsimport
@@ -35,13 +36,15 @@ git-diff
3536
git-diff-files
3637
git-diff-index
3738
git-diff-tree
39+
git-difftool
40+
git-difftool--helper
3841
git-describe
42+
git-fast-export
3943
git-fast-import
4044
git-fetch
4145
git-fetch--tool
4246
git-fetch-pack
4347
git-filter-branch
44-
git-findtags
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
@@ -110,7 +113,6 @@ git-rev-list
110113
git-rev-parse
111114
git-revert
112115
git-rm
113-
git-runstatus
114116
git-send-email
115117
git-send-pack
116118
git-sh-setup
@@ -120,16 +122,12 @@ git-show
120122
git-show-branch
121123
git-show-index
122124
git-show-ref
123-
git-ssh-fetch
124-
git-ssh-pull
125-
git-ssh-push
126-
git-ssh-upload
125+
git-stage
127126
git-stash
128127
git-status
129128
git-stripspace
130129
git-submodule
131130
git-svn
132-
git-svnimport
133131
git-symbolic-ref
134132
git-tag
135133
git-tar-tree
@@ -143,19 +141,23 @@ git-upload-pack
143141
git-var
144142
git-verify-pack
145143
git-verify-tag
144+
git-web--browse
146145
git-whatchanged
147146
git-write-tree
148147
git-core-*/?*
149148
gitk-wish
150149
gitweb/gitweb.cgi
151-
test-absolute-path
152150
test-chmtime
151+
test-ctype
153152
test-date
154153
test-delta
155154
test-dump-cache-tree
156155
test-genrandom
157156
test-match-trees
157+
test-parse-options
158+
test-path-utils
158159
test-sha1
160+
test-sigchain
159161
common-cmds.h
160162
*.tar.gz
161163
*.dsc
@@ -172,3 +174,6 @@ config.status
172174
config.mak.autogen
173175
config.mak.append
174176
configure
177+
tags
178+
TAGS
179+
cscope*

.mailmap

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,55 @@
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]>
1012
Dana L. How <[email protected]>
1113
Dana L. How <[email protected]>
1214
Daniel Barkalow <[email protected]>
15+
David D. Kilzer <[email protected]>
1316
David Kågedal <[email protected]>
17+
David S. Miller <[email protected]>
18+
Dirk Süsserott <[email protected]>
1419
Fredrik Kuivinen <[email protected]>
1520
H. Peter Anvin <[email protected]>
1621
H. Peter Anvin <[email protected]>
1722
H. Peter Anvin <[email protected]>
1823
Horst H. von Brand <[email protected]>
24+
İsmail Dönmez <[email protected]>
25+
Jay Soffian <[email protected]>
1926
Joachim Berdal Haga <[email protected]>
2027
Jon Loeliger <[email protected]>
2128
Jon Seymour <[email protected]>
29+
Jonathan Nieder <[email protected]>
2230
Junio C Hamano <[email protected]>
2331
Karl Hasselström <[email protected]>
2432
Kent Engstrom <[email protected]>
2533
Lars Doelle <lars.doelle@on-line ! de>
2634
Lars Doelle <[email protected]>
35+
2736
Lukas Sandström <[email protected]>
2837
Martin Langhoff <[email protected]>
2938
Michael Coleman <[email protected]>
39+
Michael W. Olson <[email protected]>
3040
Michele Ballabio <[email protected]>
3141
Nanako Shiraishi <[email protected]>
42+
Nanako Shiraishi <[email protected]>
3243
Nguyễn Thái Ngọc Duy <[email protected]>
44+
Philippe Bruhat <[email protected]>
3345
Ramsay Allan Jones <[email protected]>
3446
René Scharfe <[email protected]>
3547
Robert Fitzsimons <[email protected]>
3648
Sam Vilain <[email protected]>
3749
Santi Béjar <[email protected]>
3850
Sean Estabrooks <[email protected]>
3951
Shawn O. Pearce <[email protected]>
52+
Steven Grimm <[email protected]>
4053
Theodore Ts'o <[email protected]>
4154
Tony Luck <[email protected]>
4255
Uwe Kleine-König <[email protected]>
56+
Uwe Kleine-König <[email protected]>
4357
Uwe Kleine-König <[email protected]>
4458
Uwe Kleine-König <[email protected]>
4559
Uwe Kleine-König <[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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
*.html
33
*.[1-8]
44
*.made
5+
*.texi
6+
git.info
7+
gitman.info
58
howto-index.txt
69
doc.dep
710
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)