test-lib: reorder and include GIT-BUILD-OPTIONS a lot earlier

This dot-sources GIT-BUILD-OPTIONS a lot earlier in test-lib.sh so
that its use of "perl" can use "$PERL_PATH" to choose the version of
Perl the user told us is suitable for our use.

This is iffy; I didn't check it very carefully, and I would not be
surprised if there are subtle breakages.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Make <refname> documentation more consistent.

Formerly, the documentation for <refname> would occasionally say
<name> instead of <refname>. Now it uniformly uses <refname>.

Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
test-lib.sh: unset XDG_CONFIG_HOME

Now that git respects XDG_CONFIG_HOME for some lookups, we
must be sure to cleanse the test environment. Otherwise, the
user's XDG_CONFIG_HOME could influence the test results.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr: make sure we have an xdg path before using it

If we don't have a core.attributesfile configured, we fall
back to checking XDG config, which is usually
$HOME/.config/git/attributes.

However, if $HOME is unset, then home_config_paths will return
NULL, and we end up calling fopen(NULL).

Depending on your system, this may or may not cause the
accompanying test to fail (e.g., on Linux and glibc, the
address will go straight to open, which will return EFAULT).
However, valgrind will reliably notice the error.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ignore: make sure we have an xdg path before using it

Commit e3ebc35 (config: fix several access(NULL) calls, 2012-07-12) was
fixing access(NULL) calls when trying to access $HOME/.config/git/config,
but missed the ones when trying to access $HOME/.config/git/ignore. Fix
and test this.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t1306: check that XDG_CONFIG_HOME works

This should override $HOME/.config, but we never actually tested it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
rebase -i: handle fixup of root commit correctly

There is a bug with git rebase -i --root when a fixup or squash line is
applied to the new root. We attempt to amend the commit onto which they
apply with git reset --soft HEAD^ followed by a normal commit. Unlike a
real commit --amend, this sequence will fail against a root commit as it
has no parent.

Fix rebase -i to use commit --amend for fixup and squash instead, and
add a test for the case of a fixup of the root commit.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-httpd: handle running under --valgrind

Running the http tests with valgrind does not work for two
reasons:

  1. Apache complains about following the symbolic link from
     git-http-backend to valgrind.sh.

  2. Apache does not pass through the GIT_VALGRIND variable
     to the backend CGI.

This patch fixes both problems. Unfortunately, there is a
slight hack we need to handle passing environment variables
through Apache. If we just tell it:

  PassEnv GIT_VALGRIND

then Apache will complain when GIT_VALGRIND is not set. If
we try:

  SetEnv GIT_VALGRIND ${GIT_VALGRIND}

then when GIT_VALGRIND is not set, it will pass through the
literal "${GIT_VALGRIND}". Instead, we now unconditionally
pass through GIT_VALGRIND from lib-httpd.sh into apache,
even if it is empty.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jk/maint-advise-vaddf'

The advise() function did not use varargs correctly to format
its message.

* jk/maint-advise-vaddf:
  advice: pass varargs to strbuf_vaddf, not strbuf_addf
Merge branch 'jk/maint-commit-check-committer-early'

"git commit --amend" let the user edit the log message and then died
when the human-readable committer name was given insufficiently by
getpwent(3).

* jk/maint-commit-check-committer-early:
  commit: check committer identity more strictly
Merge branch 'jk/maint-commit-document-editmsg'

Document $GIT_DIR/COMMIT_EDITMSG file.

* jk/maint-commit-document-editmsg:
  commit: document the temporary commit message file
Merge branch 'jc/mergetool-tool-help'

"git mergetool" did not support --tool-help option to give the list
of supported backends, like "git difftool" does.

* jc/mergetool-tool-help:
  mergetool: support --tool-help option like difftool does
Update draft release notes to 1.7.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sync with master
Merge branch 'cw/rebase-i-root' into next

* cw/rebase-i-root:
  rebase -i: handle fixup of root commit correctly
Merge branch 'mm/config-xdg' into next

* mm/config-xdg:
  t1306: check that XDG_CONFIG_HOME works
  ignore: make sure we have an xdg path before using it
  attr: make sure we have an xdg path before using it
  test-lib.sh: unset XDG_CONFIG_HOME
Merge branch 'jc/test-lib-source-build-options-early' into next

Reorders t/test-lib.sh so that we dot-source GIT-BUILD-OPTIONS that
records the shell and Perl the user told us to use with Git a lot
early, so that test-lib.sh script itself can use "$PERL_PATH" in
one of its early operations.

* jc/test-lib-source-build-options-early:
  test-lib: reorder and include GIT-BUILD-OPTIONS a lot earlier
Enumerate revision range specifiers in the documentation

It was a bit hard to learn how <rev>^@, <rev>^! and various other
forms of range specifiers are used, because they were discussed
mostly in the prose part of the documentation, unlike various forms
of extended SHA-1 expressions that are listed in an enumerated list.

Also add a few more examples showing use of <rev>, <rev>..<rev> and
<rev>^! forms, stolen from a patch by Max Horn.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'mh/maint-revisions-doc' into next

* mh/maint-revisions-doc:
  Enumerate revision range specifiers in the documentation
  Make <refname> documentation more consistent.
Merge branch 'mh/maint-revisions-doc'

* mh/maint-revisions-doc:
  Enumerate revision range specifiers in the documentation
  Make <refname> documentation more consistent.