dir.c:trim_trailing_spaces(): fix for " \ " sequence

Discard the unnecessary 'nr_spaces' variable, remove 'strlen()' and
improve the 'if' structure.  Switch to pointers instead of integers
to control the loop.

Slightly more rare occurrences of 'text  \    ' with a backslash
in between spaces are handled correctly.  Namely, the code in
7e2e4b37 (dir: ignore trailing spaces in exclude patterns, 2014-02-09)
does not reset 'last_space' when a backslash is encountered and the above
line stays intact as a result.

Add a test at the end of t/t0008-ignores.sh to exhibit this behavior.

Signed-off-by: Pasha Bolokhov <pasha.bolokhov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c: change read_ref_at to use the reflog iterators

read_ref_at has its own parsing of the reflog file for no really good reason
so lets change this to use the existing reflog iterators. This removes one
instance where we manually unmarshall the reflog file format.

Remove the now redundant ref_msg function.

Log messages for errors are changed slightly. We no longer print the file
name for the reflog, instead we refer to it as 'Log for ref <refname>'.
This might be a minor useability regression, but I don't really think so, since
experienced users would know where the log is anyway and inexperienced users
would not know what to do about/how to repair 'Log ... has gap ...' anyway.

Adapt the t1400 test to handle the change in log messages.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'mm/pager-less-sans-S'

Since the very beginning of Git, we gave the LESS environment a
default value "FRSX" when we spawn "less" as the pager.  "S" (chop
long lines instead of wrapping) has been removed from this default
set of options, because it is more or less a personal taste thing,
as opposed to others that have good justifications (i.e. "R" is very
much justified because many kinds of output we produce are colored
and "FX" is justified because output we produce is often shorter
than a page).

Existing users who prefer not to see line-wrapped output may want to
set

  $ git config core.pager "less -S"

to restore the traditional behaviour.  It is expected that people
find output from the most subcommands easier to read with the new
default, except for "blame" which tends to produce really long
lines.  To override the new default only for "git blame", you can do
this:

  $ git config pager.blame "less -S"

* mm/pager-less-sans-S:
  pager: remove 'S' from $LESS by default
Merge branch 'jk/commit-C-pick-empty'

"git commit --allow-empty-message -C $commit" did not work when the
commit did not have any log message.

* jk/commit-C-pick-empty:
  commit: do not complain of empty messages from -C
Merge branch 'je/pager-do-not-recurse'

We used to unconditionally disable the pager in the pager process
we spawn to feed out output, but that prevented people who want to
run "less" within "less" from doing so.

* je/pager-do-not-recurse:
  pager: do allow spawning pager recursively
Merge branch 'da/imap-send-use-credential-helper'

"git imap-send" learns to ask the credential helper for
authentication material.

* da/imap-send-use-credential-helper:
  imap-send: use git-credential
Merge branch 'jk/utf8-switch-between-nfd-and-nfc'

Document a known breakage with a test.

* jk/utf8-switch-between-nfd-and-nfc:
  t3910: show failure of core.precomposeunicode with decomposed filenames
Merge branch 'tl/relax-in-poll-emulation'

* tl/relax-in-poll-emulation:
  compat/poll: sleep 1 millisecond to avoid busy wait
Merge branch 'dk/raise-core-deltabasecachelimit'

The `core.deltabasecachelimit` used to default to 16 MiB , but this
proved to be too small, and has been bumped to 96 MiB.

* dk/raise-core-deltabasecachelimit:
  Bump core.deltaBaseCacheLimit to 96m
Merge branch 'jk/squelch-compiler-warning-from-funny-error-macro'

* jk/squelch-compiler-warning-from-funny-error-macro:
  let clang use the constant-return error() macro
  inline constant return from error() function
Merge branch 'fc/status-printf-squelch-format-zero-length-warnings'

* fc/status-printf-squelch-format-zero-length-warnings:
  silence a bunch of format-zero-length warnings
Merge branch 'jk/grep-tell-run-command-to-cd-when-running-pager'

* jk/grep-tell-run-command-to-cd-when-running-pager:
  grep: use run-command's "dir" option for --open-files-in-pager
Merge branch 'tg/tag-state-tag-name-in-editor-hints'

* tg/tag-state-tag-name-in-editor-hints:
  builtin/tag.c: show tag name to hint in the message editor
Merge branch 'rs/reflog-exists'

* rs/reflog-exists:
  checkout.c: use ref_exists instead of file_exist
  refs.c: add new functions reflog_exists and delete_reflog
Merge branch 'dt/merge-recursive-case-insensitive'

On a case insensitive filesystem, merge-recursive incorrectly
deleted the file that is to be renamed to a name that is the same
except for case differences.

* dt/merge-recursive-case-insensitive:
  mv: allow renaming to fix case on case insensitive filesystems
  merge-recursive.c: fix case-changing merge bug
Merge branch 'jn/contrib-remove-diffall'

Spring cleaning of contrib/.

* jn/contrib-remove-diffall:
  contrib: remove git-diffall
Merge branch 'jn/contrib-remove-vim'

Spring cleaning of contrib/.

* jn/contrib-remove-vim:
  contrib: remove vim support instructions
Merge branch 'wg/svn-fe-style-fixes'

* wg/svn-fe-style-fixes:
  svn-fe: conform to pep8
Merge branch 'dk/blame-reorg'

"git blame" has been optimized greatly by reorganising the data
structure that is used to keep track of the work to be done, thanks
to David Karstrup <dak@gnu.org>.

* dk/blame-reorg:
  blame: large-scale performance rewrite
Merge branch 'sk/submodules-absolute-path-on-windows'

* sk/submodules-absolute-path-on-windows:
  Revert "submodules: fix ambiguous absolute paths under Windows"