gitweb.git
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>

grep: -L should show empty filesJunio C Hamano Tue, 12 Jan 2010 08:22:23 +0000 (00:22 -0800)

grep: -L should show empty files

The -L (--files-without-match) option is supposed to show paths that
produced no matches. When running the internal grep on work tree files,
however, we had an optimization to just return on zero-sized files,
without doing anything.

This optimization doesn't matter too much in practice (a tracked empty
file must be rare, or there is something wrong with your project); to
produce results consistent with GNU grep, we should stop the optimization
and show empty files as not having the given pattern.

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

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

pretty.c: mark file-local function static

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

builtin-rev-list.c: mark file-local function staticJunio C Hamano Tue, 12 Jan 2010 06:21:18 +0000 (22:21 -0800)

builtin-rev-list.c: mark file-local function static

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

bisect.c: mark file-local function staticJunio C Hamano Tue, 12 Jan 2010 05:20:55 +0000 (21:20 -0800)

bisect.c: mark file-local function static

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

push: spell 'Note about fast-forwards' section name... Matthieu Moy Mon, 11 Jan 2010 21:09:44 +0000 (22:09 +0100)

push: spell 'Note about fast-forwards' section name correctly in error message.

The error message in case of non-fast forward points to 'git push
--help', but used to talk about a section 'non-fast-forward', while the
actual section name is 'Note about fast-forwards'.

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

rebase--interactive: Ignore comments and blank lines... Michael Haggerty Mon, 11 Jan 2010 15:56:45 +0000 (16:56 +0100)

rebase--interactive: 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>

Add missing #include to support TIOCGWINSZ on SolarisNguyễn Thái Ngọc Duy Mon, 11 Jan 2010 10:41:01 +0000 (17:41 +0700)

Add missing #include to support TIOCGWINSZ on Solaris

On Linux TIOCGWINSZ is defined somehwere in ioctl.h, which is already
included. On Solaris we also need to include termios.h. Without this
term_columns() in help.c will think TIOCGWINSZ is not supported and
always return 80 columns.

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

Remove empty directories when checking out a commit... Peter Collingbourne Mon, 11 Jan 2010 02:59:54 +0000 (02:59 +0000)

Remove empty directories when checking out a commit with fewer submodules

Change the unlink_entry function to use rmdir to remove submodule
directories. Currently we try to use unlink, which will never succeed.

Of course rmdir will only succeed for empty (i.e. not checked out)
submodule directories. Behaviour if a submodule is checked out stays
essentially the same: print a warning message and keep the submodule
directory.

Signed-off-by: Peter Collingbourne <peter@pcc.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use $(git rev-parse --show-toplevel) in cd_to_toplevel().Steven Drake Mon, 11 Jan 2010 22:34:34 +0000 (11:34 +1300)

Use $(git rev-parse --show-toplevel) in cd_to_toplevel().

rev-parse --show-toplevel gives the absolute (aka "physical") path of the
toplevel directory and is more portable as 'cd -P' is not supported by all
shell implementations.

This is also closer to what setup_work_tree() does.

Signed-off-by: Steven Drake <sdrake@xnet.co.nz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add 'git rev-parse --show-toplevel' option.Steven Drake Mon, 11 Jan 2010 22:33:48 +0000 (11:33 +1300)

Add 'git rev-parse --show-toplevel' option.

Shows the absolute path of the top-level working directory.

Signed-off-by: Steven Drake <sdrake@xnet.co.nz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rerere forget path: forget recorded resolutionJunio C Hamano Fri, 25 Dec 2009 23:51:32 +0000 (15:51 -0800)

rerere forget path: forget recorded resolution

After you find out an earlier resolution you told rerere to use was a
mismerge, there is no easy way to clear it. A new subcommand "forget" can
be used to tell git to forget a recorded resolution, so that you can redo
the merge from scratch.

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

rerere: refactor rerere logic to make it independent... Junio C Hamano Fri, 25 Dec 2009 22:34:53 +0000 (14:34 -0800)

rerere: refactor rerere logic to make it independent from I/O

This splits the handle_file() function into in-core part and I/O
parts of the logic to create the preimage, so that we can compute
the conflict identifier without having to use temporary files.

Earlier, I thought the output from handle_file() should also be
refactored, but it is always about writing preimage (or thisimage)
that is used for later three-way merge, so it is saner to keep it
to always write to FILE *.

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

start_command: detect execvp failures earlyJohannes Sixt Sun, 10 Jan 2010 13:11:22 +0000 (14:11 +0100)

start_command: detect execvp failures early

Previously, failures during execvp could be detected only by
finish_command. However, in some situations it is beneficial for the
parent process to know earlier that the child process will not run.

The idea to use a pipe to signal failures to the parent process and
the test case were lifted from patches by Ilari Liusvaara.

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

run-command: move wait_or_whine earlierJohannes Sixt Sun, 10 Jan 2010 13:08:45 +0000 (14:08 +0100)

run-command: move wait_or_whine earlier

We want to reuse it from start_command.

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

start_command: report child process setup errors to... Johannes Sixt Sun, 10 Jan 2010 13:07:52 +0000 (14:07 +0100)

start_command: report child process setup errors to the parent's stderr

When the child process's environment is set up in start_command(), error
messages were written to wherever the parent redirected the child's stderr
channel. However, even if the parent redirected the child's stderr, errors
during this setup process, including the exec itself, are usually an
indication of a problem in the parent's environment. Therefore, the error
messages should go to the parent's stderr.

Redirection of the child's error messages is usually only used to redirect
hook error messages during client-server exchanges. In these cases, hook
setup errors could be regarded as information leak.

This patch makes a copy of stderr if necessary and uses a special
die routine that is used for all die() calls in the child that sends the
errors messages to the parent's stderr.

The trace call that reported a failed execvp is removed (because it writes
to stderr) and replaced by die_errno() with special treatment of ENOENT.
The improvement in the error message can be seen with this sequence:

mkdir .git/hooks/pre-commit
git commit

Previously, the error message was

error: cannot run .git/hooks/pre-commit: No such file or directory

and now it is

fatal: cannot exec '.git/hooks/pre-commit': Permission denied

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

ident.c: treat $EMAIL as giving user.email identity... Junio C Hamano Fri, 8 Jan 2010 16:01:10 +0000 (08:01 -0800)

ident.c: treat $EMAIL as giving user.email identity explicitly

The environment variable EMAIL has been honored since 28a94f8 (Fall back
to $EMAIL for missing GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL,
2007-04-28) as the end-user's wish to use the address as the identity.
When we use it, we should say we are explicitly given email by the user.

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

ident.c: check explicit identity for name and email... Junio C Hamano Fri, 8 Jan 2010 15:39:11 +0000 (07:39 -0800)

ident.c: check explicit identity for name and email separately

bb1ae3f (commit: Show committer if automatic, 2008-05-04) added a logic to
check both name and email were given explicitly by the end user, but it
assumed that fmt_ident() is never called before git_default_user_config()
is called, which was fragile. The former calls setup_ident() and fills
the "default" name and email, so the check in the config parser would have
mistakenly said both are given even if only user.name was provided.

Make the logic more robust by keeping track of name and email separately.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Santi Béjar <santi@agolina.net>

Merge branch 'tr/http-updates'Junio C Hamano Sun, 10 Jan 2010 16:53:04 +0000 (08:53 -0800)

Merge branch 'tr/http-updates'

* tr/http-updates:
Remove http.authAny
Allow curl to rewind the RPC read buffer
Add an option for using any HTTP authentication scheme, not only basic
http: maintain curl sessions

Merge branch 'jk/maint-1.6.5-reset-hard'Junio C Hamano Sun, 10 Jan 2010 16:52:53 +0000 (08:52 -0800)

Merge branch 'jk/maint-1.6.5-reset-hard'

* jk/maint-1.6.5-reset-hard:
reset: unbreak hard resets with GIT_WORK_TREE

Merge branch 'jk/push-to-delete'Junio C Hamano Sun, 10 Jan 2010 16:52:45 +0000 (08:52 -0800)

Merge branch 'jk/push-to-delete'

* jk/push-to-delete:
builtin-push: add --delete as syntactic sugar for :foo

Merge branch 'mm/config-path'Junio C Hamano Sun, 10 Jan 2010 16:52:41 +0000 (08:52 -0800)

Merge branch 'mm/config-path'

* mm/config-path:
builtin-config: add --path option doing ~ and ~user expansion.

Merge branch 'pm/cvs-environ'Junio C Hamano Sun, 10 Jan 2010 16:52:37 +0000 (08:52 -0800)

Merge branch 'pm/cvs-environ'

* pm/cvs-environ:
CVS Server: Support reading base and roots from environment

Merge branch 'tr/maint-1.6.5-bash-prompt-show-submodule... Junio C Hamano Sun, 10 Jan 2010 16:52:32 +0000 (08:52 -0800)

Merge branch 'tr/maint-1.6.5-bash-prompt-show-submodule-changes'

* tr/maint-1.6.5-bash-prompt-show-submodule-changes:
bash completion: factor submodules into dirty state

Merge branch 'bg/maint-remote-update-default'Junio C Hamano Sun, 10 Jan 2010 16:52:24 +0000 (08:52 -0800)

Merge branch 'bg/maint-remote-update-default'

* bg/maint-remote-update-default:
Fix "git remote update" with remotes.defalt set

Merge branch 'mm/diag-path-in-treeish'Junio C Hamano Sun, 10 Jan 2010 16:52:10 +0000 (08:52 -0800)

Merge branch 'mm/diag-path-in-treeish'

* mm/diag-path-in-treeish:
Detailed diagnosis when parsing an object name fails.

Merge branch 'fc/opt-quiet-gc-reset'Junio C Hamano Sun, 10 Jan 2010 16:52:06 +0000 (08:52 -0800)

Merge branch 'fc/opt-quiet-gc-reset'

* fc/opt-quiet-gc-reset:
General --quiet improvements

Documentation: spell 'git cmd' without dash throughoutThomas Rast Sat, 9 Jan 2010 23:33:00 +0000 (00:33 +0100)

Documentation: spell 'git cmd' without dash throughout

The documentation was quite inconsistent when spelling 'git cmd' if it
only refers to the program, not to some specific invocation syntax:
both 'git-cmd' and 'git cmd' spellings exist.

The current trend goes towards dashless forms, and there is precedent
in 647ac70 (git-svn.txt: stop using dash-form of commands.,
2009-07-07) to actively eliminate the dashed variants.

Replace 'git-cmd' with 'git cmd' throughout, except where git-shell,
git-cvsserver, git-upload-pack, git-receive-pack, and
git-upload-archive are concerned, because those really live in the
$PATH.

Documentation: format full commands in typewriter fontThomas Rast Thu, 7 Jan 2010 16:49:12 +0000 (17:49 +0100)

Documentation: format full commands in typewriter font

Use `code snippet` style instead of 'emphasis' for `git cmd ...`
according to the following rules:

* The SYNOPSIS sections are left untouched.

* If the intent is that the user type the command exactly as given, it
is `code`.
If the user is only loosely referred to a command and/or option, it
remains 'emphasised'.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>

Merge branch 'maint'Junio C Hamano Sun, 10 Jan 2010 08:52:04 +0000 (00:52 -0800)

Merge branch 'maint'

* maint:
base85: Make the code more obvious instead of explaining the non-obvious
base85: encode_85() does not use the decode table
base85 debug code: Fix length byte calculation
Documentation: tiny git config manual tweaks
Documentation: git gc packs refs by default now
checkout -m: do not try to fall back to --merge from an unborn branch

Merge branch 'maint-1.6.2' into maintJunio C Hamano Sun, 10 Jan 2010 08:51:54 +0000 (00:51 -0800)

Merge branch 'maint-1.6.2' into maint

* maint-1.6.2:
base85: Make the code more obvious instead of explaining the non-obvious
base85: encode_85() does not use the decode table
base85 debug code: Fix length byte calculation
checkout -m: do not try to fall back to --merge from an unborn branch

Conflicts:
diff.c

Merge branch 'maint-1.6.1' into maint-1.6.2Junio C Hamano Sun, 10 Jan 2010 08:49:47 +0000 (00:49 -0800)

Merge branch 'maint-1.6.1' into maint-1.6.2

* maint-1.6.1:
base85: Make the code more obvious instead of explaining the non-obvious
base85: encode_85() does not use the decode table
base85 debug code: Fix length byte calculation
checkout -m: do not try to fall back to --merge from an unborn branch
branch: die explicitly why when calling "git branch [-a|-r] branchname".
textconv: stop leaking file descriptors
commit: --cleanup is a message option
git count-objects: handle packs bigger than 4G
t7102: make the test fail if one of its check fails

Conflicts:
diff.c

Merge branch 'maint-1.6.0' into maint-1.6.1Junio C Hamano Sun, 10 Jan 2010 08:48:47 +0000 (00:48 -0800)

Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
base85: Make the code more obvious instead of explaining the non-obvious
base85: encode_85() does not use the decode table
base85 debug code: Fix length byte calculation
checkout -m: do not try to fall back to --merge from an unborn branch
branch: die explicitly why when calling "git branch [-a|-r] branchname".

daemon: consider only address in kill_some_child()Erik Faye-Lund Sat, 9 Jan 2010 14:13:28 +0000 (15:13 +0100)

daemon: consider only address in kill_some_child()

kill_some_child() compares the entire sockaddr_storage
structure (with the pad-bits zeroed out) when trying to
find out if connections originate from the same host.
However, sockaddr_storage contains the port-number for
the connection (which varies between connections), so
the comparison always fails.

Change the code so we only consider the host-address,
by introducing the addrcmp()-function that inspects
the address family and compare as appropriate.

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

Handle relative paths in submodule .git filesBrad King Sat, 9 Jan 2010 03:36:41 +0000 (22:36 -0500)

Handle relative paths in submodule .git files

Commit 842abf0 (Teach resolve_gitlink_ref() about the .git file, 2008-02-20)
taught resolve_gitlink_ref() to call read_gitfile_gently() to resolve .git
files. In this commit teach read_gitfile_gently() to interpret a relative
path in a .git file with respect to the file location.

This change allows update-index to recognize a submodule that uses a relative
path in its .git file. It previously failed because the relative path was
wrongly interpreted with respect to the superproject directory.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Test update-index for a gitlink to a .git fileBrad King Sat, 9 Jan 2010 03:36:40 +0000 (22:36 -0500)

Test update-index for a gitlink to a .git file

Check that update-index recognizes a submodule that uses a .git file.
Currently it works when the .git file specifies an absolute path, but
not when it specifies a relative path.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

help: fix configured help format taking over command... Christian Couder Sat, 9 Jan 2010 05:10:05 +0000 (06:10 +0100)

help: fix configured help format taking over command line one

Since commit 7c3baa9 (help -a: do not unnecessarily look for a
repository, 2009-09-04), the help format that is passed as a
command line option is not used if an help format has been
configured. This patch fixes that.

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

string-list: rename the include guard to STRING_LIST_HThiago Farina Fri, 8 Jan 2010 22:45:08 +0000 (17:45 -0500)

string-list: rename the include guard to STRING_LIST_H

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7111: check that reset options work as described in... Christian Couder Fri, 8 Jan 2010 04:45:10 +0000 (05:45 +0100)

t7111: check that reset options work as described in the tables

Some previous patches added some tables to the "git reset"
documentation. These tables describe the behavior of "git reset"
depending on the option it is passed and the state of the files
in the working tree, the index, HEAD and the target commit.

This patch adds some tests to make sure that the tables describe
the behavior of "git reset".

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

transport-helper.c::push_refs(): emit "no refs" error... Tay Ray Chuan Fri, 8 Jan 2010 02:12:45 +0000 (10:12 +0800)

transport-helper.c::push_refs(): emit "no refs" error message

Emit an error message when remote_refs is not set.

This behaviour is consistent with that of builtin-send-pack.c and
http-push.c.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport-helper.c::push_refs(): ignore helper-reported... Tay Ray Chuan Fri, 8 Jan 2010 02:12:44 +0000 (10:12 +0800)

transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed

If the status of a ref is REF_STATUS_NONE, the remote helper will not
be told to push the ref (via a 'push' command).

However, the remote helper may still act on these refs.

If the helper does act on the ref, and prints a status for it, ignore
the report (ie. don't overwrite the status of the ref with it, nor the
message in the remote_status member) if the reported status is 'no
match'.

This allows the user to be alerted to more "interesting" ref statuses,
like REF_STATUS_NONFASTFORWARD.

Cc: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport.c::transport_push(): make ref status affect... Tay Ray Chuan Fri, 8 Jan 2010 02:12:43 +0000 (10:12 +0800)

transport.c::transport_push(): make ref status affect return value

Use push_had_errors() to check the refs for errors and modify the
return value.

Mark the non-fast-forward push tests to succeed.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refactor ref status logic for pushingTay Ray Chuan Fri, 8 Jan 2010 02:12:42 +0000 (10:12 +0800)

refactor ref status logic for pushing

Move the logic that detects up-to-date and non-fast-forward refs to a
new function in remote.[ch], set_ref_status_for_push().

Make transport_push() invoke set_ref_status_for_push() before invoking
the push_refs() implementation. (As a side-effect, the push_refs()
implementation in transport-helper.c now knows of non-fast-forward
pushes.)

Removed logic for detecting up-to-date refs from the push_refs()
implementation in transport-helper.c, as transport_push() has already
done so for it.

Make cmd_send_pack() invoke set_ref_status_for_push() before invoking
send_pack(), as transport_push() can't do it for send_pack() here.

Mark the test on the return status of non-fast-forward push to fail.
Git now exits with success, as transport.c::transport_push() does not
check for refs with status REF_STATUS_REJECT_NONFASTFORWARD nor does it
indicate rejected pushes with its return value.

Mark the test for ref status to succeed. As mentioned earlier, refs
might be marked as non-fast-forwards, triggering the push status
printing mechanism in transport.c.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5541-http-push.sh: add test for unmatched, non-fast... Tay Ray Chuan Fri, 8 Jan 2010 02:12:41 +0000 (10:12 +0800)

t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs

Some refs can only be matched to a remote ref with an explicit refspec.
When such a ref is a non-fast-forward of its remote ref, test that
pushing them (with the explicit refspec specified) fails with a non-
fast-foward-type error (viz. printing of ref status and help message).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5541-http-push.sh: add tests for non-fast-forward... Tay Ray Chuan Fri, 8 Jan 2010 02:12:40 +0000 (10:12 +0800)

t5541-http-push.sh: add tests for non-fast-forward pushes

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>