Merge branch 'jk/send-email-sender-prompt'

General clean-ups in various areas, originally written to support a
patch that later turned out to be unneeded.

* jk/send-email-sender-prompt:
  t9001: check send-email behavior with implicit sender
  t: add tests for "git var"
  ident: keep separate "explicit" flags for author and committer
  ident: make user_ident_explicitly_given static
  t7502: factor out autoident prerequisite
  test-lib: allow negation of prerequisites
Merge branch 'km/send-email-remove-cruft-in-address'

* km/send-email-remove-cruft-in-address:
  git-send-email: allow edit invalid email address
  git-send-email: ask what to do with an invalid email address
  git-send-email: remove invalid addresses earlier
  git-send-email: fix fallback code in extract_valid_address()
  git-send-email: remove garbage after email address
Merge branch 'jc/doc-push-satellite'

* jc/doc-push-satellite:
  Documentation/git-push.txt: clarify the "push from satellite" workflow
Merge branch 'mk/complete-tcsh'

Finishing touches for tcsh completion.

* mk/complete-tcsh:
  Support for git aliasing for tcsh completion
Merge branch 'fc/remote-hg'

New remote helper for hg.

* fc/remote-hg: (22 commits)
  remote-hg: fix for older versions of python
  remote-hg: fix for files with spaces
  remote-hg: avoid bad refs
  remote-hg: try the 'tip' if no checkout present
  remote-hg: fix compatibility with older versions of hg
  remote-hg: add missing config for basic tests
  remote-hg: the author email can be null
  remote-hg: add option to not track branches
  remote-hg: add extra author test
  remote-hg: add tests to compare with hg-git
  remote-hg: add bidirectional tests
  test-lib: avoid full path to store test results
  remote-hg: add basic tests
  remote-hg: fake bookmark when there's none
  remote-hg: add compat for hg-git author fixes
  remote-hg: add support for hg-git compat mode
  remote-hg: match hg merge behavior
  remote-hg: make sure the encoding is correct
  remote-hg: add support to push URLs
  remote-hg: add support for remote pushing
  ...
Merge branch 'lt/diff-stat-show-0-lines'

"git diff --stat" miscounted the total number of changed lines when
binary files were involved and hidden beyond --stat-count.  It also
miscounted the total number of changed files when there were
unmerged paths.

* lt/diff-stat-show-0-lines:
  t4049: refocus tests
  diff --shortstat: do not count "unmerged" entries
  diff --stat: do not count "unmerged" entries
  diff --stat: move the "total count" logic to the last loop
  diff --stat: use "file" temporary variable to refer to data->files[i]
  diff --stat: status of unmodified pair in diff-q is not zero
  test: add failing tests for "diff --stat" to t4049
imap-send: change msg_data from storing (ptr, len) to storing strbuf

struct msg_data stored (ptr, len) of the data to be included in a
message, kept the character data NUL-terminated, etc., much like a
strbuf would do.  So change it to use a struct strbuf.  This makes
the code clearer and reduces copying a little bit.

A side effect of this change is that the memory for each message is
freed after it is used rather than leaked, though that detail is
unimportant given that imap-send is a top-level command.

By the way, there is a bunch of infrastructure in this file for
dealing with IMAP flags, although there is nothing in the code that
actually allows any flags to be set.  If there is no plan to add
support for flags in the future, a bunch of code could be ripped out
and "struct msg_data" could be completely replaced with strbuf, but
that would be a separate topic.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wrap_in_html(): use strbuf_addstr_xml_quoted()

Use the new function to quote characters as they are being added to
buf, rather than quoting them in *p and then copying them into buf.
This increases code sharing, and changes the algorithm from O(N^2) to
O(N) in the number of characters in a line.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'pw/p4-various-fixes'

* pw/p4-various-fixes:
  git p4: remove unneeded cmd initialization
  git p4: fix labelDetails typo in exception
  git p4 test: display unresolvable host error
  git p4: catch p4 errors when streaming file contents
  git p4: handle servers without move support
  git p4: catch p4 describe errors
Update draft release notes to 1.8.1
l10n: Update git.pot (5 new, 1 removed messages)

L10n for git 1.8.1 round 2: Generate po/git.pot from v1.8.0.1-347-gf94c3.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
l10n: vi.po: update to git-v1.8.0.1-347-gf94c3

 * updated all new messages (1979t0f0u)

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
l10n: Update Swedish translation (1979t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
wrap_in_html(): process message in bulk rather than line-by-line

Now that we can xml-quote an arbitrary string in O(N), there is no
reason to process the message line by line.  This change saves lots of
memory allocations and copying.

The old code would have created invalid output when there was no
body, emitting a closing </pre> without a blank line nor an opening
<pre> after the header.  The new code simply returns in this
situation without doing harm (even though either would not make much
sense in the context of imap-send that is meant to send out patches).

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
push: return reject reasons as a bitset

Pass all rejection reasons back from transport_push().  The logic is
simpler and more flexible with regard to providing useful feedback.

Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
push: add advice for rejected tag reference

Advising the user to fetch and merge only makes sense if the rejected
reference is a branch.  If none of the rejections are for branches, just
tell the user the reference already exists.

Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
push: keep track of "update" state separately

If the reference exists on the remote and it is not being removed, then
mark as an update.  This is in preparation for handling tags (lightweight
and annotated) exceptionally.

Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
push: flag updates that require force

Add a flag for indicating an update to a reference requires force.
Currently the `nonfastforward` flag is used for this when generating the
status message.  A separate flag insulates dependent logic from the
details of set_ref_status_for_push().

Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
push: require force for refs under refs/tags/

References are allowed to update from one commit-ish to another if the
former is an ancestor of the latter.  This behavior is oriented to
branches which are expected to move with commits.  Tag references are
expected to be static in a repository, though, thus an update to
something under refs/tags/ should be rejected unless the update is
forced.

Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
push: require force for annotated tags

Do not allow fast-forwarding of references that point to a tag object.
Updating from a tag is potentially destructive since it would likely
leave the tag dangling.  Disallowing updates to a tag also makes sense
semantically and is consistent with the behavior of lightweight tags.

Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>