Skip to content

Commit 38a1887

Browse files
committed
Merge branch 'maint'
* maint: Better advice on using topic branches for kernel development Documentation: update implicit "--no-index" behavior in "git diff" Documentation: expand 'git diff' SEE ALSO section Documentation: diff can compare blobs Documentation: gitrevisions is in section 7 shell portability: no "export VAR=VAL" CodingGuidelines: reword parameter expansion section Documentation: update-index: -z applies also to --index-info Documentation: No argument of ALLOC_GROW should have side-effects
2 parents 2794ad5 + 352953a commit 38a1887

25 files changed

+79
-68
lines changed

Documentation/CodingGuidelines

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,28 @@ For shell scripts specifically (not exhaustive):
3535
properly nests. It should have been the way Bourne spelled
3636
it from day one, but unfortunately isn't.
3737

38-
- We use ${parameter-word} and its [-=?+] siblings, and their
39-
colon'ed "unset or null" form.
38+
- We use POSIX compliant parameter substitutions and avoid bashisms;
39+
namely:
4040

41-
- We use ${parameter#word} and its [#%] siblings, and their
42-
doubled "longest matching" form.
41+
- We use ${parameter-word} and its [-=?+] siblings, and their
42+
colon'ed "unset or null" form.
4343

44-
- We use Arithmetic Expansion $(( ... )).
44+
- We use ${parameter#word} and its [#%] siblings, and their
45+
doubled "longest matching" form.
4546

46-
- Inside Arithmetic Expansion, spell shell variables with $ in front
47-
of them, as some shells do not grok $((x)) while accepting $(($x))
48-
just fine (e.g. dash older than 0.5.4).
47+
- No "Substring Expansion" ${parameter:offset:length}.
4948

50-
- No "Substring Expansion" ${parameter:offset:length}.
49+
- No shell arrays.
5150

52-
- No shell arrays.
51+
- No strlen ${#parameter}.
5352

54-
- No strlen ${#parameter}.
53+
- No pattern replacement ${parameter/pattern/string}.
5554

56-
- No regexp ${parameter/pattern/string}.
55+
- We use Arithmetic Expansion $(( ... )).
56+
57+
- Inside Arithmetic Expansion, spell shell variables with $ in front
58+
of them, as some shells do not grok $((x)) while accepting $(($x))
59+
just fine (e.g. dash older than 0.5.4).
5760

5861
- We do not use Process Substitution <(list) or >(list).
5962

Documentation/git-cat-file.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ OPTIONS
2727
<object>::
2828
The name of the object to show.
2929
For a more complete list of ways to spell object names, see
30-
the "SPECIFYING REVISIONS" section in linkgit:gitrevisions[1].
30+
the "SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
3131

3232
-t::
3333
Instead of the content, show the object type identified by

Documentation/git-check-ref-format.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ git imposes the following rules on how references are named:
4949
These rules make it easy for shell script based tools to parse
5050
reference names, pathname expansion by the shell when a reference name is used
5151
unquoted (by mistake), and also avoids ambiguities in certain
52-
reference name expressions (see linkgit:gitrevisions[1]):
52+
reference name expressions (see linkgit:gitrevisions[7]):
5353

5454
. A double-dot `..` is often used as in `ref1..ref2`, and in some
5555
contexts this notation means `{caret}ref1 ref2` (i.e. not in

Documentation/git-cherry-pick.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OPTIONS
2121
<commit>...::
2222
Commits to cherry-pick.
2323
For a more complete list of ways to spell commits, see
24-
linkgit:gitrevisions[1].
24+
linkgit:gitrevisions[7].
2525
Sets of commits can be passed but no traversal is done by
2626
default, as if the '--no-walk' option was specified, see
2727
linkgit:git-rev-list[1].

Documentation/git-diff.txt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ tree and the index file, or the index file and the working tree.
2323
further add to the index but you still haven't. You can
2424
stage these changes by using linkgit:git-add[1].
2525
+
26-
If exactly two paths are given, and at least one is untracked,
27-
compare the two files / directories. This behavior can be
28-
forced by --no-index.
26+
If exactly two paths are given and at least one points outside
27+
the current repository, 'git diff' will compare the two files /
28+
directories. This behavior can be forced by --no-index.
2929

3030
'git diff' [--options] --cached [<commit>] [--] [<path>...]::
3131

@@ -64,15 +64,16 @@ forced by --no-index.
6464

6565
Just in case if you are doing something exotic, it should be
6666
noted that all of the <commit> in the above description, except
67-
for the last two forms that use ".." notations, can be any
68-
<tree-ish>.
67+
in the last two forms that use ".." notations, can be any
68+
<tree>. The third form ('git diff <commit> <commit>') can also
69+
be used to compare two <blob> objects.
6970

7071
For a more complete list of ways to spell <commit>, see
71-
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[1].
72+
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
7273
However, "diff" is about comparing two _endpoints_, not ranges,
7374
and the range notations ("<commit>..<commit>" and
7475
"<commit>\...<commit>") do not mean a range as defined in the
75-
"SPECIFYING RANGES" section in linkgit:gitrevisions[1].
76+
"SPECIFYING RANGES" section in linkgit:gitrevisions[7].
7677

7778
OPTIONS
7879
-------
@@ -159,8 +160,12 @@ rewrites (very expensive).
159160

160161
SEE ALSO
161162
--------
162-
linkgit:git-difftool[1]::
163-
Show changes using common diff tools
163+
diff(1),
164+
linkgit:git-difftool[1],
165+
linkgit:git-log[1],
166+
linkgit:gitdiffcore[7],
167+
linkgit:git-format-patch[1],
168+
linkgit:git-apply[1]
164169

165170
Author
166171
------

Documentation/git-fast-import.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ Marks must be declared (via `mark`) before they can be used.
439439
* A complete 40 byte or abbreviated commit SHA-1 in hex.
440440

441441
* Any valid Git SHA-1 expression that resolves to a commit. See
442-
``SPECIFYING REVISIONS'' in linkgit:gitrevisions[1] for details.
442+
``SPECIFYING REVISIONS'' in linkgit:gitrevisions[7] for details.
443443

444444
The special case of restarting an incremental import from the
445445
current branch value should be written as:

Documentation/git-format-patch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ There are two ways to specify which commits to operate on.
3939
that leads to the <since> to be output.
4040

4141
2. Generic <revision range> expression (see "SPECIFYING
42-
REVISIONS" section in linkgit:gitrevisions[1]) means the
42+
REVISIONS" section in linkgit:gitrevisions[7]) means the
4343
commits in the specified range.
4444

4545
The first rule takes precedence in the case of a single <commit>. To

Documentation/git-log.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ OPTIONS
3131
either <since> or <until> is omitted, it defaults to
3232
`HEAD`, i.e. the tip of the current branch.
3333
For a more complete list of ways to spell <since>
34-
and <until>, see linkgit:gitrevisions[1].
34+
and <until>, see linkgit:gitrevisions[7].
3535

3636
--follow::
3737
Continue listing the history of a file beyond renames

Documentation/git-push.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ OPTIONS[[OPTIONS]]
4141
+
4242
The <src> is often the name of the branch you would want to push, but
4343
it can be any arbitrary "SHA-1 expression", such as `master~4` or
44-
`HEAD` (see linkgit:gitrevisions[1]).
44+
`HEAD` (see linkgit:gitrevisions[7]).
4545
+
4646
The <dst> tells which ref on the remote side is updated with this
4747
push. Arbitrary expressions cannot be used here, an actual ref must

Documentation/git-reflog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ see linkgit:git-log[1].
4040
The reflog is useful in various git commands, to specify the old value
4141
of a reference. For example, `HEAD@\{2\}` means "where HEAD used to be
4242
two moves ago", `master@\{one.week.ago\}` means "where master used to
43-
point to one week ago", and so on. See linkgit:gitrevisions[1] for
43+
point to one week ago", and so on. See linkgit:gitrevisions[7] for
4444
more details.
4545

4646
To delete single entries from the reflog, use the subcommand "delete"

0 commit comments

Comments
 (0)