Skip to content

Commit 25a7850

Browse files
committed
Merge branch 'maint'
* maint: Update draft release notes to 1.7.9.3 CodingGuidelines: do not use 'which' in shell scripts CodingGuidelines: Add a note about spaces after redirection post-receive-email: match up $LOGBEGIN..$LOGEND pairs correctly post-receive-email: remove unused variable
2 parents ff3d656 + b0fa280 commit 25a7850

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

Documentation/CodingGuidelines

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,22 @@ For shell scripts specifically (not exhaustive):
3535

3636
- Case arms are indented at the same depth as case and esac lines.
3737

38+
- Redirection operators should be written with space before, but no
39+
space after them. In other words, write 'echo test >"$file"'
40+
instead of 'echo test> $file' or 'echo test > $file'. Note that
41+
even though it is not required by POSIX to double-quote the
42+
redirection target in a variable (as shown above), our code does so
43+
because some versions of bash issue a warning without the quotes.
44+
3845
- We prefer $( ... ) for command substitution; unlike ``, it
3946
properly nests. It should have been the way Bourne spelled
4047
it from day one, but unfortunately isn't.
4148

49+
- If you want to find out if a command is available on the user's
50+
$PATH, you should use 'type <command>', instead of 'which <command>'.
51+
The output of 'which' is not machine parseable and its exit code
52+
is not reliable across platforms.
53+
4254
- We use POSIX compliant parameter substitutions and avoid bashisms;
4355
namely:
4456

Documentation/RelNotes/1.7.9.3.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,11 @@ Fixes since v1.7.9.2
1414
* "git add --refresh <pathspec>" used to warn about unmerged paths
1515
outside the given pathspec.
1616

17+
* The commit log template given with "git merge --edit" did not have
18+
a short instructive text like what "git commit" gives.
19+
20+
* "gitweb" used to drop warnings in the log file when "heads" view is
21+
accessed in a repository whose HEAD does not point at a valid
22+
branch.
23+
1724
Also contains minor fixes and documentation updates.

contrib/hooks/post-receive-email

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ prep_for_email()
8585
oldrev=$(git rev-parse $1)
8686
newrev=$(git rev-parse $2)
8787
refname="$3"
88-
maxlines=$4
8988

9089
# --- Interpret
9190
# 0000->1234 (create)
@@ -461,7 +460,7 @@ generate_delete_branch_email()
461460
{
462461
echo " was $oldrev"
463462
echo ""
464-
echo $LOGEND
463+
echo $LOGBEGIN
465464
git show -s --pretty=oneline $oldrev
466465
echo $LOGEND
467466
}
@@ -561,7 +560,7 @@ generate_delete_atag_email()
561560
{
562561
echo " was $oldrev"
563562
echo ""
564-
echo $LOGEND
563+
echo $LOGBEGIN
565564
git show -s --pretty=oneline $oldrev
566565
echo $LOGEND
567566
}
@@ -626,7 +625,7 @@ generate_delete_general_email()
626625
{
627626
echo " was $oldrev"
628627
echo ""
629-
echo $LOGEND
628+
echo $LOGBEGIN
630629
git show -s --pretty=oneline $oldrev
631630
echo $LOGEND
632631
}

0 commit comments

Comments
 (0)