1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 14:57:52 +01:00
Commit graph

17413 commits

Author SHA1 Message Date
Johannes Schindelin
5caa81d1b4 valgrind: do not require valgrind 3.4.0 or newer
Valgrind 3.4.0 is pretty new, and even if --track-origins is a nice
feature, it is not the end of the world if that is not available.  So
play nice and use that option only when only an older version of
valgrind is available.

In the same spirit, refrain from the use of '...' in suppression
files, which is also a feature only valgrind 3.4 and newer understand.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-05 17:48:22 -08:00
Johannes Schindelin
a6d63b7493 test-lib: avoid assuming that templates/ are in the GIT_EXEC_PATH
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 22:01:26 -08:00
Johannes Schindelin
3da9365234 Tests: let --valgrind imply --verbose and --tee
It does not make much sense to run the (expensive) valgrind tests and
not look at the output.

To prevent output from scrolling out of reach, the parameter --tee is
implied, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 22:01:23 -08:00
Johannes Schindelin
268fac6919 Add a script to coalesce the valgrind outputs
After running the valgrind tests with GIT_TEST_TREE=t, the test output
is in the test-results/$TEST.out files.

Call ./valgrind/analyze.sh in $GIT_ROOT/t/ to group the valgrind errors
by backtrace.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 22:01:18 -08:00
Johannes Schindelin
7f6fdea119 t/Makefile: provide a 'valgrind' target
It is easy to forget running valgrinded tests without -v, and it is
also easy to forget to redirect the output to "tee" (lest the output
scroll out of the terminal's buffer).  Running "make valgrind" will
take care of all that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 22:01:14 -08:00
Johannes Schindelin
44138559e8 test-lib.sh: optionally output to test-results/$TEST.out, too
When tests are run in parallel and a few tests fail, it does not help
that the output of the terminal is totally confusing, as you rarely know
which test which line came from.

So introduce the option '--tee' which triggers that the output of the
tests will be written to t/test-results/$TEST.out in addition to the
terminal, where $TEST is the basename of the script.

Unfortunately, there seems to be no way to redirect a given file
descriptor to a specified subprocess in POSIX shell, only redirection
to a file is supported via 'exec > $FILE'.

At least with bash, one might think that 'exec >($COMMAND)' would work
as intended, but it does not.

The common way to work around the lack of proper tools support is to
work with named pipes, alas, one of our most beloved platforms does not
really support named pipes.  Besides, we would need a pipe for every
script, as the whole point of this patch is to allow parallel execution.

Therefore, we handle the redirection in the following way: when '--tee'
was passed to the test script, the variable GIT_TEST_TEE_STARTED is set
(to avoid triggering that code path again) and the script is started
_again_, in a subshell, redirected to the command "tee".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 22:01:09 -08:00
Johannes Schindelin
efd92ffd31 Valgrind support: check for more than just programming errors
This patch makes --valgrind try to override _all_ Git binaries in the
PATH, and it makes it an error to call *.sh and *.perl scripts directly.

While it is not strictly necessary to look through the whole PATH to
find git binaries to override, it is in line with running an expensive
test (which valgrind is) to make extra sure that only binaries are
tested that actually come from the git.git checkout.

In the same spirit, we can test that neither our test suite nor our
scripts try to run the *.sh or *.perl scripts directly.

It's more like a "because we can" than a "this is tightly connected
to valgrind", but in the author's opinion "because we can" is "so we
should" in this case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 22:01:06 -08:00
Jeff King
6a7e37c99f valgrind: ignore ldso and more libz errors
On some Linux systems, we get a host of Cond and Addr errors
from calls to dlopen that are caused by nss modules. We
should be able to safely ignore anything happening in
ld-*.so as "not our problem."

[Johannes: I added some more... unfortunately using valgrind 3.4.0 syntax]

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 22:01:02 -08:00
Johannes Schindelin
4e1be63c3b Add valgrind support in test scripts
This patch adds the ability to use valgrind's memcheck tool to
diagnose memory problems in Git while running the test scripts.

It requires valgrind 3.4.0 or newer.

It works by creating symlinks to a valgrind script, which have the same
name as our Git binaries, and then putting that directory in front of
the test script's PATH as well as set GIT_EXEC_PATH to that directory.
Git scripts are symlinked from that directory directly.

That way, Git binaries called by Git scripts are valgrinded, too.

Valgrind can be used by specifying "GIT_TEST_OPTS=--valgrind" in the
make invocation. Any invocation of git that finds any errors under
valgrind will exit with failure code 126. Any valgrind output will go
to the usual stderr channel for tests (i.e., /dev/null, unless -v has
been specified).

If you need to pass options to valgrind -- you might want to run
another tool than memcheck, for example -- you can set the environment
variable GIT_VALGRIND_OPTIONS.

A few default suppressions are included, since libz seems to trigger
quite a few false positives. We'll assume that libz works and that we
can ignore any errors which are reported there.

Note: it is safe to run the valgrind tests in parallel, as the links in
t/valgrind/bin/ are created using proper locking.

Initial patch and all the hard work by Jeff King.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 22:00:58 -08:00
Junio C Hamano
e656fc97a2 tests: fix test_commit() for case insensitive filesystems
Brian Gernhardt noticed that t3411 was broken recently on case insensitive
filesystems.

0088496 (test-lib.sh: introduce test_commit() and test_merge() helpers,
2009-01-27) used a tag and a file with the same name, only different in
case, and converted many existing tests that needed only a file (or a
tag).

Some tests may want to refer to a rev or a file, but on a filesystem that
loses cases, referring to either without disambiguation mark ("--") on the
command line now triggers an error (t3411 was the only one such test).

Fix it by using a filename that is different from the tagname each step
creates.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 21:50:47 -08:00
Junio C Hamano
61d86605dd t3412: further simplify setting of GIT_EDITOR
2182896 (t3412: clean up GIT_EDITOR usage, 2009-01-30) tried to clean up
the script's use of GIT_EDITOR, but it can further be simplified, because
that is how test-lib.sh sets things up already.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 21:07:11 -08:00
Junio C Hamano
bd9efbf354 Merge branch 'maint'
* maint:
  grep: pass -I (ignore binary) down to external grep
2009-02-03 00:32:34 -08:00
Junio C Hamano
281907574c Merge branch 'maint-1.6.0' into maint
* maint-1.6.0:
  grep: pass -I (ignore binary) down to external grep
2009-02-03 00:32:29 -08:00
Junio C Hamano
f39e4cfa2e Merge branch 'jc/maint-add-u-remove-conflicted'
* jc/maint-add-u-remove-conflicted:
  add -u: do not fail to resolve a path as deleted
2009-02-03 00:26:17 -08:00
Junio C Hamano
1487eb68f7 Merge branch 'jk/maint-cleanup-after-exec-failure'
* jk/maint-cleanup-after-exec-failure:
  git: use run_command() to execute dashed externals
  run_command(): help callers distinguish errors
  run_command(): handle missing command errors more gracefully
  git: s/run_command/run_builtin/
2009-02-03 00:26:12 -08:00
Junio C Hamano
bc395643b6 grep: pass -I (ignore binary) down to external grep
We forgot to pass this option to the external grep process.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-02 10:58:20 -08:00
Thomas Rast
2ea3c17189 t3412: use log|name-rev instead of log --graph
Replace all 'git log --graph' calls for history verification with the
combination of 'git log ...| git name-rev' first introduced by a6c7a27
(rebase -i: correctly remember --root flag across --continue,
2009-01-26).  This should be less susceptible to format changes than
the --graph code.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-01 18:54:04 -08:00
Jakub Narebski
e80f97e20c gitweb: Update README that gitweb works better with PATH_INFO
One had to configure gitweb for it to find static files (stylesheets,
images) when using path_info URLs.  Now that it is not necessary
thanks to adding BASE element to HTML head if needed, update README to
reflect this fact.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-01 18:33:51 -08:00
Kirill Smelkov
08e6710f76 mailinfo: cleanup extra spaces for complex 'From:'
currently for cases like

    From: A U Thor <a.u.thor@example.com> (Comment)

mailinfo extracts the following 'Author:' field:

    Author: A U Thor   (Comment)
                     ^^
which has two extra spaces left in there after removed email part.

I think this is wrong so here is a fix.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-01 12:11:15 -08:00
Junio C Hamano
c0f6f67b3d Merge branch 'ks/maint-mailinfo-folded'
* ks/maint-mailinfo-folded:
  mailinfo: tests for RFC2047 examples
  mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)'
  mailinfo: 'From:' header should be unfold as well
  mailinfo: correctly handle multiline 'Subject:' header
2009-01-31 18:09:17 -08:00
Junio C Hamano
15b8e94aee Merge branch 'jc/maint-apply-fix'
* jc/maint-apply-fix:
  builtin-apply.c: do not set bogus mode in check_preimage() for deleted path
2009-01-31 18:08:58 -08:00
Junio C Hamano
32f2f11f39 Merge branch 'am/maint-push-doc'
* am/maint-push-doc:
  Documentation: rework src/dst description in git push
  Documentation: more git push examples
  Documentation: simplify refspec format description
2009-01-31 18:08:31 -08:00
Junio C Hamano
2d40cadc25 Merge branch 'jc/maint-allow-uninteresting-missing'
* jc/maint-allow-uninteresting-missing:
  revision traversal: allow UNINTERESTING objects to be missing
2009-01-31 18:08:22 -08:00
Junio C Hamano
b37f26d8a2 Merge branch 'jg/tag-contains'
* jg/tag-contains:
  git-tag: Add --contains option
  Make has_commit() non-static
  Make opt_parse_with_commit() non-static
2009-01-31 18:07:59 -08:00
Junio C Hamano
29254142dd Merge branch 'js/maint-rebase-i-submodule'
* js/maint-rebase-i-submodule:
  Fix submodule squashing into unrelated commit
  rebase -i squashes submodule changes into unrelated commit
2009-01-31 18:07:55 -08:00
Junio C Hamano
bdf6442b48 Merge branch 'jc/maint-split-diff-metainfo'
* jc/maint-split-diff-metainfo:
  diff.c: output correct index lines for a split diff
2009-01-31 18:07:42 -08:00
Junio C Hamano
ed096c4a23 Merge branch 'sp/runtime-prefix'
* sp/runtime-prefix:
  Windows: Revert to default paths and convert them by RUNTIME_PREFIX
  Compute prefix at runtime if RUNTIME_PREFIX is set
  Modify setup_path() to only add git_exec_path() to PATH
  Add calls to git_extract_argv0_path() in programs that call git_config_*
  git_extract_argv0_path(): Move check for valid argv0 from caller to callee
  Refactor git_set_argv0_path() to git_extract_argv0_path()
  Move computation of absolute paths from Makefile to runtime (in preparation for RUNTIME_PREFIX)
2009-01-31 17:43:59 -08:00
Junio C Hamano
fa5bc8abb3 Merge branch 'jk/signal-cleanup'
* jk/signal-cleanup:
  t0005: use SIGTERM for sigchain test
  pager: do wait_for_pager on signal death
  refactor signal handling for cleanup functions
  chain kill signals for cleanup functions
  diff: refactor tempfile cleanup handling
  Windows: Fix signal numbers
2009-01-31 17:43:56 -08:00
Junio C Hamano
2edefe38a8 Merge branch 'jg/mergetool'
* jg/mergetool:
  mergetool: Don't repeat merge tool candidates
2009-01-31 17:43:28 -08:00
Junio C Hamano
ddebfd1f27 Merge branch 'maint'
* maint:
  merge: fix out-of-bounds memory access
2009-01-31 17:42:26 -08:00
Junio C Hamano
6ac92294b3 Merge branch 'maint-1.6.0' into maint
* maint-1.6.0:
  merge: fix out-of-bounds memory access
2009-01-31 17:42:17 -08:00
David Aguilar
99ccabaffa contrib/difftool: Don't repeat merge tool candidates
git difftool listed some candidates for mergetools twice, depending on
the environment.

This slightly changes the behavior when both KDE_FULL_SESSION and
GNOME_DESKTOP_SESSION_ID are set at the same time; in such a case
meld is used in favor of kdiff3 (the old code favored kdiff3 in such a
case), but it should not matter in practice.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31 17:35:06 -08:00
Markus Heidelberg
384770a5e7 contrib/difftool: add support for Kompare
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31 17:34:58 -08:00
René Scharfe
c7cddc1a2f merge: fix out-of-bounds memory access
The parameter n of unpack_callback() can have a value of up to
MAX_UNPACK_TREES.  The check at the top of unpack_trees() (its only
(indirect) caller) makes sure it cannot exceed this limit.

unpack_callback() passes it and the array src to unpack_nondirectories(),
which has this loop:

	for (i = 0; i < n; i++) {
		/* ... */
		src[i + o->merge] = o->df_conflict_entry;

o->merge can be 0 or 1, so unpack_nondirectories() potentially accesses
the array src at index MAX_UNPACK_TREES.  This patch makes it big enough.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31 10:39:55 -08:00
Thomas Rast
2182896440 t3412: clean up GIT_EDITOR usage
a6c7a27 (rebase -i: correctly remember --root flag across --continue,
2009-01-26) introduced a more portable GIT_EDITOR usage, but left the
old tests unchanged.

Since we never use the editor (all tests run the rebase script as
proposed by rebase -i), just disable it outright, which simplifies the
tests.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 21:11:59 -08:00
Michele Ballabio
3fe2bf2fa7 git-shortlog.txt: fix example about .mailmap
In the example, Joe Developer has <joe@example.com> as his email,
but in the .mailmap is <joe@random.com>. Use example.com instead.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 21:11:50 -08:00
Stefan Karpinski
ad8c3477b8 git-cvsserver: run post-update hook *after* update.
CVS server was running the hook before the update action was
actually done. This performs the update before the hook is called.

The original commit that introduced the current incorrect behavior
was 394d66d "git-cvsserver runs hooks/post-update". The error in
ordering of the hook call appears to have gone unnoticed, but since
git-cvsserver is supposed to emulate receive-pack, it stands to
reason that the hook should be run *after* the update. Since this
behavior is inconsistent with recieve-pack, users are either:

  1) not using post-update hooks with git-cvsserver;
  2) using post-update hooks that don't care whether they are
     called before or after the actual update occurs;
  3) using post-update hooks *only* with git-cvsserver, and
     relying on the hook being called just before the update.

This patch would affect only users in case 3. These users are
depending on fairly obviously wrong behavior, and moreover they can
simply change their current post-update into post-recieve hooks,
and their systems will work correctly again.

Signed-off-by: Stefan Karpinski <stefan.karpinski@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 21:11:46 -08:00
Johannes Schindelin
418566b6fd Fix 'git diff --no-index' with a non-existing symlink target
When trying to find out mode changes, we should not access the symlink
targets using stat(); instead we use lstat() so that the diff does
not fail trying to find a non-existing symlink target.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 21:11:24 -08:00
Giuseppe Bilotta
41a4d16e20 gitweb: align comments to code
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 21:08:49 -08:00
Giuseppe Bilotta
0dbf027ad2 gitweb: webserver config for PATH_INFO
Document some possible Apache configurations when the path_info feature
is enabled in gitweb.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 21:08:30 -08:00
Giuseppe Bilotta
c3254aeecf gitweb: make static files accessible with PATH_INFO
Gitweb links to a number of static files such as CSS stylesheets,
favicon or the git logo. When, such as with the default Makefile, the
paths to these files are relative (i.e. doesn't start with a "/"), the
files become inaccessible in any view other tha project list and summary
page if gitweb is invoked with a non-empty PATH_INFO.

Fix this by adding a <base> element pointing to the script's own URL,
which ensure that all relative paths will be resolved correctly.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 21:08:24 -08:00
Stefan Karpinski
499cc56a60 git-cvsserver: handle CVS 'noop' command.
The CVS protocol documentation, found at

  http://www.wandisco.com/techpubs/cvs-protocol.pdf

states the following about the 'noop' command:

  Response expected: yes. This request is a null command
  in the sense that it doesn't do anything, but merely
  (as with any other requests expecting a response) sends
  back any responses pertaining to pending errors, pending
  Notified responses, etc.

In accordance with this, the correct way to handle the 'noop'
command, when issued by a client, is to call req_EMPTY.

The 'noop' command is called by some CVS clients, notably
TortoiseCVS, thus making it desirable for git-cvsserver to
respond to the command rather than choking on it as unknown.

Signed-off-by: Stefan Karpinski <stefan.karpinski@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 21:06:27 -08:00
Jeff King
0ea8039644 t0005: use SIGTERM for sigchain test
The signal tests consists of checking that each of our
handlers is executed, and that the test program was killed
by the final signal. We arbitrarily used SIGINT as the kill
signal.

However, some platforms (notably Solaris) will default
SIGINT to SIG_IGN if there is no controlling terminal. In
that case, we don't end up killing the program with the
final signal and the test fails.

This is a problem since the test script should not depend
on outside factors; let's use SIGTERM instead, which should
behave consistently.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30 01:14:26 -08:00
Junio C Hamano
a34a9dbbce Update draft release notes to 1.6.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-29 00:57:42 -08:00
Junio C Hamano
8c95d3c31b Sync with 1.6.1.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-29 00:32:52 -08:00
Junio C Hamano
b296e8fce6 GIT 1.6.1.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-29 00:12:52 -08:00
Junio C Hamano
a9ed6ce0e7 Merge branch 'jc/maint-format-patch-o-relative' into maint
* jc/maint-format-patch-o-relative:
  Teach format-patch to handle output directory relative to cwd

Conflicts:
	t/t4014-format-patch.sh
2009-01-28 23:56:13 -08:00
Junio C Hamano
9530eb1db8 Merge branch 'bs/maint-rename-populate-filespec' into maint
* bs/maint-rename-populate-filespec:
  Rename detection: Avoid repeated filespec population
2009-01-28 23:42:57 -08:00
Junio C Hamano
0630a66f8a Merge branch 'mh/maint-commit-color-status' into maint
* mh/maint-commit-color-status:
  git-status -v: color diff output when color.ui is set
  git-commit: color status output when color.ui is set
2009-01-28 23:42:53 -08:00
Junio C Hamano
f9686cdc23 Merge branch 'nd/grep-assume-unchanged' into maint
* nd/grep-assume-unchanged:
  grep: grep cache entries if they are "assume unchanged"
  grep: support --no-ext-grep to test builtin grep
2009-01-28 23:42:41 -08:00