format-patch: document and test --reroll-count

Signed-off-by: Junio C Hamano <gitster@pobox.com>
format-patch: give --reroll-count a short synonym -v

Accept "-v" as a synonym to "--reroll-count", so that users can say
"git format-patch -v4 master", instead of having to fully spell it
out as "git format-patch --reroll-count=4 master".

As I do not think of a reason why users would want to tell the
command to be "verbose", I think this should be OK.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
test: Add check-non-portable-shell.pl

Add the perl script "check-non-portable-shell.pl" to detect
non-portable shell syntax.

"echo -n" is an example of a shell command working on Linux, but not
on Mac OS X.

These shell commands are checked and reported as error:

 - "echo -n" (printf should be used)
 - "sed -i" (GNUism; use a temp file instead)
 - "declare" (bashism, often used with arrays)
 - "which" (unreliable exit status and output; use type instead)
 - "test a == b" (bashism for "test a = b")

"make test-lint-shell-syntax" can be used to run only the check.

Helped-By: Jeff King <peff@peff.net>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'aw/rebase-am-failure-detection' into jch

Save output from format-patch command in a temporary file, just in
case it aborts, to give a better failure-case behaviour.

Will merge to 'next'.

* aw/rebase-am-failure-detection:
  rebase: Handle cases where format-patch fails
Merge branch 'mz/pick-unborn' into jch

Allows "git cherry-pick $commit" when you do not have any history
behind HEAD yet.

Will merge to 'next'.

* mz/pick-unborn:
  learn to pick/revert into unborn branch
  tests: move test_cmp_rev to test-lib-functions
Merge branch 'ta/remove-stale-translated-tut' into jch

Remove a translation of a document that was left stale.

Will merge to 'next'.

* ta/remove-stale-translated-tut:
  Remove Documentation/pt_BR/gittutorial.txt
Merge branch 'er/stop-recommending-parsecvs' into jch

Stop recommending a defunct third-party software.

Will merge to 'next'.

* er/stop-recommending-parsecvs:
  Remove the suggestion to use parsecvs, which is currently broken.
Merge branch 'as/test-name-alias-uniquely' into jch

A few short-and-bland aliases used in the tests were interfering
with git-custom command in user's $PATH.

Will merge to 'next'.

* as/test-name-alias-uniquely:
  Use longer alias names in subdirectory tests
Merge branch 'jc/maint-fmt-merge-msg-no-edit-lose-credit' into jch

Stop spending cycles to compute information to be placed on
commented lines in "merge --no-edit".

Will merge to 'next'.

* jc/maint-fmt-merge-msg-no-edit-lose-credit:
  merge --no-edit: do not credit people involved in the side branch
Merge branch 'er/python-version-requirements' into jch

Some python scripts we ship cannot be run with old versions of the
interpreter.

Will merge to 'next'.

* er/python-version-requirements:
  Add checks to Python scripts for version dependencies.
Merge branch 'nd/retire-fnmatch' into jch

Replace our use of fnmatch(3) with a more feature-rich wildmatch.
A handful patches at the bottom have been moved to nd/wildmatch to
graduate as part of that branch, before this series solidifies.

Will merge to 'next'.

* nd/retire-fnmatch:
  Makefile: add USE_WILDMATCH to use wildmatch as fnmatch
  wildmatch: advance faster in <asterisk> + <literal> patterns
  wildmatch: make a special case for "*/" with FNM_PATHNAME
  test-wildmatch: add "perf" command to compare wildmatch and fnmatch
  wildmatch: support "no FNM_PATHNAME" mode
  wildmatch: make dowild() take arbitrary flags
  wildmatch: rename constants and update prototype
Merge branch 'os/gitweb-highlight-uncaptured' into jch

Will merge to 'next'.

* os/gitweb-highlight-uncaptured:
  gitweb: fix error in sanitize when highlight is enabled
Merge branch 'tb/test-t9020-no-which' into jch

Will merge to 'next'.

* tb/test-t9020-no-which:
  t9020: which is not portable
Merge branch 'tb/test-t9810-no-sed-i' into jch

Will merge to 'next'.

* tb/test-t9810-no-sed-i:
  t9810: Do not use sed -i
Merge branch 'tb/test-shell-lint' into jch

Check for common mistakes in the test scripts, based on simple
pattern-matching.

Will merge to 'next'.

* tb/test-shell-lint:
  test: Add check-non-portable-shell.pl
Merge branch 'jc/format-patch-reroll' into jch

Teach "format-patch" to prefix v4- to its output files for the
fourth iteration of a patch series, to make it easier for the
submitter to keep separate copies for iterations.

Will merge to 'next'.

* jc/format-patch-reroll:
  format-patch: give --reroll-count a short synonym -v
  format-patch: document and test --reroll-count
  format-patch: add --reroll-count=$N option
  get_patch_filename(): split into two functions
  get_patch_filename(): drop "just-numbers" hack
  get_patch_filename(): simplify function signature
  builtin/log.c: stop using global patch_suffix
  builtin/log.c: drop redundant "numbered_files" parameter from make_cover_letter()
  builtin/log.c: drop unused "numbered" parameter from make_cover_letter()
Merge branch 'ap/status-ignored-in-ignored-directory' into jch

Will merge to 'next'.

* ap/status-ignored-in-ignored-directory:
  git-status: Test --ignored behavior
  dir.c: Make git-status --ignored more consistent
Merge branch 'ap/merge-stop-at-prepare-commit-msg-failure' into jch

"git merge" started calling prepare-commit-msg hook like "git commit"
does some time ago, but forgot to pay attention to the exit status
of the hook.

Will merge to 'next'.
t7505 may want a general clean-up but that is a different topic.

* ap/merge-stop-at-prepare-commit-msg-failure:
  [SQUASH???] avoid depending on POSIXPERM in t7505
  merge: Honor prepare-commit-msg return code
Merge branch 'jc/submittingpatches' into jch

Will merge to 'next'.

* jc/submittingpatches:
  SubmittingPatches: give list and maintainer addresses
  SubmittingPatches: remove overlong checklist
  SubmittingPatches: mention subsystems with dedicated repositories
  SubmittingPatches: who am I and who cares?
Merge branch 'kb/maint-bundle-doc' into jch

Will merge to 'next'.

* kb/maint-bundle-doc:
  Documentation: full-ness of a bundle is significant for cloning
  Documentation: correct example restore from bundle