Commit Graph

17405 Commits

Author SHA1 Message Date
Thomas Rast
738a94a9f6 bash: offer to show (un)staged changes
Add a bit of code to __git_ps1 that lets it append '*' to the branch
name if there are any unstaged changes, and '+' if there are any
staged changes.

Since this is a rather expensive operation and will force a lot of
data into the cache whenever you first enter a repository, you have to
enable it manually by setting GIT_PS1_SHOWDIRTYSTATE to a nonempty
value.  The configuration variable bash.showDirtyState can then be
used to disable it again for some repositories.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03 22:07:51 -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
Junio C Hamano
32fe027931 Merge branch 'jc/maint-ls-tree' into maint
* jc/maint-ls-tree:
  Document git-ls-tree --full-tree
  ls-tree: add --full-tree option
2009-01-28 23:42:15 -08:00
Junio C Hamano
8e7d1f6d03 Merge branch 'np/no-loosen-prune-expire-now' into maint
* np/no-loosen-prune-expire-now:
  objects to be pruned immediately don't have to be loosened
2009-01-28 23:42:10 -08:00
Junio C Hamano
20bd35c110 Merge branch 'mc/cd-p-pwd' into maint
* mc/cd-p-pwd:
  git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X
2009-01-28 23:41:56 -08:00
Junio C Hamano
8561b522d7 Merge branch 'maint-1.6.0' into maint
* maint-1.6.0:
  avoid 31-bit truncation in write_loose_object
2009-01-28 23:41:28 -08:00
Jeff King
915308b187 avoid 31-bit truncation in write_loose_object
The size of the content we are adding may be larger than
2.1G (i.e., "git add gigantic-file"). Most of the code-path
to do so uses size_t or unsigned long to record the size,
but write_loose_object uses a signed int.

On platforms where "int" is 32-bits (which includes x86_64
Linux platforms), we end up passing malloc a negative size.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-28 23:40:53 -08:00
Johannes Schindelin
f7951e1d97 Simplify t3412
Use the newly introduced test_commit() and test_merge() helpers.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-28 20:17:46 -08:00
Johannes Schindelin
37e5c8f460 Simplify t3411
Use test_commit() and test_merge().  This way, it is harder to forget to
tag, or to call test_tick before committing.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-28 20:17:27 -08:00
Johannes Schindelin
4bd03d15e4 Simplify t3410
Use test_commit() and test_merge(), reducing the code while making the
intent clearer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-28 20:17:17 -08:00