gitweb.git
run_hook(): allow more than 9 hook argumentsStephan Beyer Sat, 17 Jan 2009 03:02:55 +0000 (04:02 +0100)

run_hook(): allow more than 9 hook arguments

This is done using the ALLOC_GROW macro.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

run_hook(): check the executability of the hook before... Stephan Beyer Fri, 16 Jan 2009 19:10:01 +0000 (20:10 +0100)

run_hook(): check the executability of the hook before filling argv

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

api-run-command.txt: talk about run_hook()Stephan Beyer Fri, 16 Jan 2009 19:10:00 +0000 (20:10 +0100)

api-run-command.txt: talk about run_hook()

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Move run_hook() from builtin-commit.c into run-command... Stephan Beyer Fri, 16 Jan 2009 19:09:59 +0000 (20:09 +0100)

Move run_hook() from builtin-commit.c into run-command.c (libgit)

A function that runs a hook is used in several Git commands.
builtin-commit.c has the one that is most general for cases without
piping. The one in builtin-gc.c prints some useful warnings.
This patch moves a merged version of these variants into libgit and
lets the other builtins use this libified run_hook().

The run_hook() function used in receive-pack.c feeds the standard
input of the pre-receive or post-receive hooks. This function is
renamed to run_receive_hook() because the libified run_hook() cannot
handle this.

Mentored-by: Daniel Barkalow <barkalow@iabervon.org>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout: don't crash on file checkout before running... Stephan Beyer Fri, 16 Jan 2009 19:09:58 +0000 (20:09 +0100)

checkout: don't crash on file checkout before running post-checkout hook

In the case of

git init
echo exit >.git/hooks/post-checkout
chmod +x .git/hooks/post-checkout
touch foo
git add foo
rm foo
git checkout -- foo

git-checkout resulted in a Segmentation fault, because there is no new
branch set for the post-checkout hook.

This patch makes use of the null SHA as it is set for the old branch.

While at it, I removed the xstrdup() around the sha1_to_hex(...) calls
in builtin-checkout.c/post_checkout_hook() because sha1_to_hex()
uses four buffers for the hex-dumped SHA and we only need two.
(Duplicating one buffer is only needed if we need more than four.)

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Fri, 16 Jan 2009 02:52:35 +0000 (18:52 -0800)

Merge branch 'maint'

* maint:
t3404: Add test case for auto-amending only edited commits after "edit"
t3404: Add test case for aborted --continue after "edit"
t3501: check that commits are actually done

Merge branch 'maint-1.6.0' into maintJunio C Hamano Thu, 15 Jan 2009 22:33:54 +0000 (14:33 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
t3404: Add test case for auto-amending only edited commits after "edit"
t3404: Add test case for aborted --continue after "edit"
t3501: check that commits are actually done

t3404: Add test case for auto-amending only edited... Stephan Beyer Thu, 15 Jan 2009 12:56:16 +0000 (13:56 +0100)

t3404: Add test case for auto-amending only edited commits after "edit"

Add a test case for the bugfix introduced by commit c14c3c82d
"git-rebase--interactive: auto amend only edited commit".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3404: Add test case for aborted --continue after ... Stephan Beyer Thu, 15 Jan 2009 12:56:15 +0000 (13:56 +0100)

t3404: Add test case for aborted --continue after "edit"

Add a test case for the bugfix introduced by commit 8beb1f33d
"git-rebase-interactive: do not squash commits on abort".

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3501: check that commits are actually doneStephan Beyer Thu, 15 Jan 2009 13:03:17 +0000 (14:03 +0100)

t3501: check that commits are actually done

The basic idea of t3501 is to check whether revert
and cherry-pick works on renamed files.
But as there is no pure cherry-pick/revert test, it is
good to also check if commits are actually done in that
scenario.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash-completion: Add comments to remind about required... Ted Pavlic Thu, 15 Jan 2009 16:02:23 +0000 (11:02 -0500)

bash-completion: Add comments to remind about required arguments

Add a few simple comments above commands that take arguments. These
comments are meant to remind developers of potential problems that
can occur when the script is sourced on systems with "set -u." Any
function which requires arguments really ought to be called with
explicit arguments given.

Also adds a #!bash to the top of bash completions so that editing
software can always identify that the file is of sh type.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash-completion: Try bash completions before simple... Ted Pavlic Thu, 15 Jan 2009 16:02:22 +0000 (11:02 -0500)

bash-completion: Try bash completions before simple filetype

When a git completion is not found, a bash shell should try bash-type
completions first before going to standard filetype completions. This
patch adds "-o bashdefault" to the completion line. If that option is
not available, it uses the old method.

This behavior was inspired by Mercurial's bash completion script.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash-completion: Support running when set -u is enabledTed Pavlic Thu, 15 Jan 2009 16:02:21 +0000 (11:02 -0500)

bash-completion: Support running when set -u is enabled

Under "set -u" semantics, it is an error to access undefined variables.
Some user environments may enable this setting in the interactive shell.

In any context where the completion functions access an undefined
variable, accessing a default empty string (aka "${1-}" instead of "$1")
is a reasonable way to code the function, as it silences the undefined
variable error while still supplying an empty string.

In this patch, functions that should always take an argument still use
$1. Functions that have optional arguments use ${1-}.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Thu, 15 Jan 2009 06:58:46 +0000 (22:58 -0800)

Merge branch 'maint'

* maint:
Update draft release notes to 1.6.1.1
Make t3411 executable
fix handling of multiple untracked files for git mv -k
add test cases for "git mv -k"

Update draft release notes to 1.6.1.1Junio C Hamano Thu, 15 Jan 2009 06:43:04 +0000 (22:43 -0800)

Update draft release notes to 1.6.1.1

Merge branch 'maint-1.6.0' into maintJunio C Hamano Thu, 15 Jan 2009 06:34:05 +0000 (22:34 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
fix handling of multiple untracked files for git mv -k
add test cases for "git mv -k"

Make t3411 executableMiklos Vajna Thu, 15 Jan 2009 00:33:19 +0000 (01:33 +0100)

Make t3411 executable

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-am: fix shell quotingJunio C Hamano Thu, 15 Jan 2009 00:29:59 +0000 (16:29 -0800)

git-am: fix shell quoting

Noticed by Stephan Beyer; the new test is mine.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix handling of multiple untracked files for git mv -kMichael J Gruber Wed, 14 Jan 2009 17:03:22 +0000 (18:03 +0100)

fix handling of multiple untracked files for git mv -k

The "-k" option to "git mv" should allow specifying multiple untracked
files. Currently, multiple untracked files raise an assertion if they
appear consecutively as arguments. Fix this by decrementing the loop
index after removing one entry from the array of arguments.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add test cases for "git mv -k"Michael J Gruber Wed, 14 Jan 2009 17:03:21 +0000 (18:03 +0100)

add test cases for "git mv -k"

Add test cases for ignoring nonexisting and untracked files using the -k
option to "git mv". There is one known breakage related to multiple
untracked files specfied as consecutive arguments.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update 1.6.2 draft release notesJunio C Hamano Wed, 14 Jan 2009 07:41:32 +0000 (23:41 -0800)

Update 1.6.2 draft release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 14 Jan 2009 07:12:51 +0000 (23:12 -0800)

Merge branch 'maint'

* maint:
fast-import: Cleanup mode setting.
Git.pm: call Error::Simple() properly

Merge branch 'maint-1.6.0' into maintJunio C Hamano Wed, 14 Jan 2009 07:10:50 +0000 (23:10 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
fast-import: Cleanup mode setting.
Git.pm: call Error::Simple() properly

Merge branch 'nd/grep-assume-unchanged'Junio C Hamano Wed, 14 Jan 2009 07:10:02 +0000 (23:10 -0800)

Merge branch 'nd/grep-assume-unchanged'

* nd/grep-assume-unchanged:
grep: grep cache entries if they are "assume unchanged"
grep: support --no-ext-grep to test builtin grep

Merge branch 'as/maint-shortlog-cleanup'Junio C Hamano Wed, 14 Jan 2009 07:10:00 +0000 (23:10 -0800)

Merge branch 'as/maint-shortlog-cleanup'

* as/maint-shortlog-cleanup:
builtin-shortlog.c: use string_list_append(), and don't strdup unnecessarily

Merge branch 'jc/maint-ls-tree'Junio C Hamano Wed, 14 Jan 2009 07:09:57 +0000 (23:09 -0800)

Merge branch 'jc/maint-ls-tree'

* jc/maint-ls-tree:
Document git-ls-tree --full-tree
ls-tree: add --full-tree option

Merge branch 'js/bundle-tags'Junio C Hamano Wed, 14 Jan 2009 07:09:50 +0000 (23:09 -0800)

Merge branch 'js/bundle-tags'

* js/bundle-tags:
bundle: allow rev-list options to exclude annotated tags

Merge branch 'js/add-not-submodule'Junio C Hamano Wed, 14 Jan 2009 07:09:47 +0000 (23:09 -0800)

Merge branch 'js/add-not-submodule'

* js/add-not-submodule:
git add: do not add files from a submodule

Merge branch 'pb/maint-git-pm-false-dir'Junio C Hamano Wed, 14 Jan 2009 07:09:42 +0000 (23:09 -0800)

Merge branch 'pb/maint-git-pm-false-dir'

* pb/maint-git-pm-false-dir:
Git.pm: correctly handle directory name that evaluates to "false"

Merge branch 'pj/maint-ldflags'Junio C Hamano Wed, 14 Jan 2009 07:09:38 +0000 (23:09 -0800)

Merge branch 'pj/maint-ldflags'

* pj/maint-ldflags:
configure clobbers LDFLAGS

Merge branch 'fe/cvsserver'Junio C Hamano Wed, 14 Jan 2009 07:09:35 +0000 (23:09 -0800)

Merge branch 'fe/cvsserver'

* fe/cvsserver:
cvsserver: change generation of CVS author names
cvsserver: add option to configure commit message

Merge branch 'js/maint-bisect-gitk'Junio C Hamano Wed, 14 Jan 2009 07:09:29 +0000 (23:09 -0800)

Merge branch 'js/maint-bisect-gitk'

* js/maint-bisect-gitk:
bisect view: call gitk if Cygwin's SESSIONNAME variable is set

Merge branch 'np/no-loosen-prune-expire-now'Junio C Hamano Wed, 14 Jan 2009 07:09:24 +0000 (23:09 -0800)

Merge branch 'np/no-loosen-prune-expire-now'

* np/no-loosen-prune-expire-now:
objects to be pruned immediately don't have to be loosened

Merge branch 'cb/maint-unpack-trees-absense'Junio C Hamano Wed, 14 Jan 2009 07:09:20 +0000 (23:09 -0800)

Merge branch 'cb/maint-unpack-trees-absense'

* cb/maint-unpack-trees-absense:
unpack-trees: remove redundant path search in verify_absent
unpack-trees: fix path search bug in verify_absent
unpack-trees: handle failure in verify_absent

Merge branch 'mc/cd-p-pwd'Junio C Hamano Wed, 14 Jan 2009 07:09:13 +0000 (23:09 -0800)

Merge branch 'mc/cd-p-pwd'

* mc/cd-p-pwd:
git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X

Merge branch 'mh/cherry-default'Junio C Hamano Wed, 14 Jan 2009 07:09:09 +0000 (23:09 -0800)

Merge branch 'mh/cherry-default'

* mh/cherry-default:
Documentation: clarify which parameters are optional to git-cherry
git-cherry: make <upstream> parameter optional

fast-import: Cleanup mode setting.Felipe Contreras Wed, 14 Jan 2009 01:37:07 +0000 (03:37 +0200)

fast-import: Cleanup mode setting.

"S_IFREG | mode" makes only sense for 0644 and 0755.

Even though doing (S_IFREG | mode) may not hurt when mode is any other
supported value, that is only true because S_IFREG mode bit happens to
be already on for S_IFLNK or S_IFGITLINK.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git.pm: call Error::Simple() properlyJay Soffian Tue, 13 Jan 2009 22:41:35 +0000 (17:41 -0500)

Git.pm: call Error::Simple() properly

The error message to Error::Simple() must be passed as a single argument.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 13 Jan 2009 09:25:55 +0000 (01:25 -0800)

Merge branch 'maint'

* maint:
Avoid spurious error messages on error mistakes.
contrib/examples/README: give an explanation of the status of these files

Merge branch 'kk/maint-http-push' into maintJunio C Hamano Tue, 13 Jan 2009 09:15:49 +0000 (01:15 -0800)

Merge branch 'kk/maint-http-push' into maint

* kk/maint-http-push:
http-push: support full URI in handle_remote_ls_ctx()

Merge branch 'js/maint-merge-recursive-r-d-conflict... Junio C Hamano Tue, 13 Jan 2009 09:15:19 +0000 (01:15 -0800)

Merge branch 'js/maint-merge-recursive-r-d-conflict' into maint

* js/maint-merge-recursive-r-d-conflict:
merge-recursive: mark rename/delete conflict as unmerged

Merge branch 'cb/maint-merge-recursive-fix' into maintJunio C Hamano Tue, 13 Jan 2009 09:13:56 +0000 (01:13 -0800)

Merge branch 'cb/maint-merge-recursive-fix' into maint

* cb/maint-merge-recursive-fix:
merge-recursive: do not clobber untracked working tree garbage
modify/delete conflict resolution overwrites untracked file

Conflicts:
builtin-merge-recursive.c

Merge branch 'ap/maint-apply-modefix' into maintJunio C Hamano Tue, 13 Jan 2009 08:56:40 +0000 (00:56 -0800)

Merge branch 'ap/maint-apply-modefix' into maint

* ap/maint-apply-modefix:
builtin-apply: prevent non-explicit permission changes

Merge branch 'maint-1.6.0' into maintJunio C Hamano Tue, 13 Jan 2009 08:40:19 +0000 (00:40 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
Avoid spurious error messages on error mistakes.
contrib/examples/README: give an explanation of the status of these files

Avoid spurious error messages on error mistakes.Pierre Habouzit Mon, 12 Jan 2009 23:09:36 +0000 (00:09 +0100)

Avoid spurious error messages on error mistakes.

Prior to that, if the user chose "squash" as a first action, the stderr
looked like:

grep: /home/madcoder/dev/scm/git/.git/rebase-merge/done: No such file or directory
Cannot 'squash' without a previous commit

Now the first line is gone.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix Documentation typos surrounding the word 'handful'.Jon Loeliger Mon, 12 Jan 2009 20:02:07 +0000 (14:02 -0600)

Fix Documentation typos surrounding the word 'handful'.

Some instances replaced by "handful of", others use
the word "few", a couple get a slight rewording.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_file: make "read_object" staticChristian Couder Mon, 12 Jan 2009 17:42:24 +0000 (18:42 +0100)

sha1_file: make "read_object" static

This function is only used from "sha1_file.c".

And as we want to add a "replace_object" hook in "read_sha1_file",
we must not let people bypass the hook using something other than
"read_sha1_file".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/vim: change URL to point to the latest syntax... Markus Heidelberg Tue, 13 Jan 2009 02:10:26 +0000 (03:10 +0100)

contrib/vim: change URL to point to the latest syntax files

Vim's SVN repository doesn't offer the latest runtime files, since
normally they are only updated there on a release. Though currently
there is no difference between the SVN and HTTP/FTP version of the git
syntax files.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/examples/README: give an explanation of the... jidanni@jidanni.org Tue, 13 Jan 2009 01:19:42 +0000 (09:19 +0800)

contrib/examples/README: give an explanation of the status of these files

We attempt to give an explanation of the status of the files in this
directory.

Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Teach format-patch to handle output directory relative... Junio C Hamano Mon, 12 Jan 2009 23:18:02 +0000 (15:18 -0800)

Teach format-patch to handle output directory relative to cwd

Without any explicit -o parameter, we correctly avoided putting the
resulting patch output to the toplevel. We should do the same when
the user gave a relative pathname to be consistent with this case.

Noticed by Cesar Eduardo Barros.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-am: add --directory=<dir> optionJunio C Hamano Mon, 12 Jan 2009 06:21:48 +0000 (22:21 -0800)

git-am: add --directory=<dir> option

Thanks to a200337 (git-am: propagate -C<n>, -p<n> options as well,
2008-12-04) and commits around it, "git am" is equipped to correctly
propagate the command line flags such as -C/-p/-whitespace across a patch
failure and restart.

It is trivial to support --directory option now, resurrecting previous
attempts by Kevin and Simon.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 12 Jan 2009 07:29:26 +0000 (23:29 -0800)

Merge branch 'maint'

* maint:
Documentation/git-push.txt: minor: compress one option

Merge branch 'mh/maint-sendmail-cc-doc' into maintJunio C Hamano Mon, 12 Jan 2009 07:27:29 +0000 (23:27 -0800)

Merge branch 'mh/maint-sendmail-cc-doc' into maint

* mh/maint-sendmail-cc-doc:
doc/git-send-email: mention sendemail.cc config variable

Merge branch 'jc/maint-do-not-switch-to-non-commit... Junio C Hamano Mon, 12 Jan 2009 07:24:42 +0000 (23:24 -0800)

Merge branch 'jc/maint-do-not-switch-to-non-commit' into maint

* jc/maint-do-not-switch-to-non-commit:
git checkout: do not allow switching to a tree-ish that is not a commit

rebase: update documentation for --rootThomas Rast Fri, 2 Jan 2009 22:28:29 +0000 (23:28 +0100)

rebase: update documentation for --root

Since the new option depends on --onto and omission of <upstream>, use
a separate invocation style, and omit most options to save space.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: learn to rebase root commitThomas Rast Fri, 2 Jan 2009 22:28:28 +0000 (23:28 +0100)

rebase -i: learn to rebase root commit

Teach git-rebase -i a new option --root, which instructs it to rebase
the entire history leading up to <branch>. This is mainly for
symmetry with ordinary git-rebase; it cannot be used to edit the root
commit in-place (it requires --onto <newbase>). Commits that already
exist in <newbase> are skipped.

In the normal mode of operation, this is fairly straightforward. We
run cherry-pick in a loop, and cherry-pick has supported picking the
root commit since f95ebf7 (Allow cherry-picking root commits,
2008-07-04).

In --preserve-merges mode, we track the mapping from old to rewritten
commits and use it to update the parent list of each commit. In this
case, we define 'rebase -i -p --root --onto $onto $branch' to rewrite
the parent list of all root commit(s) on $branch to contain $onto
instead.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: learn to rebase root commitThomas Rast Mon, 5 Jan 2009 17:35:16 +0000 (18:35 +0100)

rebase: learn to rebase root commit

Teach git-rebase a new option --root, which instructs it to rebase the
entire history leading up to <branch>. This option must be used with
--onto <newbase>, and causes commits that already exist in <newbase>
to be skipped. (Normal operation skips commits that already exist in
<upstream> instead.)

One possible use-case is with git-svn: suppose you start hacking
(perhaps offline) on a new project, but later notice you want to
commit this work to SVN. You will have to rebase the entire history,
including the root commit, on a (possibly empty) commit coming from
git-svn, to establish a history connection. This previously had to
be done by cherry-picking the root commit manually.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-push.txt: minor: compress one optionjidanni@jidanni.org Mon, 12 Jan 2009 03:05:54 +0000 (11:05 +0800)

Documentation/git-push.txt: minor: compress one option

Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: add --authors-file testEric Wong Sun, 11 Jan 2009 23:44:07 +0000 (15:44 -0800)

git-svn: add --authors-file test

I'm not sure how often this functionality is used, but in case
it's not, having an extra test here will help catch breakage
sooner.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Cleanup of unused symcache variable inside diff-lib.cKjetil Barvik Sun, 11 Jan 2009 18:36:42 +0000 (19:36 +0100)

Cleanup of unused symcache variable inside diff-lib.c

Commit c40641b77b0274186fd1b327d5dc3246f814aaaf, 'Optimize
symlink/directory detection' by Linus Torvalds, removed the 'char
*symcache' parameter to the has_symlink_leading_path() function. This
made all variables currently named 'symcache' inside diff-lib.c
unnecessary.

This also let us throw away the 'struct oneway_unpack_data', and
instead directly use the 'struct rev_info *revs' member, which
was the only member left after removal of the 'symcache[] array'
member. The 'struct oneway_unpack_data' was introduced by the
following commit:

948dd346 "diff-files: careful when inspecting work tree items"

Impact: cleanup
PATH_MAX bytes less memory stack usage in some cases

Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Allow cloning to an existing empty directoryAlexander Potashev Sun, 11 Jan 2009 12:19:12 +0000 (15:19 +0300)

Allow cloning to an existing empty directory

The die() message updated accordingly.

The previous behaviour was to only allow cloning when the destination
directory doesn't exist.

[jc: added trivial tests]

Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add is_dot_or_dotdot inline functionAlexander Potashev Sat, 10 Jan 2009 12:07:50 +0000 (15:07 +0300)

add is_dot_or_dotdot inline function

A new inline function is_dot_or_dotdot is used to check if the
directory name is either "." or "..". It returns a non-zero value if
the given string is "." or "..". It's applicable to a lot of Git
source code.

Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: clean up TEST_PROGRAMS definitionJeff King Sun, 11 Jan 2009 11:25:06 +0000 (06:25 -0500)

Makefile: clean up TEST_PROGRAMS definition

We try to keep lines under 80 characters, not to mention
that sticking a bunch of stuff on one line makes diffs
messier.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Wrap inflate and other zlib routines for better error... Linus Torvalds Thu, 8 Jan 2009 03:54:47 +0000 (19:54 -0800)

Wrap inflate and other zlib routines for better error reporting

R. Tyler Ballance reported a mysterious transient repository corruption;
after much digging, it turns out that we were not catching and reporting
memory allocation errors from some calls we make to zlib.

This one _just_ wraps things; it doesn't do the "retry on low memory
error" part, at least not yet. It is an independent issue from the
reporting. Some of the errors are expected and passed back to the caller,
but we die when zlib reports it failed to allocate memory for now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7501-commit.sh: explicitly check that -F prevents... Adeodato Simó Fri, 9 Jan 2009 17:30:05 +0000 (18:30 +0100)

t7501-commit.sh: explicitly check that -F prevents invoking the editor

The "--signoff" test case in t7500-commit.sh was setting VISUAL while
using -F -, which indeed tested that the editor is not spawned with -F.
However, having it there was confusing, since there was no obvious reason
to the casual reader for it to be there.

This commits removes the setting of VISUAL from the --signoff test, and
adds in t7501-commit.sh a dedicated test case, where the rest of tests for
-F are.

Signed-off-by: Adeodato Simó <dato@net.com.org.es>
Okay-then-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: suggest name for OPML viewGiuseppe Bilotta Fri, 2 Jan 2009 12:49:30 +0000 (13:49 +0100)

gitweb: suggest name for OPML view

Suggest opml.xml as name for OPML view by providing the appropriate
header, consistently with similar usage in project_index view.

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>

format-patch: show patch text for the root commitJunio C Hamano Sat, 10 Jan 2009 20:41:33 +0000 (12:41 -0800)

format-patch: show patch text for the root commit

Even without --root specified, if the range given on the command line
happens to include a root commit, we should include its patch text in the
output.

This fix deliberately ignores log.showroot configuration variable because
"format-patch" and "log -p" can and should behave differently in this
case, as the former is about exporting a part of your history in a form
that is replayable elsewhere and just giving the commit log message
without the patch text does not make any sense for that purpose.

Noticed and fix originally attempted by Nathan W. Panike; credit goes to
Alexander Potashev for injecting sanity to my initial (broken) fix that
used the value from log.showroot configuration, which was misguided.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completion: Use 'git add' completions for 'git... Lee Marlow Wed, 10 Dec 2008 19:39:18 +0000 (12:39 -0700)

bash completion: Use 'git add' completions for 'git stage'

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completion: Add '--intent-to-add' long option... Lee Marlow Wed, 10 Dec 2008 19:39:17 +0000 (12:39 -0700)

bash completion: Add '--intent-to-add' long option for 'git add'

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter-branch: add git_commit_non_empty_tree and -... Pierre Habouzit Fri, 31 Oct 2008 09:12:21 +0000 (10:12 +0100)

filter-branch: add git_commit_non_empty_tree and --prune-empty.

git_commit_non_empty_tree is added to the functions that can be run from
commit filters. Its effect is to commit only commits actually touching the
tree and that are not merge points either.

The option --prune-empty is added. It defaults the commit-filter to
'git_commit_non_empty_tree "$@"', and can be used with any other
combination of filters, except --commit-hook that must used
'git_commit_non_empty_tree "$@"' where one puts 'git commit-tree "$@"'
usually to achieve the same result.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Resurrect "git apply --flags -" to read from the standa... Junio C Hamano Sat, 10 Jan 2009 06:21:36 +0000 (22:21 -0800)

Resurrect "git apply --flags -" to read from the standard input

The previous "parse-opt"ification broke git-apply reading from the
standard input. "git apply A - C <B" is supposed to read patches from
files A, B and C in this order.

Before "parse-opt"ification, we used be able to:

git apply --stat - --apply <A B

to read the patch from file A, showing only the diffstat, and then read the
patch from file B, showing the diffstat and actually applying it. Even
with this fix we cannot do that anymore, but that is so crazy use case I
do not think anybody sane relied on such a broken behaviour.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: don't call regexec() for fixed stringsRené Scharfe Fri, 9 Jan 2009 23:18:34 +0000 (00:18 +0100)

grep: don't call regexec() for fixed strings

Add the new flag "fixed" to struct grep_pat and set it if the pattern
is doesn't contain any regex control characters in addition to if the
flag -F/--fixed-strings was specified.

This gives a nice speed up on msysgit, where regexec() seems to be
extra slow. Before (best of five runs):

$ time git grep grep v1.6.1 >/dev/null

real 0m0.552s
user 0m0.000s
sys 0m0.000s

$ time git grep -F grep v1.6.1 >/dev/null

real 0m0.170s
user 0m0.000s
sys 0m0.015s

With the patch:

$ time git grep grep v1.6.1 >/dev/null

real 0m0.173s
user 0m0.000s
sys 0m0.000s

The difference is much smaller on Linux, but still measurable.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep -w: forward to next possible position after reject... René Scharfe Fri, 9 Jan 2009 23:08:40 +0000 (00:08 +0100)

grep -w: forward to next possible position after rejected match

grep -w accepts matches between non-word characters, only. If a match
from regexec() doesn't meet this criteria, grep continues its search
after the first character of that match.

We can be a bit smarter here and skip all positions that follow a word
character first, as they can't match our criteria. This way we can
consume characters quite cheaply and don't need to special-case the
handling of the beginning of a line.

Here's a contrived example command on msysgit (best of five runs):

$ time git grep -w ...... v1.6.1 >/dev/null

real 0m1.611s
user 0m0.000s
sys 0m0.015s

With the patch it's quite a bit faster:

$ time git grep -w ...... v1.6.1 >/dev/null

real 0m1.179s
user 0m0.000s
sys 0m0.015s

More common search patterns will gain a lot less, but it's a nice clean
up anyway.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-status -v: color diff output when color.ui is setMarkus Heidelberg Thu, 8 Jan 2009 18:53:05 +0000 (19:53 +0100)

git-status -v: color diff output when color.ui is set

When using "git status -v", the diff output wasn't colored, even though
color.ui was set. Only when setting color.diff it worked.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-commit: color status output when color.ui is setMarkus Heidelberg Thu, 8 Jan 2009 18:53:01 +0000 (19:53 +0100)

git-commit: color status output when color.ui is set

When using "git commit" and there was nothing to commit (the editor
wasn't launched), the status output wasn't colored, even though color.ui
was set. Only when setting color.status it worked.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash completions: Add the --patience optionJohannes Schindelin Thu, 1 Jan 2009 16:39:37 +0000 (17:39 +0100)

bash completions: Add the --patience option

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Introduce the diff option '--patience'Johannes Schindelin Thu, 1 Jan 2009 16:39:17 +0000 (17:39 +0100)

Introduce the diff option '--patience'

This commit teaches Git to produce diff output using the patience diff
algorithm with the diff option '--patience'.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Implement the patience diff algorithmJohannes Schindelin Wed, 7 Jan 2009 17:04:09 +0000 (18:04 +0100)

Implement the patience diff algorithm

The patience diff algorithm produces slightly more intuitive output
than the classic Myers algorithm, as it does not try to minimize the
number of +/- lines first, but tries to preserve the lines that are
unique.

To this end, it first determines lines that are unique in both files,
then the maximal sequence which preserves the order (relative to both
files) is extracted.

Starting from this initial set of common lines, the rest of the lines
is handled recursively, with Myers' algorithm as a fallback when
the patience algorithm fails (due to no common unique lines).

This patch includes memory leak fixes by Pierre Habouzit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff --no-index -q: fix endless loopThomas Rast Wed, 7 Jan 2009 11:15:30 +0000 (12:15 +0100)

diff --no-index -q: fix endless loop

We forgot to move to the next argument when parsing -q, getting stuck
in an endless loop.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mh/maint-sendmail-cc-doc'Junio C Hamano Wed, 7 Jan 2009 08:10:19 +0000 (00:10 -0800)

Merge branch 'mh/maint-sendmail-cc-doc'

* mh/maint-sendmail-cc-doc:
doc/git-send-email: mention sendemail.cc config variable

Merge branch 'rs/diff-ihc'Junio C Hamano Wed, 7 Jan 2009 08:10:14 +0000 (00:10 -0800)

Merge branch 'rs/diff-ihc'

* rs/diff-ihc:
diff: add option to show context between close hunks

Conflicts:
Documentation/diff-options.txt

Merge branch 'js/maint-merge-recursive-r-d-conflict'Junio C Hamano Wed, 7 Jan 2009 08:09:42 +0000 (00:09 -0800)

Merge branch 'js/maint-merge-recursive-r-d-conflict'

* js/maint-merge-recursive-r-d-conflict:
merge-recursive: mark rename/delete conflict as unmerged

Merge branch 'mk/gitweb-feature'Junio C Hamano Wed, 7 Jan 2009 08:09:33 +0000 (00:09 -0800)

Merge branch 'mk/gitweb-feature'

* mk/gitweb-feature:
gitweb: unify boolean feature subroutines

Merge branch 'cb/merge-recursive-fix'Junio C Hamano Wed, 7 Jan 2009 08:09:27 +0000 (00:09 -0800)

Merge branch 'cb/merge-recursive-fix'

* cb/merge-recursive-fix:
merge-recursive: do not clobber untracked working tree garbage
modify/delete conflict resolution overwrites untracked file

Merge branch 'kk/maint-http-push'Junio C Hamano Wed, 7 Jan 2009 08:09:14 +0000 (00:09 -0800)

Merge branch 'kk/maint-http-push'

* kk/maint-http-push:
http-push: support full URI in handle_remote_ls_ctx()

Merge branch 'mv/um-pdf'Junio C Hamano Wed, 7 Jan 2009 08:09:10 +0000 (00:09 -0800)

Merge branch 'mv/um-pdf'

* mv/um-pdf:
Add support for a pdf version of the user manual

Merge branch 'jn/gitweb-blame'Junio C Hamano Wed, 7 Jan 2009 08:09:06 +0000 (00:09 -0800)

Merge branch 'jn/gitweb-blame'

* jn/gitweb-blame:
gitweb: cache $parent_commit info in git_blame()
gitweb: A bit of code cleanup in git_blame()
gitweb: Move 'lineno' id from link to row element in git_blame

Merge branch 'wp/add-p-goto'Junio C Hamano Wed, 7 Jan 2009 08:09:00 +0000 (00:09 -0800)

Merge branch 'wp/add-p-goto'

* wp/add-p-goto:
Add 'g' command to go to a hunk
Add subroutine to display one-line summary of hunks

diff --no-index: test for pager after option parsingThomas Rast Tue, 6 Jan 2009 23:56:03 +0000 (00:56 +0100)

diff --no-index: test for pager after option parsing

We need to parse options before we can see if --exit-code was
provided.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: accept -- when using --no-indexThomas Rast Tue, 6 Jan 2009 18:53:32 +0000 (19:53 +0100)

diff: accept -- when using --no-index

Accept -- as an "end of options" marker even when using --no-index.
Previously, the -- triggered a "normal" index/tree diff and subsequently
failed because of the unrecognized (in that mode) --no-index.

Note that the second loop can treat '--' as a normal option, because
the preceding checks ensure it is the third-to-last argument.

While at it, fix the parsing of "-q" option in --no-index mode as well.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

strbuf: instate cleanup rule in case of non-memory... René Scharfe Tue, 6 Jan 2009 20:41:14 +0000 (21:41 +0100)

strbuf: instate cleanup rule in case of non-memory errors

Make all strbuf functions that can fail free() their memory on error if
they have allocated it. They don't shrink buffers that have been grown,
though.

This allows for easier error handling, as callers only need to call
strbuf_release() if A) the command succeeded or B) if they would have had
to do so anyway because they added something to the strbuf themselves.

Bonus hunk: document strbuf_readlink.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 7 Jan 2009 06:13:41 +0000 (22:13 -0800)

Merge branch 'maint'

* maint:
README: tutorial.txt is now called gittutorial.txt

Merge branch 'maint-1.6.0' into maintJunio C Hamano Wed, 7 Jan 2009 06:12:35 +0000 (22:12 -0800)

Merge branch 'maint-1.6.0' into maint

* maint-1.6.0:
README: tutorial.txt is now called gittutorial.txt

Merge branch 'maint-1.5.6' into maint-1.6.0Junio C Hamano Wed, 7 Jan 2009 06:12:30 +0000 (22:12 -0800)

Merge branch 'maint-1.5.6' into maint-1.6.0

* maint-1.5.6:
README: tutorial.txt is now called gittutorial.txt

README: tutorial.txt is now called gittutorial.txtJoey Hess Wed, 7 Jan 2009 04:23:37 +0000 (23:23 -0500)

README: tutorial.txt is now called gittutorial.txt

Signed-off-by: Joey Hess <joey@gnu.kitenet.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

shortlog: handle multi-line subjects like log --pretty... René Scharfe Tue, 6 Jan 2009 20:41:06 +0000 (21:41 +0100)

shortlog: handle multi-line subjects like log --pretty=oneline et. al. do

The commit message parser of git shortlog used to treat only the first
non-empty line of the commit message as the subject. Other log commands
(e.g. --pretty=oneline) show the whole first paragraph instead (unwrapped
into a single line).

For consistency, this patch borrows format_subject() from pretty.c to
make shortlog do the same.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: don't use pathinfo for global actionsGiuseppe Bilotta Fri, 2 Jan 2009 11:34:40 +0000 (12:34 +0100)

gitweb: don't use pathinfo for global actions

With PATH_INFO urls, actions for the projects list (e.g. opml,
project_index) were being put in the URL right after the base. The
resulting URL is not properly parsed by gitweb itself, since it expects
a project name as first component of the URL.

Accepting global actions in use_pathinfo is not a very robust solution
due to possible present and future conflicts between project names and
global actions, therefore we just refuse to create PATH_INFO URLs when
the project is not defined.

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>

configure clobbers LDFLAGSPaul Jarc Mon, 5 Jan 2009 02:27:41 +0000 (21:27 -0500)

configure clobbers LDFLAGS

In a couple of tests, configure clobbers the LDFLAGS value set by the
caller. This patch fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 6 Jan 2009 00:10:52 +0000 (16:10 -0800)

Merge branch 'maint'

* maint:
Be consistent in switch usage for tar
Use capitalized names where appropriate
fast-export: print usage when no options specified

remove trailing LF in die() messagesAlexander Potashev Sun, 4 Jan 2009 18:38:41 +0000 (21:38 +0300)

remove trailing LF in die() messages

LF at the end of format strings given to die() is redundant because
die already adds one on its own.

Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>