mergetool: rename bc3 to bc

Beyond Compare version 4 works the same way as version 3, so rename
the existing "bc3" adaptor to just "bc", while keeping "bc3" as a
backward compatible wrapper.

Noticed-by: Olivier Croquette <ocroquette@free.fr>
Helped-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
grep: fix match highlighting for combined patterns with context lines

When git grep is run with combined patterns such as '-e p1 --and -e
p2' and surrounding context lines are requested, the output contains
incorrectly highlighted matches.

Consider the following output (highlighted matches are surrounded by '*'
characters):
    $ cat testfile
    foo a
    foo b
    foo bar
    baz bar foo
    bar x
    bar y
    $ git grep -n -C2 -e foo --and -e bar testfile
    testfile-1-*foo* a
    testfile-2-*foo* b
    testfile:3:*foo* *bar*
    testfile:4:baz *bar* *foo*
    testfile-5-*bar* x
    testfile-6-*bar* y

Lines 1, 2, 5 and 6 do not match the combined patterns, they only
contain incorrectly highlighted 'false positives'.

Modify the show_line() function in grep.c to highlight matches only on
lines that match the combined pattern. Do not highlight matches on lines
that provide only context or contain only the function name of the match.

The output of the same command after the change:
    $ git grep -n -C2 -e foo --and -e bar testfile
    testfile-1-foo a
    testfile-2-foo b
    testfile:3:*foo* *bar*
    testfile:4:baz *bar* *foo*
    testfile-5-bar x
    testfile-6-bar y

Also avoid unnecessary regmatch on lines we do not split by
moving the code to paint a single line piece-by-piece only
to apply to the matched line.

Signed-off-by: Zoltan Klinger <zoltan.klinger@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
push: heed user.signingkey for signed pushes

push --signed promises to take user.signingkey as the signing key but
fails to read the config.

Make it do so.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jk/pack-objects-no-bitmap-when-splitting'

Splitting pack-objects output into multiple packs is incompatible
with the use of reachability bitmap.

* jk/pack-objects-no-bitmap-when-splitting:
  pack-objects: turn off bitmaps when we split packs
Merge branch 'po/doc-status-markup'

Update documentation mark-up.

* po/doc-status-markup:
  doc: fix 'git status --help' character quoting
Merge branch 'rs/run-command-env-array'

Add managed "env" array to child_process to clarify the lifetime
rules.

* rs/run-command-env-array:
  use env_array member of struct child_process
  run-command: add env_array, an optional argv_array for env
Merge branch 'tb/core-filemode-doc'

Doc update.

* tb/core-filemode-doc:
  core.filemode may need manual action
Merge branch 'wk/t1304-wo-USER'

* wk/t1304-wo-USER:
  t1304: Set LOGNAME even if USER is unset or null
Merge branch 'eb/no-pthreads'

Allow us build with NO_PTHREADS=NoThanks compilation option.

* eb/no-pthreads:
  Handle atexit list internaly for unthreaded builds
  pack-objects: set number of threads before checking and warning
  index-pack: fix compilation with NO_PTHREADS
Merge branch 'nd/dir-prep-exclude-cleanup'

Code clean-up.

* nd/dir-prep-exclude-cleanup:
  dir.c: remove the second declaration of "stk" in prep_exclude()
Merge branch 'sb/plug-transport-leak'

Code clean-up.

* sb/plug-transport-leak:
  .mailmap: add Stefan Bellers corporate mail address
  transport: free leaking head in transport_print_push_status()
Merge branch 'jc/push-cert'

* jc/push-cert:
  push: heed user.signingkey for signed pushes
Update draft release notes to 2.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'zk/grep-color-words' into next

"git grep --color" highlighted matching tokens on non-matching
context lines and function name headers, which was unwanted.

* zk/grep-color-words:
  grep: fix match highlighting for combined patterns with context lines
Merge branch 'oc/mergetools-beyondcompare' into next

Version 4 of BeyondCompare works just as well as its version 3 with
mergetool; allow people to say "git mergetool --tool bc" instead of
forcing them to say "git mergetool --tool bc3".

* oc/mergetools-beyondcompare:
  mergetool: rename bc3 to bc
Sync with master

* master:
  Update draft release notes to 2.2
  push: heed user.signingkey for signed pushes
git-merge: Honor pre-merge hook

git-merge does not honor the pre-commit hook when doing automatic merge
commits, and for compatibility reasons this is going to stay.

Introduce a pre-merge hook which is called for an automatic merge commit
just like pre-commit is called for a non-automatic merge commit (or any
other commit).
merge: --no-verify to bypass pre-merge hook

Analogous to commit, introduce a '--no-verify' option which bypasses the
pre-merge hook. The shorthand '-n' is taken by the (non-existing)
'--no-stat' already.
t7503: add tests for pre-merge-hook

Add tests which make sure that the pre-merge-hook is called when
present, allows/disallows merge commits depending on its return value
and is suppressed by "--no-verify".