MALLOC_CHECK: various clean-ups

The most important in this change is to avoid affecting anything
when test-lib is used from perf-lib.  It also limits the effect of
the MALLOC_CHECK only to what is run inside the actual test, and
uses a fixed MALLOC_PERTURB_ in order to avoid hurting repeatability
of the tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
rebase -i: fix misleading error message after 'exec no-such' instruction

When the todo sheet of interactive rebase instructs to run a non-existing
command, the operation stops with the following error:

  Execution failed: no-such
  You can fix the problem, and then run

          git rebase --continue

  fatal: 'rebase' appears to be a git command, but we were not
  able to execute it. Maybe git-rebase is broken?

The reason is that the shell that attempted to run the command exits with
code 127. rebase--interactive just forwards this code to the caller (the
git wrapper). But our smart run-command infrastructure detects this
special exit code and turns it into ENOENT, which in turn is interpreted
by the git wrapper as if the external command that it just executed did
not exist. This is finally translated to the misleading last two lines in
error message cited above.

Fix it by translating the error code before it is forwarded.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib: make sure Git has already been built

When tests were run without building git, they stopped with:

    .: 54: Can't open /path/to/git/source/t/../GIT-BUILD-OPTIONS

Move the check that makes sure that git has already been built from
t0000 to test-lib, so that any test will do so before it runs.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'rs/archive-zip-utf8' into jch

Need help from people on platforms on which Zip matters to see
compatiblity with other people's zip implementations.

Will merge to 'master' as part of the sixth batch.

* rs/archive-zip-utf8:
  archive-zip: declare creator to be Unix for UTF-8 paths
  archive-zip: support UTF-8 paths
  Revert "archive-zip: support UTF-8 paths"
  archive-zip: support UTF-8 paths
Merge branch 'mh/fetch-filter-refs' into jch

* mh/fetch-filter-refs:
  string_list API: document what "sorted" means
Merge branch 'jk/no-more-pre-exec-callback' into pu

(Originally merged to 'next' on 2012-07-23)

Will defer until the end of the 2012.
while waiting for older "less" to go extinct.

* jk/no-more-pre-exec-callback:
  pager: drop "wait for output to run less" hack
Merge branch 'fa/remote-svn' into pu

A GSoC project.  Looked promising.
Waiting for comments from mentors and stakeholders.

* 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 and .gitignore
  Implement a remote helper for svn in C
Merge branch 'fa/vcs-svn' into pu

A GSoC project.  Looked promising.
Waiting for comments from mentors and stakeholders.

* fa/vcs-svn:
  vcs-svn: remove repo_tree
  vcs-svn/svndump: rewrite handle_node(), begin|end_revision()
  vcs-svn/svndump: restructure node_ctx, rev_ctx handling
  svndump: move struct definitions to .h
Merge branch 'rt/maint-clone-single' into pu

Running "git fetch" in a repository made with "git clone --single"
slurps all the branches, defeating the point of "--single".

Reroll posted but haven't picked it up yet.

* rt/maint-clone-single:
  fixup! check what we really care about in a more direct way
  clone --single: limit the fetch refspec to fetched branch
Merge branch 'ep/malloc-check-perturb' into pu

* ep/malloc-check-perturb:
  MALLOC_CHECK: various clean-ups
  Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for detecting heap corruption
Merge branch 'aj/xfuncname-ada' into pu

* aj/xfuncname-ada:
  Add userdiff patterns for Ada
Merge branch 'aw/rebase-i-edit-todo' into pu

* aw/rebase-i-edit-todo:
  rebase -i: Add tests for "--edit-todo"
  rebase -i: Teach "--edit-todo" action
  rebase -i: Refactor help messages for todo file
  rebase usage: subcommands can not be combined with -i
Merge branch 'jc/add-delete-default' into pu

"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/maint-name-rev' into pu

"git name-rev" names the given revision based on a ref that can be
reached in the smallest number of steps from the rev, but that is
not useful when the caller wants to know which tag is the oldest one
that contains the rev.  This teaches a new mode to the command that
uses the oldest ref among those which contain the rev.

I am not sure if this is worth it; for one thing, even with the help
from notes-cache, it seems to make the "describe --contains" even
slower. Also the command will be unusably slow for a user who does
not have a write access (hence unable to create or update the
notes-cache).

* jc/maint-name-rev:
  describe --contains: use "name-rev --algorithm=weight"
  name-rev --algorithm=weight: tests and documentation
  name-rev --algorithm=weight: cache the computed weight in notes
  name-rev --algorithm=weight: trivial optimization
  name-rev: --algorithm option
  name_rev: clarify the logic to assign a new tip-name to a commit
  name-rev: lose unnecessary typedef

Conflicts:
	builtin/name-rev.c
Merge branch 'tx/relative-in-the-future' into pu

Not my itch; rewritten an earlier submission by Tom Xue into
somewhat more maintainable form, though it breaks existing i18n.

Waiting for a voluteer to fix it up.
Otherwise may discard.

* tx/relative-in-the-future:
  date: show relative dates in the future
  date: refactor the relative date logic from presentation
Merge branch 'jc/maint-push-refs-all' into pu

Allows pushing and fetching everything including refs/stash.
This is broken (see the log message there).

Not ready.

* jc/maint-push-refs-all:
  get_fetch_map(): tighten checks on dest refs
  [BROKEN] fetch/push: allow refs/*:refs/*
Merge branch 'jx/test-real-path' into pu

Running tests with the "trash" directory elsewhere with the "--root"
option did not work well if the directory was specified by a symbolic
link pointing at it.

Seems broken as it makes $(pwd) and TRASH_DIRECTORY inconsistent.
Needs rerolling.

* jx/test-real-path:
  test: set the realpath of CWD as TRASH_DIRECTORY
Merge branch 'ms/contrib-thunderbird-updates' into pu

Update helper to send out format-patch output using Thunderbird.
Seems to have design regression for silent users.

* ms/contrib-thunderbird-updates:
  [SQUASH] minimum fixup
  Thunderbird: fix appp.sh format problems
Merge branch 'mb/remote-default-nn-origin' into pu

When the user does not specify what remote to interact with, we
often attempt to use 'origin'.  This can now be customized via a
configuration variable.

Expecting a reroll.

"The first remote becomes the default" bit is better done as a
separate step.

* mb/remote-default-nn-origin:
  Teach get_default_remote to respect remote.default.
  Test that plain "git fetch" uses remote.default when on a detached HEAD.
  Teach clone to set remote.default.
  Teach "git remote" about remote.default.
  Teach remote.c about the remote.default configuration setting.
  Rename remote.c's default_remote_name static variables.

Conflicts:
	builtin/remote.c
	t/t5505-remote.sh
Merge branch 'jc/split-blob' into pu

Not ready.

I finished the streaming checkout codepath, but as explained in
127b177 (bulk-checkin: support chunked-object encoding, 2011-11-30),
these are still early steps of a long and painful journey. At least
pack-objects and fsck need to learn the new encoding for the series
to be usable locally, and then index-pack/unpack-objects needs to
learn it to be used remotely.

Given that I heard a lot of noise that people want large files, and
that I was asked by somebody at GitTogether'11 privately for an
advice on how to pay developers (not me) to help adding necessary
support, I am somewhat dissapointed that the original patch series
that was sent long time ago still remains here without much comments
and updates from the developer community. I even made the interface
to the logic that decides where to split chunks easily replaceable,
and I deliberately made the logic in the original patch extremely
stupid to entice others, especially the "bup" fanbois, to come up
with a better logic, thinking that giving people an easy target to
shoot for, they may be encouraged to help out. The plan is not
working :-<.

* jc/split-blob:
  chunked-object: streaming checkout
  chunked-object: fallback checkout codepaths
  bulk-checkin: support chunked-object encoding
  bulk-checkin: allow the same data to be multiply hashed
  new representation types in the packstream
  packfile: use varint functions

Conflicts:
	builtin/pack-objects.c
	streaming.c
	t/t1050-large.sh