gitweb.git
Teach git-pull to pass -X<option> to git-mergeAvery Pennarun Thu, 26 Nov 2009 02:23:57 +0000 (21:23 -0500)

Teach git-pull to pass -X<option> to git-merge

This needs the usual sq then eval trick to allow IFS characters
in the option.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git merge -X<option>Avery Pennarun Thu, 26 Nov 2009 02:23:55 +0000 (21:23 -0500)

git merge -X<option>

Teach "-X <option>" command line argument to "git merge" that is passed to
strategy implementations. "ours" and "theirs" autoresolution introduced
by the previous commit can be asked to the recursive strategy.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.0Junio C Hamano Mon, 18 Jan 2010 00:47:48 +0000 (16:47 -0800)

Update draft release notes to 1.7.0

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

Merge branch 'tc/test-locate-httpd'Junio C Hamano Mon, 18 Jan 2010 00:00:13 +0000 (16:00 -0800)

Merge branch 'tc/test-locate-httpd'

* tc/test-locate-httpd:
t/lib-http.sh: Restructure finding of default httpd location

Merge branch 'jh/commit-status'Junio C Hamano Mon, 18 Jan 2010 00:00:07 +0000 (16:00 -0800)

Merge branch 'jh/commit-status'

* jh/commit-status:
t7502: test commit.status, --status and --no-status
commit: support commit.status, --status, and --no-status

Conflicts:
Documentation/git-commit.txt
builtin-commit.c

Merge branch 'jn/makefile'Junio C Hamano Sun, 17 Jan 2010 23:59:44 +0000 (15:59 -0800)

Merge branch 'jn/makefile'

* jn/makefile:
Makefile: consolidate .FORCE-* targets
Makefile: learn to generate listings for targets requiring special flags
Makefile: use target-specific variable to pass flags to cc
Makefile: regenerate assembler listings when asked

Merge branch 'jc/maint-1.6.1-checkout-m-custom-merge'Junio C Hamano Sun, 17 Jan 2010 23:59:40 +0000 (15:59 -0800)

Merge branch 'jc/maint-1.6.1-checkout-m-custom-merge'

* jc/maint-1.6.1-checkout-m-custom-merge:
checkout -m path: fix recreating conflicts

Conflicts:
t/t7201-co.sh

Merge branch 'tc/clone-v-progress'Junio C Hamano Sun, 17 Jan 2010 23:58:58 +0000 (15:58 -0800)

Merge branch 'tc/clone-v-progress'

* tc/clone-v-progress:
clone: use --progress to force progress reporting
clone: set transport->verbose when -v/--verbose is used
git-clone.txt: reword description of progress behaviour
check stderr with isatty() instead of stdout when deciding to show progress

Conflicts:
transport.c

Merge branch 'tc/smart-http-restrict'Junio C Hamano Sun, 17 Jan 2010 23:58:23 +0000 (15:58 -0800)

Merge branch 'tc/smart-http-restrict'

* tc/smart-http-restrict:
Test t5560: Fix test when run with dash
Smart-http tests: Test http-backend without curl or a webserver
Smart-http tests: Break test t5560-http-backend into pieces
Smart-http tests: Improve coverage in test t5560
Smart-http: check if repository is OK to export before serving it

Merge branch 'jk/run-command-use-shell'Junio C Hamano Sun, 17 Jan 2010 23:58:15 +0000 (15:58 -0800)

Merge branch 'jk/run-command-use-shell'

* jk/run-command-use-shell:
t4030, t4031: work around bogus MSYS bash path conversion
diff: run external diff helper with shell
textconv: use shell to run helper
editor: use run_command's shell feature
run-command: optimize out useless shell calls
run-command: convert simple callsites to use_shell
t0021: use $SHELL_PATH for the filter script
run-command: add "use shell" option

Merge branch 'sr/gfi-options'Junio C Hamano Sun, 17 Jan 2010 23:58:11 +0000 (15:58 -0800)

Merge branch 'sr/gfi-options'

* sr/gfi-options:
fast-import: add (non-)relative-marks feature
fast-import: allow for multiple --import-marks= arguments
fast-import: test the new option command
fast-import: add option command
fast-import: add feature command
fast-import: put marks reading in its own function
fast-import: put option parsing code in separate functions

Update COPYING with GPLv2 with new FSF addressJunio C Hamano Sat, 16 Jan 2010 05:38:34 +0000 (21:38 -0800)

Update COPYING with GPLv2 with new FSF address

The mailing address of FSF changed quite a while ago. Also the expansion
of the acronym LGPL (which we don't use) is "Lesser GPL" not "Library GPL"
these days in recent copies of GPLv2. Update the copy we have with a
fresh download of <http://www.gnu.org/licenses/gpl-2.0.txt>.

This incidentally removes form-feeds in the text we retained for all these
years.

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

user_ident_sufficiently_given(): refactor the logic... Junio C Hamano Sun, 17 Jan 2010 21:59:36 +0000 (13:59 -0800)

user_ident_sufficiently_given(): refactor the logic to be usable from elsewhere

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

user_ident_sufficiently_given(): refactor the logic... Junio C Hamano Sun, 17 Jan 2010 21:54:28 +0000 (13:54 -0800)

user_ident_sufficiently_given(): refactor the logic to be usable from elsewhere

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

rerere: honor conflict-marker-size attributeJunio C Hamano Sun, 17 Jan 2010 07:28:46 +0000 (23:28 -0800)

rerere: honor conflict-marker-size attribute

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

rerere: prepare for customizable conflict marker lengthJunio C Hamano Sun, 17 Jan 2010 07:06:45 +0000 (23:06 -0800)

rerere: prepare for customizable conflict marker length

This still uses the hardcoded conflict marker length of 7 but otherwise
prepares the codepath to deal with customized marker length.

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

commit.c::print_summary: do not release the format... Junio C Hamano Sun, 17 Jan 2010 08:57:51 +0000 (00:57 -0800)

commit.c::print_summary: do not release the format string too early

When we are showing a clean merge, log_tree_commit() won't show the header
and we would need the format string to format the commit summary ourselves.

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

conflict-marker-size: new attributeJunio C Hamano Sat, 16 Jan 2010 06:37:32 +0000 (22:37 -0800)

conflict-marker-size: new attribute

This can be specified to set the length of the conflict marker (usually 7)
to a non-default value per path. Only the callers of ll_merge() that are
aware of the per-path attributes are modified.

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

rerere: use ll_merge() instead of using xdl_merge()Junio C Hamano Sat, 16 Jan 2010 06:50:01 +0000 (22:50 -0800)

rerere: use ll_merge() instead of using xdl_merge()

This allows us to pay attention to the attribute settings and custom
merge driver the user sets up.

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

merge-tree: use ll_merge() not xdl_merge()Junio C Hamano Sun, 17 Jan 2010 05:45:40 +0000 (21:45 -0800)

merge-tree: use ll_merge() not xdl_merge()

ll_merge() interface was designed to merge contents under git control
while taking per-path attributes into account. Update the three-way
merge implementation used by merge-tree to use it.

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

xdl_merge(): allow passing down marker_size in xmparam_tJunio C Hamano Sun, 17 Jan 2010 05:30:18 +0000 (21:30 -0800)

xdl_merge(): allow passing down marker_size in xmparam_t

This allows the callers of xdl_merge() to pass marker_size (defaults to 7)
in xmparam_t argument, to use conflict markers of non-default length.

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

xdl_merge(): introduce xmparam_t for merge specific... Junio C Hamano Sun, 17 Jan 2010 05:01:28 +0000 (21:01 -0800)

xdl_merge(): introduce xmparam_t for merge specific parameters

So far we have only needed to be able to pass an option that is generic to
xdiff family of functions to this function. Extend the interface so that
we can give it merge specific parameters.

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

git_attr(): fix function signatureJunio C Hamano Sun, 17 Jan 2010 04:39:59 +0000 (20:39 -0800)

git_attr(): fix function signature

The function took (name, namelen) as its arguments, but all the public
callers wanted to pass a full string.

Demote the counted-string interface to an internal API status, and allow
public callers to just pass the string to the function.

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

Do not use date.c:tm_to_time_t() from compat/mingw.cJohannes Sixt Fri, 15 Jan 2010 20:12:21 +0000 (21:12 +0100)

Do not use date.c:tm_to_time_t() from compat/mingw.c

To implement gettimeofday(), a broken-down UTC time was requested from the
system using GetSystemTime(), then tm_to_time_t() was used to convert it
to a time_t because it does not look at the current timezone, which
mktime() would do.

Use GetSystemTimeAsFileTime() and a different conversion path to avoid this
back-reference from the compatibility layer to the generic code.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

MSVC: Windows-native implementation for subset of Pthre... Andrzej K. Haczewski Fri, 15 Jan 2010 20:12:20 +0000 (21:12 +0100)

MSVC: Windows-native implementation for subset of Pthreads API

This patch implements native to Windows subset of pthreads API used by Git.
It allows to remove Pthreads for Win32 dependency for MSVC, msysgit and
Cygwin.

[J6t: If the MinGW build was built as part of the msysgit build
environment, then threading was already enabled because the
pthreads-win32 package is available in msysgit. With this patch, we can now
enable threaded code unconditionally.]

Signed-off-by: Andrzej K. Haczewski <ahaczewski@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 17 Jan 2010 01:30:18 +0000 (17:30 -0800)

Merge branch 'maint'

* maint:
Fix uninitialized variable in get_refs_via_rsync().
Document git-blame triple -C option

Merge branch 'cc/reset-more'Junio C Hamano Sun, 17 Jan 2010 01:18:01 +0000 (17:18 -0800)

Merge branch 'cc/reset-more'

* cc/reset-more:
t7111: fix bad HEAD in tests with unmerged entries

Documentation: Update git core tutorial clarifying... Ramkumar Ramachandra Sat, 16 Jan 2010 18:05:38 +0000 (23:35 +0530)

Documentation: Update git core tutorial clarifying reference to scripts

Back when the git core tutorial was written, porcelain commands were
shell scripts. This patch adds a paragraph explaining this.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

MSVC: Fix an "incompatible pointer types" compiler... Ramsay Jones Fri, 15 Jan 2010 20:12:19 +0000 (21:12 +0100)

MSVC: Fix an "incompatible pointer types" compiler warning

In particular, the following warning is issued while compiling
compat/msvc.c:

...mingw.c(223) : warning C4133: 'function' : incompatible \
types - from '_stati64 *' to '_stat64 *'

which relates to a call of _fstati64() in the mingw_fstat()
function definition.

This is caused by various layers of macro magic and attempts to
avoid macro redefinition compiler warnings. For example, the call
to _fstati64() mentioned above is actually a call to _fstat64(),
and expects a pointer to a struct _stat64 rather than the struct
_stati64 which is passed to mingw_fstat().

The definition of struct _stati64 given in compat/msvc.h had the
same "shape" as the definition of struct _stat64, so the call to
_fstat64() does not actually cause any runtime errors, but the
structure types are indeed incompatible.

In order to avoid the compiler warning, we add declarations for the
mingw_lstat() and mingw_fstat() functions and supporting macros to
msvc.h, suppressing the corresponding declarations in mingw.h, so
that we can use the appropriate structure type (and function) names
from the msvc headers.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Windows: avoid the "dup dance" when spawning a child... Johannes Sixt Fri, 15 Jan 2010 20:12:18 +0000 (21:12 +0100)

Windows: avoid the "dup dance" when spawning a child process

When stdin, stdout, or stderr must be redirected for a child process that
on Windows is spawned using one of the spawn() functions of Microsoft's
C runtime, then there is no choice other than to

1. make a backup copy of fd 0,1,2 with dup
2. dup2 the redirection source fd into 0,1,2
3. spawn
4. dup2 the backup back into 0,1,2
5. close the backup copy and the redirection source

We used this idiom as well -- but we are not using the spawn() functions
anymore!

Instead, we have our own implementation. We had hardcoded that stdin,
stdout, and stderr of the child process were inherited from the parent's
fds 0, 1, and 2. But we can actually specify any fd.

With this patch, the fds to inherit are passed from start_command()'s
WIN32 section to our spawn implementation. This way, we can avoid the
backup copies of the fds.

The backup copies were a bug waiting to surface: The OS handles underlying
the dup()ed fds were inherited by the child process (but were not
associated with a file descriptor in the child). Consequently, the file or
pipe represented by the OS handle remained open even after the backup copy
was closed in the parent process until the child exited.

Since our implementation of pipe() creates non-inheritable OS handles, we
still dup() file descriptors in start_command() because dup() happens to
create inheritable duplicates. (A nice side effect is that the fd cleanup
in start_command is the same for Windows and Unix and remains unchanged.)

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Windows: simplify the pipe(2) implementationJohannes Sixt Fri, 15 Jan 2010 20:12:17 +0000 (21:12 +0100)

Windows: simplify the pipe(2) implementation

Our implementation of pipe() must create non-inheritable handles for the
reason that when a child process is started, there is no opportunity to
close the unneeded pipe ends in the child (on POSIX this is done between
fork() and exec()).

Previously, we used the _pipe() function provided by Microsoft's C runtime
(which creates inheritable handles) and then turned the handles into
non-inheritable handles using the DuplicateHandle() API.

Simplify the procedure by using the CreatePipe() API, which can create
non-inheritable handles right from the beginning.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Windows: boost startup by avoiding a static dependency... Johannes Sixt Fri, 15 Jan 2010 20:12:16 +0000 (21:12 +0100)

Windows: boost startup by avoiding a static dependency on shell32.dll

This DLL is only needed to invoke the browser in a "git help" call. By
looking up the only function that we need at runtime, we can avoid the
startup costs of this DLL.

DLL usage can be profiled with Microsoft's Dependency Walker. For example,
a call to "git diff-files" loaded

before: 19 DLLs
after: 9 DLLs

As a result, the runtime of 'make -j2 test' went down from 16:00min
to 12:40min on one of my boxes.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Windows: disable PythonErik Faye-Lund Fri, 15 Jan 2010 20:12:15 +0000 (21:12 +0100)

Windows: disable Python

Python is not commonly installed on Windows machines, so
we should disable it there by default.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add push --set-upstreamIlari Liusvaara Sat, 16 Jan 2010 21:45:31 +0000 (23:45 +0200)

Add push --set-upstream

Frequent complaint is lack of easy way to set up upstream (tracking)
references for git pull to work as part of push command. So add switch
--set-upstream (-u) to do just that.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7111: fix bad HEAD in tests with unmerged entriesChristian Couder Sat, 16 Jan 2010 09:20:26 +0000 (10:20 +0100)

t7111: fix bad HEAD in tests with unmerged entries

When testing what happens on unmerged entries, the HEAD is the
commit we are starting from before the merge that fails and create
the unmerged entries. It is not the commit before.

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

difftool: Update copyright notices to list each year... David Aguilar Sat, 16 Jan 2010 03:10:03 +0000 (19:10 -0800)

difftool: Update copyright notices to list each year separately

This is http://www.gnu.org/licenses/gpl-howto.html advises.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix uninitialized variable in get_refs_via_rsync().Richard Weinberger Thu, 14 Jan 2010 23:28:59 +0000 (00:28 +0100)

Fix uninitialized variable in get_refs_via_rsync().

This fixes a crash when cloning via rsync://.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Test t5560: Fix test when run with dashTarmigan Casebolt Fri, 15 Jan 2010 06:44:02 +0000 (22:44 -0800)

Test t5560: Fix test when run with dash

A command invocation preceded by variable assignments, i.e.

VAR1=VAL1 VAR2=VAL2 ... command args

are implemented by dash and ksh in such a way not to export these
variables, and keep the values after the command finishes, when the
command is a shell function. POSIX.1 "2.9.5 Function Definition Command"
specifies this behaviour.

Many shells however treat this construct the same way as they are calling
external commands. They export the variables during the duration of
command, and resets their values after command returns.

The test relied on the behaviour of the latter kind.

Reported-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

status: only touch path we may need to checkNguyễn Thái Ngọc Duy Thu, 14 Jan 2010 15:02:21 +0000 (22:02 +0700)

status: only touch path we may need to check

This patch gets rid of whole-tree cache refresh and untracked file
search. Instead only specified path will be looked at.

Again some numbers on gentoo-x86, ~80k files:

Unmodified Git:

$ time git st eclass/
nothing to commit (working directory clean)

real 0m3.211s
user 0m1.977s
sys 0m1.135s

Modified Git:

$ time ~/w/git/git st eclass/
nothing to commit (working directory clean)

real 0m1.587s
user 0m1.426s
sys 0m0.111s

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

difftool: Use eval to expand '--extcmd' expressionsDavid Aguilar Fri, 15 Jan 2010 22:03:44 +0000 (14:03 -0800)

difftool: Use eval to expand '--extcmd' expressions

It was not possible to pass quoted commands to '--extcmd'.
By using 'eval' we ensure that expressions with spaces and
quotes are supported.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

difftool: Add '-x' and as an alias for '--extcmd'David Aguilar Fri, 15 Jan 2010 22:03:43 +0000 (14:03 -0800)

difftool: Add '-x' and as an alias for '--extcmd'

This adds '-x' as a shorthand for the '--extcmd' option.
Arguments to '--extcmd' can be specified separately, which
was not originally possible.

This also fixes the brief help text so that it mentions
both '-x' and '--extcmd'.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7800-difftool.sh: Simplify the --extcmd testDavid Aguilar Fri, 15 Jan 2010 22:03:42 +0000 (14:03 -0800)

t7800-difftool.sh: Simplify the --extcmd test

Instead of running 'grep', 'echo', and 'wc' we simply compare
git-difftool's output against a known good value.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep --no-index: allow use of "git grep" outside a... Junio C Hamano Fri, 15 Jan 2010 20:52:40 +0000 (12:52 -0800)

grep --no-index: allow use of "git grep" outside a git repository

Just like some people wanted diff features that are not found in
other people's diff implementations outside of a git repository
and added --no-index mode to the command, this adds --no-index mode
to the "git grep" command.

Also, inside a git repository, --no-index mode allows you to grep
in untracked (but not ignored) files.

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

grep: prepare to run outside of a work treeJunio C Hamano Fri, 15 Jan 2010 20:50:54 +0000 (12:50 -0800)

grep: prepare to run outside of a work tree

This moves the call to setup_git_directory() for running "grep" from
the "git" wrapper to the implementation of the "grep" subcommand. A
new variable "use_index" is always true at this stage in the series,
and when it is on, we require that we are in a directory that is under
git control. To make sure we die the same way, we make a second call
into setup_git_directory() when we detect this situation.

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

Document git-blame triple -C optionRamkumar Ramachandra Fri, 8 Jan 2010 18:48:07 +0000 (00:18 +0530)

Document git-blame triple -C option

Lift the explanation of -CCC option in the source to the documentation.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: tag may point to any object typeDmitry Potapov Thu, 14 Jan 2010 04:44:19 +0000 (07:44 +0300)

fast-import: tag may point to any object type

If you tried to export the official git repository, and then to import it
back then git-fast-import would die complaining that "Mark :1 not a commit".

Accordingly to a generated crash file, Mark 1 is not a commit but a blob,
which is pointed by junio-gpg-pub tag. Because git-tag allows to create such
tags, git-fast-import should import them.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: allow suppression of implicit identity adviceJeff King Wed, 13 Jan 2010 20:17:08 +0000 (15:17 -0500)

commit: allow suppression of implicit identity advice

We now nag the user with a giant warning when their identity
was pulled from the username, hostname, and gecos
information, in case it is not correct. Most users will
suppress this by simply setting up their information
correctly.

However, there may be some users who consciously want to use
that information, because having the value change from host
to host contains useful information. These users can now set
advice.implicitidentity to false to suppress the message.

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

commit: show interesting ident information in summaryJeff King Wed, 13 Jan 2010 17:39:51 +0000 (12:39 -0500)

commit: show interesting ident information in summary

There are a few cases of user identity information that we consider
interesting:

(1) When the author and committer identities do not match.

(2) When the committer identity was picked automatically from the
username, hostname and GECOS information.

In these cases, we already show the information in the commit
message template. However, users do not always see that template
because they might use "-m" or "-F". With this patch, we show these
interesting cases after the commit, along with the subject and
change summary. The new output looks like:

$ git commit \
-m "federalist papers" \
--author='Publius <alexander@hamilton.com>'
[master 3d226a7] federalist papers
Author: Publius <alexander@hamilton.com>
1 files changed, 1 insertions(+), 0 deletions(-)

for case (1), and:

$ git config --global --unset user.name
$ git config --global --unset user.email
$ git commit -m foo
[master 7c2a927] foo
Committer: Jeff King <peff@c-71-185-130-222.hsd1.va.comcast.net>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config --global user.name Your Name
git config --global user.email you@example.com

If the identity used for this commit is wrong, you can fix it with:

git commit --amend --author='Your Name <you@example.com>'

1 files changed, 1 insertions(+), 0 deletions(-)

for case (2).

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

strbuf: add strbuf_addbuf_percentquoteJeff King Wed, 13 Jan 2010 17:36:42 +0000 (12:36 -0500)

strbuf: add strbuf_addbuf_percentquote

This is handy for creating strings which will be fed to printf() or
strbuf_expand().

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

strbuf_expand: convert "%%" to "%"Jeff King Wed, 13 Jan 2010 17:35:31 +0000 (12:35 -0500)

strbuf_expand: convert "%%" to "%"

The only way to safely quote arbitrary text in a pretty-print user
format is to replace instances of "%" with "%x25". This is slightly
unreadable, and many users would expect "%%" to produce a single
"%", as that is what printf format specifiers do.

This patch converts "%%" to "%" for all users of strbuf_expand():

(1) git-daemon interpolated paths

(2) pretty-print user formats

(3) merge driver command lines

Case (1) was already doing the conversion itself outside of
strbuf_expand(). Case (2) is the intended beneficiary of this patch.
Case (3) users probably won't notice, but as this is user-facing
behavior, consistently providing the quoting mechanism makes sense.

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

rebase -i: Retain user-edited commit messages after... Michael Haggerty Thu, 14 Jan 2010 05:54:57 +0000 (06:54 +0100)

rebase -i: Retain user-edited commit messages after squash/fixup conflicts

When a squash/fixup fails due to a conflict, the user is required to
edit the commit message. Previously, if further squash/fixup commands
followed the conflicting squash/fixup, this user-edited message was
discarded and a new automatically-generated commit message was
suggested.

Change the handling of conflicts within squash/fixup command series:
Whenever the user is required to intervene, consider the resulting
commit to be a new basis for the following squash/fixups and use its
commit message in later suggested combined commit messages.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3404: Set up more of the test repo in the "setup"... Michael Haggerty Thu, 14 Jan 2010 05:54:56 +0000 (06:54 +0100)

t3404: Set up more of the test repo in the "setup" step

...and reuse these pre-created branches in tests rather than creating
duplicates.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: For fixup commands without squashes, do... Michael Haggerty Thu, 14 Jan 2010 05:54:55 +0000 (06:54 +0100)

rebase -i: For fixup commands without squashes, do not start editor

If the "rebase -i" commands include a series of fixup commands without
any squash commands, then commit the combined commit using the commit
message of the corresponding "pick" without starting up the
commit-message editor.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Change function make_squash_message into... Michael Haggerty Thu, 14 Jan 2010 05:54:54 +0000 (06:54 +0100)

rebase -i: Change function make_squash_message into update_squash_message

Alter the file $SQUASH_MSG in place rather than outputting the new
message then juggling it around. Change the function name
accordingly.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Extract function do_with_authorMichael Haggerty Thu, 14 Jan 2010 05:54:53 +0000 (06:54 +0100)

rebase -i: Extract function do_with_author

Call it instead of repeating similar code blocks in several places.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Handle the author script all in one place... Michael Haggerty Thu, 14 Jan 2010 05:54:52 +0000 (06:54 +0100)

rebase -i: Handle the author script all in one place in do_next

This change has no practical effect but makes the code easier to
follow.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Extract a function "commit_message"Michael Haggerty Thu, 14 Jan 2010 05:54:51 +0000 (06:54 +0100)

rebase -i: Extract a function "commit_message"

...instead of repeating the same short but slightly obscure blob of
code in several places.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Simplify commit counting for generated commi... Michael Haggerty Thu, 14 Jan 2010 05:54:50 +0000 (06:54 +0100)

rebase -i: Simplify commit counting for generated commit messages

Read the old count from the first line of the old commit message
rather than counting the number of commit message blocks in the file.
This is simpler, faster, and more robust (e.g., it cannot be confused
by strange commit message contents).

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Improve consistency of commit count in gener... Michael Haggerty Thu, 14 Jan 2010 05:54:49 +0000 (06:54 +0100)

rebase -i: Improve consistency of commit count in generated commit messages

Use the numeral "2" instead of the word "two" when two commits are
being interactively squashed. This makes the treatment consistent
with that for higher numbers of commits.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3404: Test the commit count in commit messages generat... Michael Haggerty Thu, 14 Jan 2010 05:54:48 +0000 (06:54 +0100)

t3404: Test the commit count in commit messages generated by "rebase -i"

The first line of commit messages generated for "rebase -i"
squash/fixup commits includes a count of the number of commits that
are being combined. Add machinery to check that this count is
correct, and add such a check to some test cases.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Introduce a constant AMENDMichael Haggerty Thu, 14 Jan 2010 05:54:47 +0000 (06:54 +0100)

rebase -i: Introduce a constant AMEND

Add a constant AMEND holding the filename of the $DOTEST/amend file,
and document how this temporary file is used.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Introduce a constant AUTHOR_SCRIPTMichael Haggerty Thu, 14 Jan 2010 05:54:46 +0000 (06:54 +0100)

rebase -i: Introduce a constant AUTHOR_SCRIPT

Add a constant AUTHOR_SCRIPT, holding the filename of the
$DOTEST/author_script file, and document how this temporary file is
used.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Document how temporary files are usedMichael Haggerty Thu, 14 Jan 2010 05:54:45 +0000 (06:54 +0100)

rebase -i: Document how temporary files are used

Add documentation, inferred by reverse-engineering, about how
git-rebase--interactive.sh uses many of its temporary files.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Use symbolic constant $MSG consistentlyMichael Haggerty Thu, 14 Jan 2010 05:54:44 +0000 (06:54 +0100)

rebase -i: Use symbolic constant $MSG consistently

The filename constant $MSG was previously used in some places and
written out literally in others.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Use "test -n" instead of "test ! -z"Michael Haggerty Thu, 14 Jan 2010 05:54:43 +0000 (06:54 +0100)

rebase -i: Use "test -n" instead of "test ! -z"

It is a tiny bit simpler.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Inline expressionMichael Haggerty Thu, 14 Jan 2010 05:54:42 +0000 (06:54 +0100)

rebase -i: Inline expression

Inline expression when generating output rather than overwriting the
"sha1" local variable with a short SHA1.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Remove dead codeMichael Haggerty Thu, 14 Jan 2010 05:54:41 +0000 (06:54 +0100)

rebase -i: Remove dead code

This branch of the "if" is only executed if $no_ff is empty, which
only happens if $1 was not '-n'. (This code has been dead since
1d25c8cf82eead72e11287d574ef72d3ebec0db1.)

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: Make the condition for an "if" more transparentMichael Haggerty Thu, 14 Jan 2010 05:54:40 +0000 (06:54 +0100)

rebase -i: Make the condition for an "if" more transparent

Test $no_ff separately rather than testing it indirectly by gluing it
onto a comparison of two SHA1s.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/checkout-merge-base'Junio C Hamano Wed, 13 Jan 2010 20:31:13 +0000 (12:31 -0800)

Merge branch 'jc/checkout-merge-base'

* jc/checkout-merge-base:
rebase -i: teach --onto A...B syntax
rebase: fix --onto A...B parsing and add tests
"rebase --onto A...B" replays history on the merge base between A and B
"checkout A...B" switches to the merge base between A and B

Merge branch 'rs/maint-archive-match-pathspec'Junio C Hamano Wed, 13 Jan 2010 20:31:01 +0000 (12:31 -0800)

Merge branch 'rs/maint-archive-match-pathspec'

* rs/maint-archive-match-pathspec:
archive: complain about path specs that don't match anything

Merge branch 'il/vcs-helper'Junio C Hamano Wed, 13 Jan 2010 20:30:39 +0000 (12:30 -0800)

Merge branch 'il/vcs-helper'

* il/vcs-helper:
Reset possible helper before reusing remote structure
Remove special casing of http, https and ftp
Support remote archive from all smart transports
Support remote helpers implementing smart transports
Support taking over transports
Refactor git transport options parsing
Pass unknown protocols to external protocol handlers
Support mandatory capabilities
Add remote helper debug mode

Conflicts:
Documentation/git-remote-helpers.txt
transport-helper.c

strbuf_addbuf(): allow passing the same buf to dst... Junio C Hamano Tue, 12 Jan 2010 20:09:54 +0000 (12:09 -0800)

strbuf_addbuf(): allow passing the same buf to dst and src

If sb and sb2 are the same (i.e. doubling the string), the underlying
strbuf_add() can make sb2->buf invalid by calling strbuf_grow(sb) at
the beginning; if realloc(3) done by strbuf_grow() needs to move the
string, strbuf_add() will read from an already freed buffer.

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

Merge branch 'cc/reset-more'Junio C Hamano Wed, 13 Jan 2010 19:58:56 +0000 (11:58 -0800)

Merge branch 'cc/reset-more'

* cc/reset-more:
t7111: check that reset options work as described in the tables
Documentation: reset: add some missing tables
Fix bit assignment for CE_CONFLICTED
"reset --merge": fix unmerged case
reset: use "unpack_trees()" directly instead of "git read-tree"
reset: add a few tests for "git reset --merge"
Documentation: reset: add some tables to describe the different options
reset: improve mixed reset error message when in a bare repo

Merge branch 'nd/sparse'Junio C Hamano Wed, 13 Jan 2010 19:58:34 +0000 (11:58 -0800)

Merge branch 'nd/sparse'

* nd/sparse: (25 commits)
t7002: test for not using external grep on skip-worktree paths
t7002: set test prerequisite "external-grep" if supported
grep: do not do external grep on skip-worktree entries
commit: correctly respect skip-worktree bit
ie_match_stat(): do not ignore skip-worktree bit with CE_MATCH_IGNORE_VALID
tests: rename duplicate t1009
sparse checkout: inhibit empty worktree
Add tests for sparse checkout
read-tree: add --no-sparse-checkout to disable sparse checkout support
unpack-trees(): ignore worktree check outside checkout area
unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final index
unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkout
unpack-trees.c: generalize verify_* functions
unpack-trees(): add CE_WT_REMOVE to remove on worktree alone
Introduce "sparse checkout"
dir.c: export excluded_1() and add_excludes_from_file_1()
excluded_1(): support exclude files in index
unpack-trees(): carry skip-worktree bit over in merged_entry()
Read .gitignore from index if it is skip-worktree
Avoid writing to buffer in add_excludes_from_file_1()
...

Conflicts:
.gitignore
Documentation/config.txt
Documentation/git-update-index.txt
Makefile
entry.c
t/t7002-grep.sh

t7502: test commit.status, --status and --no-statusJunio C Hamano Wed, 13 Jan 2010 08:12:54 +0000 (00:12 -0800)

t7502: test commit.status, --status and --no-status

Make sure that the status information:

- is shown as before without configuration nor command line option;

- is shown if commit.status is set to true and no command line option
is given, or --status is explicitly given;

- is not shown if commit.status is set to false and no command line
option is given, or --no-status is explicitly given.

Also make sure that the way lines taken from the custom --template appear
in the log message editor is not changed at all.

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

grep: rip out pessimization to use fixmatch()Junio C Hamano Wed, 13 Jan 2010 03:21:46 +0000 (19:21 -0800)

grep: rip out pessimization to use fixmatch()

Even when running without the -F (--fixed-strings) option, we checked the
pattern and used fixmatch() codepath when it does not contain any regex
magic. Finding fixed strings with strstr() surely must be faster than
running the regular expression crud.

Not so. It turns out that on some libc implementations, using the
regcomp()/regexec() pair is a lot faster than running strstr() and
strcasestr() the fixmatch() codepath uses. Drop the optimization and use
the fixmatch() codepath only when the user explicitly asked for it with
the -F option.

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

grep: rip out support for external grepJunio C Hamano Wed, 13 Jan 2010 03:06:41 +0000 (19:06 -0800)

grep: rip out support for external grep

We still allow people to pass --[no-]ext-grep on the command line,
but the option is ignored.

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

commit: support commit.status, --status, and --no-statusJames P. Howard, II Mon, 7 Dec 2009 22:45:27 +0000 (17:45 -0500)

commit: support commit.status, --status, and --no-status

A new configuration variable commit.status, and new command line
options --status, and --no-status control whether or not the git
status information is included in the commit message template
when using an editor to prepare the commit message. It does not
affect the effects of a user's commit.template settings.

Signed-off-by: James P. Howard, II <jh@jameshoward.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 12 Jan 2010 23:48:38 +0000 (15:48 -0800)

Merge branch 'maint'

* maint:
remote-curl: Fix Accept header for smart HTTP connections
grep: -L should show empty files
rebase--interactive: Ignore comments and blank lines in peek_next_command

lockfile: show absolute filename in unable_to_lock_messageMatthieu Moy Thu, 7 Jan 2010 14:54:10 +0000 (15:54 +0100)

lockfile: show absolute filename in unable_to_lock_message

When calling a git command from a subdirectory and a file locking fails,
the user will get a path relative to the root of the worktree, which is
invalid from the place where the command is ran. Make it easy for the
user to know which file it is.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

hg-to-git: fix COMMITTER type-oBart Trojanowski Sat, 9 Jan 2010 00:54:39 +0000 (19:54 -0500)

hg-to-git: fix COMMITTER type-o

This script passes the author and committer to git-commit via environment
variables, but it was missing the seccond T of COMMITTER in a few places.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
Acked-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Be more user-friendly when refusing to do something... Matthieu Moy Tue, 12 Jan 2010 09:54:44 +0000 (10:54 +0100)

Be more user-friendly when refusing to do something because of conflict.

Various commands refuse to run in the presence of conflicts (commit,
merge, pull, cherry-pick/revert). They all used to provide rough, and
inconsistant error messages.

A new variable advice.resolveconflict is introduced, and allows more
verbose messages, pointing the user to the appropriate solution.

For commit, the error message used to look like this:

$ git commit
foo.txt: needs merge
foo.txt: unmerged (c34a92682e0394bc0d6f4d4a67a8e2d32395c169)
foo.txt: unmerged (3afcd75de8de0bb5076942fcb17446be50451030)
foo.txt: unmerged (c9785d77b76dfe4fb038bf927ee518f6ae45ede4)
error: Error building trees

The "need merge" line is given by refresh_cache. We add the IN_PORCELAIN
option to make the output more consistant with the other porcelain
commands, and catch the error in return, to stop with a clean error
message. The next lines were displayed by a call to cache_tree_update(),
which is not reached anymore if we noticed the conflict.

The new output looks like:

U foo.txt
fatal: 'commit' is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>' as
appropriate to mark resolution and make a commit, or use 'git commit -a'.

Pull is slightly modified to abort immediately if $GIT_DIR/MERGE_HEAD
exists instead of waiting for merge to complain.

The behavior of merge and the test-case are slightly modified to reflect
the usual flow: start with conflicts, fix them, and afterwards get rid of
MERGE_HEAD, with different error messages at each stage.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve error message when a transport helper was not... Ilari Liusvaara Tue, 12 Jan 2010 19:53:29 +0000 (20:53 +0100)

Improve error message when a transport helper was not found

Perviously, the error message was:

git: 'remote-foo' is not a git-command. See 'git --help'.

By not treating the transport helper as a git command, a more suitable
error is reported:

fatal: Unable to find remote helper for 'foo'

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-curl: Fix Accept header for smart HTTP connectionsShawn O. Pearce Tue, 12 Jan 2010 17:54:04 +0000 (09:54 -0800)

remote-curl: Fix Accept header for smart HTTP connections

We actually expect to see an application/x-git-upload-pack-result
but we lied and said we Accept *-response. This was a typo on my
part when I was writing the code.

Fortunately the wrong Accept header had no real impact, as the
deployed git-http-backend servers were not testing the Accept
header before they returned their content.

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

rebase-i: Ignore comments and blank lines in peek_next_... Michael Haggerty Tue, 12 Jan 2010 15:38:36 +0000 (16:38 +0100)

rebase-i: Ignore comments and blank lines in peek_next_command

Previously, blank lines and/or comments within a series of
squash/fixup commands would confuse "git rebase -i" into thinking that
the series was finished. It would therefore require the user to edit
the commit message for the squash/fixup commits seen so far. Then,
after continuing, it would ask the user to edit the commit message
again.

Ignore comments and blank lines within a group of squash/fixup
commands, allowing them to be processed in one go.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

lib-rebase: Allow comments and blank lines to be added... Michael Haggerty Tue, 12 Jan 2010 15:38:35 +0000 (16:38 +0100)

lib-rebase: Allow comments and blank lines to be added to the rebase script

(For testing "rebase -i"): Support new action types in $FAKE_LINES to
allow comments and blank lines to be added to the "rebase -i" command
list.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

lib-rebase: Provide clearer debugging info about what... Michael Haggerty Tue, 12 Jan 2010 15:38:34 +0000 (16:38 +0100)

lib-rebase: Provide clearer debugging info about what the editor did

(For testing "rebase -i"): Output the "rebase -i" command script
before and after the edits, to make it clearer what the editor did.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

strbuf.c: remove unused functionJunio C Hamano Tue, 12 Jan 2010 05:16:26 +0000 (21:16 -0800)

strbuf.c: remove unused function

strbuf_tolower() is not used anywhere.

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

sha1_file.c: remove unused functionJunio C Hamano Tue, 12 Jan 2010 05:17:56 +0000 (21:17 -0800)

sha1_file.c: remove unused function

has_pack_file() is not used anywhere.

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

mailmap.c: remove unused functionJunio C Hamano Tue, 12 Jan 2010 05:11:22 +0000 (21:11 -0800)

mailmap.c: remove unused function

map_email() is not used anywhere.

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

utf8.c: mark file-local function staticJunio C Hamano Tue, 12 Jan 2010 06:32:29 +0000 (22:32 -0800)

utf8.c: mark file-local function static

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

submodule.c: mark file-local function staticJunio C Hamano Tue, 12 Jan 2010 06:31:58 +0000 (22:31 -0800)

submodule.c: mark file-local function static

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

quote.c: mark file-local function staticJunio C Hamano Tue, 12 Jan 2010 06:31:06 +0000 (22:31 -0800)

quote.c: mark file-local function static

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

remote-curl.c: mark file-local function staticJunio C Hamano Tue, 12 Jan 2010 06:30:36 +0000 (22:30 -0800)

remote-curl.c: mark file-local function static

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

read-cache.c: mark file-local functions staticJunio C Hamano Tue, 12 Jan 2010 06:29:35 +0000 (22:29 -0800)

read-cache.c: mark file-local functions static

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

parse-options.c: mark file-local function staticJunio C Hamano Tue, 12 Jan 2010 06:28:45 +0000 (22:28 -0800)

parse-options.c: mark file-local function static

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

entry.c: mark file-local function staticJunio C Hamano Tue, 12 Jan 2010 06:27:31 +0000 (22:27 -0800)

entry.c: mark file-local function static

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

http.c: mark file-local functions staticJunio C Hamano Tue, 12 Jan 2010 06:26:08 +0000 (22:26 -0800)

http.c: mark file-local functions static

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

Merge branch 'jc/maint-1.6.4-grep-lookahead' into jc... Junio C Hamano Tue, 12 Jan 2010 08:56:15 +0000 (00:56 -0800)

Merge branch 'jc/maint-1.6.4-grep-lookahead' into jc/maint-grep-lookahead

* jc/maint-1.6.4-grep-lookahead:
grep: optimize built-in grep by skipping lines that do not hit

This needs to be an evil merge as fixmatch() changed signature since
5183bf6 (grep: Allow case insensitive search of fixed-strings,
2009-11-06).

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

grep: optimize built-in grep by skipping lines that... Junio C Hamano Mon, 11 Jan 2010 06:39:36 +0000 (22:39 -0800)

grep: optimize built-in grep by skipping lines that do not hit

The internal "grep" engine we use checks for hits line-by-line, instead of
letting the underlying regexec()/fixmatch() routines scan for the first
match from the rest of the buffer. This was a major source of overhead
compared to the external grep.

Introduce a "look-ahead" mechanism to find the next line that would
potentially match by using regexec()/fixmatch() in the remainder of the
text to skip unmatching lines, and use it when the query criteria is
simple enough (i.e. punt for an advanced grep boolean expression like
"lines that have both X and Y but not Z" for now) and we are not running
under "-v" (aka "--invert-match") option.

Note that "-L" (aka "--files-without-match") is not a reason to disable
this optimization. Under the option, we are interested if the file has
any hit at all, and that is what we determine reliably with or without the
optimization.

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