pretty: remove reencode_commit_message()

This function has only two callsites, and is a thin wrapper whose
usefulness is dubious.  When the caller needs to learn the log
output encoding, it should be able to do so by directly calling
get_log_output_encoding() and calling the underlying
logmsg_reencode() with it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
format_note(): simplify API

We either stuff the notes message without modification for %N
userformat, or format it for human consumption.  Using two bits
is an overkill that does not benefit anybody.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
pretty: prepare notes message at a centralized place

Instead of passing a boolean show_notes around, pass an optional
string that is to be inserted after the log message proper is shown.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
pretty_print_commit(): do not append notes message

The only case pretty_print_commit() appends notes message to the log
message taken from the commit is when show_log() calls it with the
notes_message field set, and the output format is not the userformat
(i.e. when substituting "%N").  No other users of this function sets
this field in the pretty_print_context, as can be easily verified in
the previous step.

Hoist the code to append the notes message to the caller.

Up to this point, no functionality change is intended.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
format-patch: append --signature after notes

When appending a new signature with "format-patch --signature", if
the "--notes" option is also in effect, the location of the new
signature (and if the signature should be added in the first place)
should be decided using the contents of the original commit log
message, before the message from the notes is added.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
format-patch --notes: show notes after three-dashes

When inserting the note after the commit log message to format-patch
output, add three dashes before the note.  Record the fact that we
did so in the rev_info and omit showing duplicated three dashes in
the usual codepath that is used when notes are not being shown.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jm/diff-context-config' into jch

Teaches a new configuration variable to "git diff" Porcelain and
its friends.

Will merge to 'master' in the first batch after 1.8.0 ships.

* jm/diff-context-config:
  t4055: avoid use of sed 'a' command
  diff: diff.context configuration gives default to -U
Merge branch 'jl/submodule-rm' into jch

"git rm submodule" cannot blindly remove a submodule directory as
its working tree may have local changes, and worse yet, it may even
have its repository embedded in it.  Teach it some special cases
where it is safe to remove a submodule, specifically, when there is
no local changes in the submodule working tree, and its repository
is not embedded in its working tree but is elsewhere and uses the
gitfile mechanism to point at it.

Will merge to 'master' in the second batch after 1.8.0 ships.

* jl/submodule-rm:
  submodule: teach rm to remove submodules unless they contain a git directory
Merge branch 'rc/maint-complete-git-p4' into jch

Comment from Pete will need to be addressed in a follow-up patch.

* rc/maint-complete-git-p4:
  Teach git-completion about git p4
Merge branch 'fa/remote-svn' into jch

A GSoC project.
Will merge to 'master' in the first batch after 1.8.0 ships.

* fa/remote-svn:
  Add a test script for remote-svn
  remote-svn: add marks-file regeneration
  Add a svnrdump-simulator replaying a dump file for testing
  remote-svn: add incremental import
  remote-svn: Activate import/export-marks for fast-import
  Create a note for every imported commit containing svn metadata
  vcs-svn: add fast_export_note to create notes
  Allow reading svn dumps from files via file:// urls
  remote-svn, vcs-svn: Enable fetching to private refs
  When debug==1, start fast-import with "--stats" instead of "--quiet"
  Add documentation for the 'bidi-import' capability of remote-helpers
  Connect fast-import to the remote-helper via pipe, adding 'bidi-import' capability
  Add argv_array_detach and argv_array_free_detached
  Add svndump_init_fd to allow reading dumps from arbitrary FDs
  Add git-remote-testsvn to Makefile
  Implement a remote helper for svn in C
Merge branch 'jl/submodule-add-by-name' into jch

If you remove a submodule, in order to keep the repository so that
"git checkout" to an older commit in the superproject history can
resurrect the submodule, the real repository will stay in $GIT_DIR
of the superproject.  A later "git submodule add $path" to add a
different submodule at the same path will fail.  Diagnose this case
a bit better, and if the user really wants to add an unrelated
submodule at the same path, give the "--name" option to give it a
place in $GIT_DIR of the superproject that does not conflict with
the original submodule.

Will merge to 'master' in the second batch after 1.8.0 ships.

* jl/submodule-add-by-name:
  submodule add: Fail when .git/modules/<name> already exists unless forced
  Teach "git submodule add" the --name option
Merge branch 'bw/config-lift-variable-name-length-limit' into jch

The configuration parser had an unnecessary hardcoded limit on
variable names that was not checked consistently. Lift the limit.

Will merge to 'master' in the first batch after 1.8.0 ships.

* bw/config-lift-variable-name-length-limit:
  Remove the hard coded length limit on variable names in config files
Merge branch 'jk/peel-ref' into jch

Speeds up "git upload-pack" (what is invoked by "git fetch" on the
other side of the connection) by reducing the cost to advertise the
branches and tags that are available in the repository.

Will merge to 'master' in the first batch after 1.8.0 ships.

* jk/peel-ref:
  upload-pack: use peel_ref for ref advertisements
  peel_ref: check object type before loading
  peel_ref: do not return a null sha1
  peel_ref: use faster deref_tag_noverify
Merge branch 'nd/attr-match-optim' into jch

Trivial and obvious optimization for finding attributes that match
a given path.

Will merge to 'master' in the first batch after 1.8.0 ships.

* nd/attr-match-optim:
  attr: avoid searching for basename on every match
  attr: avoid strlen() on every match
Merge branch 'jc/add-delete-default' into jch

"git add dir/" updated modified files and added new files, but does
not notice removed files, which may be "Huh?" to some users.  They
can of course use "git add -A dir/", but why should they?

Resurrected from graveyard, as I thought it was a worthwhile thing
to do in the longer term.

Waiting for comments.

* jc/add-delete-default:
  git add: notice removal of tracked paths by default
Merge branch 'jc/grep-pcre-loose-ends' into jch

"git log -F -E --grep='<ere>'" failed to use the given <ere>
pattern as extended regular expression, and instead looked for the
string literally.  The early part of this series is a fix for it.

Will merge to 'master' in the second batch after 1.8.0 ships.

* jc/grep-pcre-loose-ends:
  log: honor grep.* configuration
  log --grep: accept --basic-regexp and --perl-regexp
  log --grep: use the same helper to set -E/-F options as "git grep"
  revisions: initialize revs->grep_filter using grep_init()
  grep: move pattern-type bits support to top-level grep.[ch]
  grep: move the configuration parsing logic to grep.[ch]
  builtin/grep.c: make configuration callback more reusable
Merge branch 'km/send-email-compose-encoding' into jch

"git send-email --compose" can let the user create a non-ascii
cover letter message, but there was not a way to mark it with
appropriate content type before sending it out.

Will merge to 'master' in the second batch after 1.8.0 ships.

* km/send-email-compose-encoding:
  git-send-email: introduce compose-encoding
Merge branch 'so/prompt-command' into jch

Updates __git_ps1 so that it can be used as $PROMPT_COMMAND,
instead of being used for command substitution in $PS1, to embed
color escape sequences in its output.

* so/prompt-command:
  coloured git-prompt: paint detached HEAD marker in red
  Fix up colored git-prompt
  show color hints based on state of the git tree
  Allow __git_ps1 to be used in PROMPT_COMMAND
Merge branch 'jc/test-say-color-avoid-echo-escape' into jch

Recent nd/wildmatch series was the first to reveal this ancient bug
in the test scaffolding.

Will merge to 'master' in the first batch after 1.8.0 ships.

* jc/test-say-color-avoid-echo-escape:
  test-lib: Fix say_color () not to interpret \a\b\c in the message
Merge branch 'jk/no-more-pre-exec-callback' into jch

(Originally merged to 'next' on 2012-07-23)
Removes a workaround for buggy version of less older than version
406.

Will merge to 'master' in the first batch after 1.8.0 ships.

* jk/no-more-pre-exec-callback:
  pager: drop "wait for output to run less" hack