tests: Introduce test_seq

Jeff King wrote:

	The seq command is GNU-ism, and is missing at least in older BSD
	releases and their derivatives, not to mention antique
	commercial Unixes.

	We already purged it in b3431bc (Don't use seq in tests, not
	everyone has it, 2007-05-02), but a few new instances have crept
	in. They went unnoticed because they are in scripts that are not
	run by default.

Replace them with test_seq that is implemented with a Perl snippet
(proposed by Jeff).  This is better than inlining this snippet
everywhere it's needed because it's easier to read and it's easier
to change the implementation (e.g. to C) if we ever decide to remove
Perl from the test suite.

Note that test_seq is not a complete replacement for seq(1).  It
just has what we need now, in addition that it makes it possible for
us to do something like "test_seq a m" if we wanted to in the
future.

There are also many places that do `for i in 1 2 3 ...` but I'm not sure
if it's worth converting them to test_seq.  That would introduce running
more processes of Perl.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read_index_from: remove bogus errno assignments

These assignments comes from the very first commit e83c516 (Initial
revision of "git", the information manager from hell - 2005-04-07).
Back then we did not die() when errors happened so correct errno was
required.

Since 5d1a5c0 ([PATCH] Better error reporting for "git status" -
2005-10-01), read_index_from() learned to die rather than just return
-1 and these assignments became irrelevant. Remove them.

While at it, move die_errno() next to xmmap() call because it's the
mmap's error code that we care about. Otherwise if close(fd); fails,
it could overwrite mmap's errno.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'nd/index-errno' into next

* nd/index-errno:
  read_index_from: remove bogus errno assignments
Merge branch 'mk/test-seq' into next

Add a compatibility/utility function to the test framework.

* mk/test-seq:
  tests: Introduce test_seq
Makefile: use overridable $(FIND) instead of hard-coded 'find'

The Makefile already offers the variable $(FIND) and uses it except in one
place. Fix it.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jc/mergetool-tool-help' into maint

* jc/mergetool-tool-help:
  mergetool: support --tool-help option like difftool does
Merge branch 'mh/maint-revisions-doc' into maint

* mh/maint-revisions-doc:
  Enumerate revision range specifiers in the documentation
  Make <refname> documentation more consistent.
Merge branch 'jk/maint-checkout-orphan-check-fix' into maint

* jk/maint-checkout-orphan-check-fix:
  checkout: don't confuse ref and object flags
doc: A few minor copy edits.

- (glossary) the quotes around the Wikipedia URL prevented its
  linkification in frontends that support it; remove them

- (manual) newer version (SHA-1) == following, older == preceding, not
  the other way around

- trivial typo and wording fixes

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'rr/doc-commit' into maint

* rr/doc-commit:
  commit: document a couple of options
Merge branch 'rs/git-blame-mapcar-mapc' into maint

* rs/git-blame-mapcar-mapc:
  git-blame.el: use mapc instead of mapcar
Merge branch 'rs/ipv6-ssh-url' into maint

* rs/ipv6-ssh-url:
  git: Wrong parsing of ssh urls with IPv6 literals ignores port
Merge branch 'lm/git-blame-el' into maint

* lm/git-blame-el:
  git-blame.el: Do not use bare 0 to mean (point-min)
  git-blame.el: Use with-current-buffer where appropriate
  git-blame.el: Do not use goto-line in lisp code
Merge branch 'ms/daemon-doc-typo' into maint

* ms/daemon-doc-typo:
  Documentation/git-daemon: add missing word
Merge branch 'jn/make-assembly-in-right-directory' into maint

* jn/make-assembly-in-right-directory:
  Makefile: fix location of listing produced by "make subdir/foo.s"
Merge branch 'jn/block-sha1' into maint

* jn/block-sha1:
  Makefile: BLK_SHA1 does not require fast htonl() and unaligned loads
  block-sha1: put expanded macro parameters in parentheses
  block-sha1: avoid pointer conversion that violates alignment constraints
Prepare for 1.7.11.5

Hopefully that will be the final 1.7.11.x maintenance release.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sync with maint
Drop 1.7.11.x items from 1.7.12 release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'master' into next

* master:
  Drop 1.7.11.x items from 1.7.12 release notes
  Prepare for 1.7.11.5
  doc: A few minor copy edits.
  Makefile: use overridable $(FIND) instead of hard-coded 'find'