gitweb.git
wt-status: fix 'fprintf' compilation warningJunio C Hamano Sun, 2 May 2010 05:05:14 +0000 (22:05 -0700)

wt-status: fix 'fprintf' compilation warning

color_fprintf() has the same function signature as fprintf() and newer
gcc warns when a non-constant string is fed as the format

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

Merge branch 'maint'Junio C Hamano Sun, 2 May 2010 03:23:10 +0000 (20:23 -0700)

Merge branch 'maint'

* maint:
index-pack: fix trivial typo in usage string
git-submodule.sh: properly initialize shell variables

gitweb: Create install target for gitweb in MakefileJakub Narebski Sat, 1 May 2010 20:36:15 +0000 (22:36 +0200)

gitweb: Create install target for gitweb in Makefile

Installing gitweb is now as easy as

# make gitwebdir=/var/www/cgi-bin gitweb-install ;# as root

The gitweb/INSTALL file was updated accordingly, to make use of this
new target.

Fix shell quoting, i.e. setting bindir_SQ etc., in gitweb/Makefile.
Those variables were not used previously.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Improve installation instructions in gitweb... Jakub Narebski Tue, 27 Apr 2010 20:45:19 +0000 (22:45 +0200)

gitweb: Improve installation instructions in gitweb/INSTALL

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Silence 'Variable VAR may be unavailable' warningsJakub Narebski Fri, 30 Apr 2010 16:30:31 +0000 (18:30 +0200)

gitweb: Silence 'Variable VAR may be unavailable' warnings

When $projects_list points to a directory, and git_get_projects_list
scans this directory for repositories, there can be generated the
following warnings (for persistent services like mod_perl or plackup):

Variable "$project_maxdepth" may be unavailable at gitweb.cgi line 2443.
Variable "$projectroot" may be unavailable at gitweb.cgi line 2451.

Those are false positives; silence those warnings by explicitely
declaring $project_maxdepth and $projectroot with 'our', as global
variables, in anonymous subrotine passed to File::Find::find.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck: check ident lines in commit objectsJonathan Nieder Sat, 24 Apr 2010 16:06:08 +0000 (11:06 -0500)

fsck: check ident lines in commit objects

Check that email addresses do not contain <, >, or newline so they can
be quickly scanned without trouble. The copy() function in ident.c
already ensures that ordinary git commands will not write email
addresses without this property.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Move generating page title to separate subroutineJakub Narebski Sat, 24 Apr 2010 14:01:10 +0000 (16:01 +0200)

gitweb: Move generating page title to separate subroutine

get_page_title subroutine is currently used only in git_header_html.
Nevertheless refactoring title generation allowed to reduce indent
level.

It would be used in more than one callsite in the patch adding caching
activity indicator to gitweb.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Add custom error handler using die_errorJakub Narebski Sat, 24 Apr 2010 14:00:04 +0000 (16:00 +0200)

gitweb: Add custom error handler using die_error

Change the default message for errors (for fatalsToBrowser) to use
die_error() subroutine. This way errors (and explicitely calling 'die
MESSAGE') would generate 'Internal Server Error' error message.

Note that call to set_message is intentionally not put in BEGIN block;
we set error handler to use die_error() only after we are sure that we
can use it, after all needed variables are set.

Due to the fact that error handler set via set_message() subroutine
from CGI::Carp (in the fatalsToBrowser case) is called after HTTP
headers were already printed (with exception of MOD_PERL), gitweb
cannot return 'Status: 500 Internal Server Error'.

Thanks to the fact that die_error() no longer uses 'exit', errors
would be logged by CGI::Carp, independent on whether default error
handler is used, or handle_errors_html which uses die_error is used.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Use nonlocal jump instead of 'exit' in die_errorJakub Narebski Sat, 24 Apr 2010 13:56:13 +0000 (15:56 +0200)

gitweb: Use nonlocal jump instead of 'exit' in die_error

Use 'goto DONE' in place of 'exit' to end request processing in
die_error() subroutine. While at it, do not end gitweb with 'exit'.

This would make it easier in the future to add support or improve
support for persistent environments such as FastCGI and mod_perl.
It would also make it easier to make use of die_error() as an error
handler (for fatalsToBrowser).

Perl 5 allows non-local jumps; the restriction is that you cannot jump
into a scope.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: href(..., -path_info => 0|1)Jakub Narebski Sat, 24 Apr 2010 13:53:19 +0000 (15:53 +0200)

gitweb: href(..., -path_info => 0|1)

If named boolean option -path_info is passed to href() subroutine, it
would use its value to decide whether to generate path_info URL form.
If this option is not passed, href() queries 'pathinfo' feature to
check whether to generate path_info URL (if generating path_info link
is possible at all).

href(-replay=>1, -path_info=>0) is meant to be used to generate a key
for caching gitweb output; alternate solution would be to use freeze()
from Storable (core module) on %input_params hash (or its reference),
e.g.:
$key = freeze \%input_params;
or other serialization of %input_params.

While at it document extra options/flags to href().

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Export more test-related variables when running externa... Jakub Narebski Sat, 24 Apr 2010 13:50:09 +0000 (15:50 +0200)

Export more test-related variables when running external tests

Add exporting TEST_DIRECTORY and TRASH_DIRECTORY to test_external, for
external tests to be able to find test script (and git sources), and
to find trash directory (usually with test repository in it).

Add also exporting GIT_TEST_LONG, so that external test can skip
time-intensive tests unless test is invoked with `--long' option.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

index-pack: fix trivial typo in usage stringMichael J Gruber Thu, 29 Apr 2010 15:42:47 +0000 (17:42 +0200)

index-pack: fix trivial typo in usage string

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

git-submodule.sh: properly initialize shell variablesGerrit Pape Mon, 26 Apr 2010 09:50:39 +0000 (11:50 +0200)

git-submodule.sh: properly initialize shell variables

git-submodule inherits variables from the environment it is started in,
expects the internal variables init= and recursive= to have an empty
value, but doesn't initialize them appropriately. Thanks to the
selftests, this can be reproduced through

init=1 make test
recursive=1 make test

With this commit the variables are initialized, and the selftests
succeed even if these variables have some values in the environment.

The bug was discovered through the Debian autobuilders
http://bugs.debian.org/569594

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdiff/xmerge.c: use memset() instead of explicit for... Alexey Mahotkin Wed, 28 Apr 2010 11:29:06 +0000 (15:29 +0400)

xdiff/xmerge.c: use memset() instead of explicit for-loop

memset() is heavily optimized, and resulting assembler code
is about 150 lines less for that file.

Signed-off-by: Alexey Mahotkin <squadette@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

request-pull: protect against OPTIONS_KEEPDASHDASH... Jonathan Nieder Sat, 24 Apr 2010 12:15:37 +0000 (07:15 -0500)

request-pull: protect against OPTIONS_KEEPDASHDASH from environment

Like most git commands, request-pull supports a -- delimiter to allow
callers to pass arguments that would otherwise be treated as an option
afterwards. The internal OPTIONS_KEEPDASHDASH variable is passed
empty to git-sh-setup to indicate that request-pull itself does not
care about the position of the -- delimiter. But if the user has
that variable in her environment, request-pull will see the “--” and
fail.

Empty it explicitly to guard against this. While at it, make the
corresponding fix to git-resurrect, too (all other scripts in git.git
already protect themselves).

Acked-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests for request-pullJonathan Nieder Sat, 24 Apr 2010 12:11:51 +0000 (07:11 -0500)

tests for request-pull

Test that request-pull handles failure to push cleanly, writes
pull requests that produce the correct effect when followed, and
uses a predictable format.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.7.1 v1.7.1Junio C Hamano Sat, 24 Apr 2010 01:27:17 +0000 (18:27 -0700)

Git 1.7.1

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

Merge branch 'maint'Junio C Hamano Sat, 24 Apr 2010 01:24:32 +0000 (18:24 -0700)

Merge branch 'maint'

* maint:
Documentation improvements for the description of short format.

Documentation improvements for the description of short... Eric Raymond Fri, 23 Apr 2010 17:40:15 +0000 (13:40 -0400)

Documentation improvements for the description of short format.

Incorporates the detailed explanation from Jeff King in
<20100410040959.GA11977@coredump.intra.peff.net> and fixes
the bug noted by Junio C Hamano in
<7vmxxc1i8g.fsf@alter.siamese.dyndns.org>.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.7.0.6Junio C Hamano Fri, 23 Apr 2010 06:05:49 +0000 (23:05 -0700)

Sync with 1.7.0.6

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

Git 1.7.0.6 v1.7.0.6Junio C Hamano Fri, 23 Apr 2010 05:46:24 +0000 (22:46 -0700)

Git 1.7.0.6

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

Merge branch 'mg/use-default-abbrev-length-in-rev-list... Junio C Hamano Fri, 23 Apr 2010 05:39:26 +0000 (22:39 -0700)

Merge branch 'mg/use-default-abbrev-length-in-rev-list' into maint

* mg/use-default-abbrev-length-in-rev-list:
rev-list: use default abbrev length when abbrev-commit is in effect

Merge branch 'wp/doc-filter-direction' into maintJunio C Hamano Fri, 23 Apr 2010 05:29:50 +0000 (22:29 -0700)

Merge branch 'wp/doc-filter-direction' into maint

* wp/doc-filter-direction:
documentation: clarify direction of core.autocrlf

Merge branch 'jk/maint-diffstat-overflow' into maintJunio C Hamano Fri, 23 Apr 2010 05:29:13 +0000 (22:29 -0700)

Merge branch 'jk/maint-diffstat-overflow' into maint

* jk/maint-diffstat-overflow:
diff: use large integers for diffstat calculations

Merge branch 'da/maint-python-startup' into maintJunio C Hamano Fri, 23 Apr 2010 05:29:07 +0000 (22:29 -0700)

Merge branch 'da/maint-python-startup' into maint

* da/maint-python-startup:
Makefile: Remove usage of deprecated Python "has_key" method

Merge branch 'maint'Junio C Hamano Thu, 22 Apr 2010 06:54:04 +0000 (23:54 -0700)

Merge branch 'maint'

* maint:
Documentation/Makefile: fix interrupted builds of user-manual.xml

Documentation/Makefile: fix interrupted builds of user... Jonathan Nieder Thu, 22 Apr 2010 01:18:21 +0000 (20:18 -0500)

Documentation/Makefile: fix interrupted builds of user-manual.xml

Unlike gcc, asciidoc does not atomically write its output file or
delete it when interrupted. If it is interrupted in the middle of
writing an XML file, the result will be truncated input for xsltproc.

XSLTPROC user-manual.html
user-manual.xml:998: parser error : Premature end of data in t

Take care of this case by writing to a temporary and renaming it when
finished.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash tests: stash can lose data in a file removed... Charles Bailey Sun, 18 Apr 2010 18:27:49 +0000 (19:27 +0100)

stash tests: stash can lose data in a file removed from the index

If a file is removed from the index and then modified in the working
tree then stash will discard the working tree file with no way to
recover the changes.

This can might be done in one of a number of ways.

git rm file
vi file # edit a new version
git stash

or with git mv

git mv file newfile
vi file # make a new file with the old name
git stash

Signed-off-by: Charles Bailey <charles@hashpling.org>

Merge branch 'maint'Junio C Hamano Tue, 20 Apr 2010 05:41:30 +0000 (22:41 -0700)

Merge branch 'maint'

* maint:
t7012: Mark missing tests as TODO
reflog: remove 'show' from 'expire's usage string
MSVC: Fix build by adding missing termios.h dummy

t5516-fetch-push.sh: style cleanupJay Soffian Mon, 19 Apr 2010 22:08:31 +0000 (18:08 -0400)

t5516-fetch-push.sh: style cleanup

Cleanup t5516-fetch-push.sh to use prevailing test script style

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

receive-pack: detect aliased updates which can occur... Jay Soffian Mon, 19 Apr 2010 22:19:18 +0000 (18:19 -0400)

receive-pack: detect aliased updates which can occur with symrefs

When pushing to a remote repo the sending side filters out aliased
updates (e.g., foo:baz bar:baz). However, it is not possible for the
sender to know if two refs are aliased on the receiving side via
symrefs. Here is one such scenario:

$ git init origin
$ (cd origin && touch file && git add file && git commit -a -m intial)
$ git clone --bare origin origin.git
$ rm -rf origin

$ git clone origin.git client

$ git clone --mirror client backup.git &&
$ (cd backup.git && git remote set-head origin --auto)

$ (cd client &&
git remote add --mirror backup ../backup.git &&
echo change1 > file && git commit -a -m change1 &&
git push origin &&
git push backup
)

The push to backup fails with:

Counting objects: 5, done.
Writing objects: 100% (3/3), 244 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
error: Ref refs/remotes/origin/master is at ef3... but expected 262...
remote: error: failed to lock refs/remotes/origin/master
To ../backup.git
262cd57..ef307ff master -> master
262cd57..ef307ff origin/HEAD -> origin/HEAD
! [remote rejected] origin/master -> origin/master (failed to lock)
error: failed to push some refs to '../backup.git'

The reason is that refs/remotes/origin/HEAD is a symref to
refs/remotes/origin/master, but it is not possible for the sending side
to unambiguously know this.

This commit fixes the issue by having receive-pack ignore any update to
a symref whose target is being identically updated. If a symref and its
target are being updated inconsistently, then the update for both fails
with an error message ("refusing inconsistent update...") to help
diagnose the situation.

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

receive-pack: switch global variable 'commands' to... Jay Soffian Mon, 19 Apr 2010 22:08:30 +0000 (18:08 -0400)

receive-pack: switch global variable 'commands' to a parameter

Receive-pack is inconsistent in its usage of the 'commands'
variable; though it is setup as a global and accessed that way by
execute_commands(), report(), and run_receive_hook(), it is also
passed as a parameter to delete_only() and run_update_post_hook().

For consistency, make it local to cmd_receive_pack and pass it as a
parameter. As long as we're cleaning up, also make our use of the
names 'commands' and 'cmd' consistent.

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

fix "bundle --stdin" segfaultJonathan Nieder Mon, 19 Apr 2010 08:03:40 +0000 (03:03 -0500)

fix "bundle --stdin" segfault

When passed an empty list, objects_array_remove_duplicates() corrupts it
by changing the number of entries from 0 to 1.

The problem lies in the condition of its main loop:

for (ref = 0; ref < array->nr - 1; ref++) {

The loop body manipulates the supplied object array. In the case of an
empty array, it should not be doing anything at all. But array->nr is an
unsigned quantity, so the code enters the loop, in particular increasing
array->nr. Fix this by comparing (ref + 1 < array->nr) instead.

This bug can be triggered by git bundle --stdin:

$ echo HEAD | git bundle create some.bundle --stdin’
Segmentation fault (core dumped)

The list of commits to bundle appears to be empty because of another bug:
by the time the revision-walking machinery gets to look at it, standard
input has already been consumed by rev-list, so this function gets an
empty list of revisions.

After this patch, git bundle --stdin still does not work; it just doesn’t
segfault any more.

Reported-by: Joey Hess <joey@kitenet.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5704 (bundle): add tests for bundle --stdinJonathan Nieder Mon, 19 Apr 2010 08:03:03 +0000 (03:03 -0500)

t5704 (bundle): add tests for bundle --stdin

As long as no rev-list arguments are supplied on the command line,
git bundle create --stdin currently segfaults. With added rev-list
arguments, it does not segfault, but the revisions from stdin are
ignored.

Thanks to Joey Hess <joey@kitenet.net> for the report.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7012: Mark missing tests as TODOMichael J Gruber Mon, 19 Apr 2010 08:14:32 +0000 (10:14 +0200)

t7012: Mark missing tests as TODO

Currently, there are 6 tests which are not even written but are
'test_expect_failure message false'.
Do not abuse test_expect_failure as a to do marker, but mark them as
'#TODO' instead.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http.c::new_http_pack_request: do away with the temp... Tay Ray Chuan Mon, 19 Apr 2010 14:46:43 +0000 (22:46 +0800)

http.c::new_http_pack_request: do away with the temp variable filename

Now that the temporary variable char *filename is only used in one
place, do away with it and just call sha1_pack_name() directly.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-fetch: Use temporary files for pack-*.idx until... Shawn O. Pearce Mon, 19 Apr 2010 14:23:10 +0000 (07:23 -0700)

http-fetch: Use temporary files for pack-*.idx until verified

Verify that a downloaded pack-*.idx file is consistent and valid
as an index file before we rename it into its final destination.
This prevents a corrupt index file from later being treated as a
usable file, confusing readers.

Check that we do not have the pack index file before invoking
fetch_pack_index(); that way, we can do without the has_pack_index()
check in fetch_pack_index().

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

http-fetch: Use index-pack rather than verify-pack... Shawn O. Pearce Mon, 19 Apr 2010 14:23:09 +0000 (07:23 -0700)

http-fetch: Use index-pack rather than verify-pack to check packs

To ensure we don't leave a corrupt pack file positioned as though
it were a valid pack file, run index-pack on the temporary pack
before we rename it to its final name. If index-pack crashes out
when it discovers file corruption (e.g. GitHub's error HTML at the
end of the file), simply delete the temporary files to cleanup.

By waiting until the pack has been validated before we move it
to its final name, we eliminate a race condition where another
concurrent reader might try to access the pack at the same time
that we are still trying to verify its not corrupt.

Switching from verify-pack to index-pack is a change in behavior,
but it should turn out better for users. The index-pack algorithm
tries to minimize disk seeks, as well as the number of times any
given object is inflated, by organizing its work along delta chains.
The verify-pack logic does not attempt to do this, thrashing the
delta base cache and the filesystem cache.

By recreating the index file locally, we also can automatically
upgrade from a v1 pack table of contents to v2. This makes the
CRC32 data available for use during later repacks, even if the
server didn't have them on hand.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Allow parse_pack_index on temporary filesShawn O. Pearce Mon, 19 Apr 2010 14:23:08 +0000 (07:23 -0700)

Allow parse_pack_index on temporary files

The easiest way to verify a pack index is to open it through the
standard parse_pack_index function, permitting the header check
to happen when the file is mapped. However, the dumb HTTP client
needs to verify a pack index before its moved into its proper file
name within the objects/pack directory, to prevent a corrupt index
from being made available. So permit the caller to specify the
exact path of the index file.

For now we're still using the final destination name within the
sole call site in http.c, but eventually we will start to parse
the temporary path instead.

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

Extract verify_pack_index for reuse from verify_packShawn O. Pearce Mon, 19 Apr 2010 14:23:07 +0000 (07:23 -0700)

Extract verify_pack_index for reuse from verify_pack

The dumb HTTP transport should verify an index is completely valid
before trying to use it. That requires checking the header/footer
but also checking the complete content SHA-1. All of this logic is
already in the front half of verify_pack, so pull it out into a new
function that can be reused.

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

Introduce close_pack_index to permit replacementShawn O. Pearce Mon, 19 Apr 2010 14:23:06 +0000 (07:23 -0700)

Introduce close_pack_index to permit replacement

By closing the pack index, a caller can later overwrite the index
with an updated index file, possibly after converting from v1 to
the v2 format. Because p->index_data is NULL after close, on the
next access the index will be opened again and the other members
will be updated with new data.

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

http.c: Remove unnecessary strdup of sha1_to_hex resultShawn O. Pearce Mon, 19 Apr 2010 14:23:05 +0000 (07:23 -0700)

http.c: Remove unnecessary strdup of sha1_to_hex result

Most of the time the dumb HTTP transport is run without the verbose
flag set, so we only need the result of sha1_to_hex(sha1) once, to
construct the pack URL. Don't bother with an unnecessary malloc,
copy, free chain of this buffer.

If verbose is set, we'll format the SHA-1 twice now. But this
tiny extra CPU time spent is nothing compared to the slowdown that
is usually imposed by the verbose messages being sent to the tty,
and is entirely trivial compared to the latency involved with the
remote HTTP server sending something as big as a pack file.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reflog: remove 'show' from 'expire's usage stringSZEDER Gábor Mon, 19 Apr 2010 09:52:30 +0000 (11:52 +0200)

reflog: remove 'show' from 'expire's usage string

Most of 'expire's options are not recognized by the 'show' subcommand,
hence it errors out.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote add: add a --[no-]tags optionSamuel Tardieu Mon, 19 Apr 2010 23:31:31 +0000 (01:31 +0200)

remote add: add a --[no-]tags option

Add '--[no-]tags' options to 'git remote add' which add the
'remote.REMOTE.tagopt = --[no-]tags' to the configuration file.
This mimics the "--tags" and "--no-tags" options of "git fetch".

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Honor "tagopt = --tags" configuration optionSamuel Tardieu Mon, 19 Apr 2010 23:31:25 +0000 (01:31 +0200)

Honor "tagopt = --tags" configuration option

If the "tagopt = --tags" option of a remote is set, all tags
will be fetched as in "git fetch --tags".

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

patch-id: Add support for mbox formatPaolo Bonzini Mon, 19 Apr 2010 08:46:14 +0000 (10:46 +0200)

patch-id: Add support for mbox format

I have an alias that takes two arguments and compares their patch IDs.
I would like to use to make sure I've tested exactly what I submit
(patch by patch), like

git patch-cmp origin/master.. file-being-sent

However, I cannot do that because git patch-id is fooled by the "-- "
trailer that git format-patch puts, or likely by the MIME boundary.

This patch adds hunk parsing logic to git patch-id in order to detect an
out of place "-" line and split the patch when it comes. In addition,
commit ids in the "From " lines are considered and printed in the output.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

patch-id: extract parsing one diff out of generate_id_listPaolo Bonzini Mon, 19 Apr 2010 08:46:13 +0000 (10:46 +0200)

patch-id: extract parsing one diff out of generate_id_list

This simplifies a bit the next patch, since it will have more than one
condition to exit the loop.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint-1.6.6' into maintJunio C Hamano Mon, 19 Apr 2010 08:28:27 +0000 (01:28 -0700)

Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
MSVC: Fix build by adding missing termios.h dummy

MSVC: Fix build by adding missing termios.h dummyJohannes Sixt Mon, 19 Apr 2010 07:37:20 +0000 (09:37 +0200)

MSVC: Fix build by adding missing termios.h dummy

A use of this header file was introduced in eb80042 (Add missing #include
to support TIOCGWINSZ on Solaris, 2010-01-11).

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

Git 1.7.1-rc2 v1.7.1-rc2Junio C Hamano Mon, 19 Apr 2010 05:19:04 +0000 (22:19 -0700)

Git 1.7.1-rc2

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

Merge branch 'rr/remote-helper-doc'Junio C Hamano Mon, 19 Apr 2010 04:32:25 +0000 (21:32 -0700)

Merge branch 'rr/remote-helper-doc'

* rr/remote-helper-doc:
Documentation/remote-helpers: Fix typos and improve language
Fixup: Second argument may be any arbitrary string
Documentation/remote-helpers: Add invocation section
Documentation/urls: Rewrite to accomodate <transport>::<address>
Documentation/remote-helpers: Rewrite description

Merge branch 'wp/doc-filter-direction'Junio C Hamano Mon, 19 Apr 2010 04:32:21 +0000 (21:32 -0700)

Merge branch 'wp/doc-filter-direction'

* wp/doc-filter-direction:
documentation: clarify direction of core.autocrlf

Merge branch 'jk/maint-diffstat-overflow'Junio C Hamano Mon, 19 Apr 2010 04:31:50 +0000 (21:31 -0700)

Merge branch 'jk/maint-diffstat-overflow'

* jk/maint-diffstat-overflow:
diff: use large integers for diffstat calculations

Merge branch 'jg/auto-initialize-notes-with-percent... Junio C Hamano Mon, 19 Apr 2010 04:31:29 +0000 (21:31 -0700)

Merge branch 'jg/auto-initialize-notes-with-percent-n-in-format'

* jg/auto-initialize-notes-with-percent-n-in-format:
t3301: add tests to use --format="%N"
pretty: Initialize notes if %N is used

Merge branch 'maint'Junio C Hamano Mon, 19 Apr 2010 04:31:20 +0000 (21:31 -0700)

Merge branch 'maint'

* maint:
Documentation: Describe other situations where -z affects git diff

Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano Mon, 19 Apr 2010 01:36:41 +0000 (18:36 -0700)

Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
gitk: Display dirty submodules correctly
gitk: Fix display of copyright symbol
gitk: Add emacs editor variable block
gitk: Avoid calling tk_setPalette on Windows
gitk: Don't clobber "Remember this view" setting
gitk: Add comments to explain encode_view_opts and decode_view_opts
gitk: Use consistent font for all text input fields
gitk: Set the font for all listbox widgets
gitk: Set the font for all spinbox widgets
gitk: Remove forced use of sans-serif font
gitk: Add Ctrl-W shortcut for closing the active window

SubmittingPatches: Add new section about what to base... Ramkumar Ramachandra Sun, 18 Apr 2010 19:54:20 +0000 (01:24 +0530)

SubmittingPatches: Add new section about what to base work on

Add a section 0 explaining which commit to base patches on.

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

stash: Don't overwrite files that have gone from the... Charles Bailey Sun, 18 Apr 2010 18:28:05 +0000 (19:28 +0100)

stash: Don't overwrite files that have gone from the index

The use of git add -u in create_stash isn't always complete. In
particular, if a file has been removed from the index but changed in the
work tree it will not be added to the stash's saved work tree tree
object. When stash then resets the work tree to match HEAD, any changes
will be lost.

To be complete, any work tree file which differs from HEAD needs to be
saved, regardless of whether it still appears in the index or not.

This is achieved with a combination of a diff against HEAD and a call to
update-index with an explicit list of paths that have changed.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/remote-helpers: Fix typos and improve... Ramkumar Ramachandra Sun, 18 Apr 2010 00:57:37 +0000 (06:27 +0530)

Documentation/remote-helpers: Fix typos and improve language

Fix some typos and errors in grammar and tense.

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

Fixup: Second argument may be any arbitrary stringRamkumar Ramachandra Sun, 18 Apr 2010 00:56:37 +0000 (06:26 +0530)

Fixup: Second argument may be any arbitrary string

This is intended to be a fixup for commit ad466d1 in pu. As Jonathan
Neider pointed out, the second argument may be any arbitrary string,
and need not conform to any URL-like shape.

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

Documentation/remote-helpers: Add invocation sectionRamkumar Ramachandra Wed, 7 Apr 2010 05:44:41 +0000 (11:14 +0530)

Documentation/remote-helpers: Add invocation section

Add an 'Invocation' section to specify what the command line arguments
mean. Also include a link to git-remote in the 'See Also' section.

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

Documentation/urls: Rewrite to accomodate <transport... Ramkumar Ramachandra Tue, 6 Apr 2010 08:38:19 +0000 (14:08 +0530)

Documentation/urls: Rewrite to accomodate <transport>::<address>

Rewrite the first part of the document to explicitly show differences
between the URLs that can be used with different transport
protocols. Mention <transport>::<address> format to explicitly invoke
a remote helper.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/remote-helpers: Rewrite descriptionRamkumar Ramachandra Sun, 28 Mar 2010 18:03:50 +0000 (23:33 +0530)

Documentation/remote-helpers: Rewrite description

Rewrite the description section to describe what exactly remote
helpers are and the need for them. Also mention the curl family of
remote helpers as an example.

[jc: with readability fixes from Jonathan squashed in]

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: Describe other situations where -z affec... Charles Bailey Sun, 18 Apr 2010 18:28:17 +0000 (19:28 +0100)

Documentation: Describe other situations where -z affects git diff

-z also alters the behaviour of --name-only and --name-status.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase-interactive: silence warning when no commits... Jeff King Sun, 18 Apr 2010 12:01:45 +0000 (08:01 -0400)

rebase-interactive: silence warning when no commits rewritten

If you do a "rebase -i" and don't change any commits,
nothing is rewritten, and we have no REWRITTEN_LIST. The
shell prints out an ugly message:

$ GIT_EDITOR=true git rebase -i HEAD^
/path/to/git-rebase--interactive: 1: cannot open
/path/to/repo/.git/rebase-merge/rewritten-list: No such file
Successfully rebased and updated refs/heads/master.

We can fix it by not running "notes copy" at all if nothing
was rewritten.

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

t3301: add tests to use --format="%N"Junio C Hamano Sun, 18 Apr 2010 18:19:39 +0000 (11:19 -0700)

t3301: add tests to use --format="%N"

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

reflog --expire-unreachable: special case entries in... Junio C Hamano Fri, 9 Apr 2010 20:20:02 +0000 (13:20 -0700)

reflog --expire-unreachable: special case entries in "HEAD" reflog

"git reflog expire" (and "git gc") examines the reflog entries and
discards old/stale ones using two criteria. The entries that are older
than "reflogexpire" (defaults to 90 days) are unconditionally removed, and
the entries that are older than "reflogexpireunreachable" (defaults to 30
days) are removed if the entry point at commits that are not reachable
from the value of the ref.

This is reasonable for local branches, remote tracking branches and tags.
You (or other people) may have failed experiments that have been made and
then later discarded by resetting the tip of the branch back, and setting
the value of "reflogexpireunreachable" shorter than that of "reflogexpire"
will prune the entries that describe these failed experiments earlier than
the entries that describe the steps that led to the current history.

It however doesn't make much sense for "HEAD" reflog. When you switch
between branches, it is normal that the tip of the branch you were on is
not an ancestor of the branch you have switched to. The moral equivalent
of expiring failed experiments in per-branch reflog for "HEAD" reflog is
to expire entries that talk about commits that cannot be reached from any
ref.

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

more war on "sleep" in testsJunio C Hamano Wed, 14 Apr 2010 22:09:57 +0000 (15:09 -0700)

more war on "sleep" in tests

Two more tests that sleep only to waste tick can be converted to use
test_tick and take expiry parameters relative to $test_tick. The basic
idea is to replace "sleep 1" with "test_tick" to cause the "time" to pass.

These tests are interested in expiring things with "now" as the timestamp,
soo use a timestamp relative to $test_tick to give them more stability and
reproducibility.

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

http.c: Don't store destination name in request structuresShawn O. Pearce Sat, 17 Apr 2010 20:07:38 +0000 (13:07 -0700)

http.c: Don't store destination name in request structures

The destination name within the object store is easily computed
on demand, reusing a static buffer held by sha1_file.c. We don't
need to copy the entire path into the request structure for safe
keeping, when it can be easily reformatted after the download has
been completed.

This reduces the size of the per-request structure, and removes
yet another PATH_MAX based limit.

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

http.c: Drop useless != NULL test in finish_http_pack_r... Shawn O. Pearce Sat, 17 Apr 2010 20:07:37 +0000 (13:07 -0700)

http.c: Drop useless != NULL test in finish_http_pack_request

The test preq->packfile != NULL is always true. If packfile was
actually NULL when entering this function the ftell() above would
crash out with a SIGSEGV, resulting in never reaching this point.

Simplify the code by just removing the conditional.

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

http.c: Tiny refactoring of finish_http_pack_requestShawn O. Pearce Sat, 17 Apr 2010 20:07:36 +0000 (13:07 -0700)

http.c: Tiny refactoring of finish_http_pack_request

Always remove the struct packed_git from the active list, even
if the rename of the temporary file fails.

While we are here, simplify the code a bit by using a common
local variable name ("p") to hold the relevant packed_git.

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

t5550-http-fetch: Use subshell for repository operationsShawn O. Pearce Sat, 17 Apr 2010 20:07:35 +0000 (13:07 -0700)

t5550-http-fetch: Use subshell for repository operations

Change into the server repository's directory using a subshell,
so we can return back to the top of the trash directory before
doing anything more in the test script.

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

http.c: Remove bad free of static blockShawn O. Pearce Sat, 17 Apr 2010 20:07:34 +0000 (13:07 -0700)

http.c: Remove bad free of static block

The filename variable here is pointing to a block of memory that
was allocated by sha1_file.c and is also held in a static variable
scoped within the sha1_pack_name() function. Doing a free() here is
returning that memory to the allocator while we might still try to
reuse it on a subsequent sha1_pack_name() invocation. That's not
acceptable, so don't free it.

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

Merge branch 'maint'Junio C Hamano Sat, 17 Apr 2010 19:40:45 +0000 (12:40 -0700)

Merge branch 'maint'

* maint:
t1010-mktree: Adjust expected result to code and documentation
combined diff: correctly handle truncated file
Document new "already-merged" rule for branch -d

t6006: do not write to /tmpMatthew Ogilvie Sat, 17 Apr 2010 02:29:18 +0000 (20:29 -0600)

t6006: do not write to /tmp

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-instaweb: pass through invoking user's path to... Chris Webb Thu, 15 Apr 2010 13:29:45 +0000 (14:29 +0100)

git-instaweb: pass through invoking user's path to gitweb CGI scripts

When used with lighttpd or mongoose, git-instaweb previously passed a
hard-coded, default value of PATH to the gitweb CGI script. Use the invoking
user's value for PATH for this instead. (This is already implicitly the
behaviour for other web servers supported by git-instaweb.)

Signed-off-by: Chris Webb <chris@arachsys.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

gitweb: simplify gitweb.min.* generation and clean... Junio C Hamano Thu, 15 Apr 2010 12:57:18 +0000 (08:57 -0400)

gitweb: simplify gitweb.min.* generation and clean-up rules

GITWEB_CSS and GITWEB_JS are meant to be "what URI should the installed
cgi script use to refer to the stylesheet and JavaScript", never "this
is the name of the file we are building". Don't use them to decide what
file to build minified versions in.

While we are at it, lose FILES that is used only for "clean" target in a
misguided way. "make clean" should try to remove all the potential
build artifacts regardless of a minor configuration change. Instead of
trying to remove only the build product "make clean" would have created
if it were run without "clean", explicitly list the three potential build
products for removal.

Tested-by: Mark Rada <marada@uwaterloo.co>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tag -v: use RUN_GIT_CMD to run verify-tagJonathan Nieder Thu, 15 Apr 2010 09:36:25 +0000 (04:36 -0500)

tag -v: use RUN_GIT_CMD to run verify-tag

This is the preferred way to run a git command.

The only obvious observable effects I can think of are that the exec
is properly reported in GIT_TRACE output and that verifying signed
tags will still work if the git-verify-tag hard link in gitexecdir
goes missing.

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

documentation: clarify direction of core.autocrlfWill Palmer Sat, 17 Apr 2010 16:55:26 +0000 (17:55 +0100)

documentation: clarify direction of core.autocrlf

The description for core.autocrlf refers to reads from / writes to
"the filesystem", the only use of this rather ambiguous term, which
technically could be referring to the git object database. (All other
mentions are part of phrases such as "..filesystems (like NFS)..").

Other sections, including the section on core.safecrlf, use the term
"work tree" for the same purpose as the term "the filesystem" is used in
the core.autocrlf section, so that seems like a good alternative, which
makes it clearer what direction the addition/removal of CR characters
occurs in.

Signed-off-by: Will Palmer <wmpalmer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: use large integers for diffstat calculationsJeff King Sat, 17 Apr 2010 17:41:08 +0000 (13:41 -0400)

diff: use large integers for diffstat calculations

The diffstat "added" and "changed" fields generally store
line counts; however, for binary files, they store file
sizes. Since we store and print these values as ints, a
diffstat on a file larger than 2G can show a negative size.
Instead, let's use uintmax_t, which should be at least 64
bits on modern platforms.

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

t1010-mktree: Adjust expected result to code and docume... Michael J Gruber Thu, 15 Apr 2010 09:34:07 +0000 (11:34 +0200)

t1010-mktree: Adjust expected result to code and documentation

The last two tests here were always supposed to fail in the sense
that, according to code and documentation, mktree should read non-recursive
ls-tree output, but not recursive one, and therefore explicitely refuses
to deal with slashes.

Adjust the test (must_fail) so that it succeeds when mktree dies on
slashes.

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

combined diff: correctly handle truncated fileThomas Rast Thu, 15 Apr 2010 12:59:37 +0000 (14:59 +0200)

combined diff: correctly handle truncated file

Consider an evil merge of two commits A and B, both of which have a
file 'foo', but the merge result does not have that file.

The combined-diff code learned in 4462731 (combine-diff: do not punt
on removed or added files., 2006-02-06) to concisely show only the
removal, since that is the evil part and the previous contents are
presumably uninteresting.

However, to diagnose an empty merge result, it overloaded the variable
that holds the file's length. This means that the check also triggers
for truncated files. Consequently, such files were not shown in the
diff at all despite the merge being clearly evil.

Fix this by adding a new variable that distinguishes whether the file
was deleted (which is the case 4462731 handled) or truncated. In the
truncated case, we show the full combined diff again, which is rather
spammy but at least does not hide the evilness.

Reported-by: David Martínez Martí <desarrollo@gestiweb.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Display dirty submodules correctlyJens Lehmann Fri, 9 Apr 2010 20:16:42 +0000 (22:16 +0200)

gitk: Display dirty submodules correctly

Since recently "git diff --submodule" prints out extra lines when the
submodule contains untracked or modified files. Show all those lines of
one submodule under the same header.

Also for newly added or removed submodules the submodule name contained
trailing garbage because the extraction of the name was not done right.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

autoconf: Check if <paths.h> exists and set HAVE_PATHS_HJakub Narebski Thu, 15 Apr 2010 12:27:49 +0000 (05:27 -0700)

autoconf: Check if <paths.h> exists and set HAVE_PATHS_H

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

exec_cmd.c: replace hard-coded path list with one from... Chris Webb Tue, 13 Apr 2010 09:07:13 +0000 (10:07 +0100)

exec_cmd.c: replace hard-coded path list with one from <paths.h>

The default executable path list used by exec_cmd.c is hard-coded to
be "/usr/local/bin:/usr/bin:/bin". Use an appropriate value for the
system from <paths.h> when available.

Add HAVE_PATHS_H make variables and enable it on Linux, FreeBSD,
NetBSD, OpenBSD and GNU where it is known to exist for now. Somebody
else may want to do an autoconf support later.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Document new "already-merged" rule for branch -dJonathan Nieder Thu, 15 Apr 2010 07:25:38 +0000 (02:25 -0500)

Document new "already-merged" rule for branch -d

v1.7.0-rc0~18^2 (branch -d: base the "already-merged" safety on the
branch it merges with, 2009-12-29) taught ‘git branch’ a new heuristic
for when it is safe to delete a branch without forcing the issue. It
is safe to delete a branch "topic" without second thought if:

- the branch "topic" is set up to pull from a (remote-tracking,
usually) branch and is fully merged in that "upstream" branch, or

- there is no branch.topic.merge configuration and branch "topic" is
fully merged in the current HEAD.

Update the man page to acknowledge the new rules.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add .depend directories to .gitignoreJonathan Nieder Thu, 15 Apr 2010 07:35:20 +0000 (02:35 -0500)

Add .depend directories to .gitignore

The makefile snippets that would land in these directories are already
being ignored. Ignore the directories instead so they don’t show up
in ‘git clean -n’ output.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t7006: guard cleanup with test_expect_successJonathan Nieder Thu, 15 Apr 2010 00:38:07 +0000 (19:38 -0500)

t7006: guard cleanup with test_expect_success

Most of these tests are removing files, environment variables, and
configuration that might interfere outside the test. Putting these
clean-up commands in the test (in the same spirit as v1.7.1-rc0~59,
2010-03-20) means that errors during setup will be caught quickly and
non-error text will be suppressed without -v.

While at it, apply some other minor fixes:

- do not rely on the shell to export variables defined with the same
command as a function call

- avoid whitespace immediately after the > redirection operator, for
consistency with the style of other tests

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Document gc.<pattern>.reflogexpire variablesJunio C Hamano Wed, 14 Apr 2010 20:12:34 +0000 (13:12 -0700)

Document gc.<pattern>.reflogexpire variables

3cb22b8 (Per-ref reflog expiry configuration, 2008-06-15) added support
for setting the expiry parameters differently for different reflog, but
it was never documented.

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

am -3: recover the diagnostic messages for corrupt... Junio C Hamano Fri, 9 Apr 2010 23:58:28 +0000 (16:58 -0700)

am -3: recover the diagnostic messages for corrupt patches

"git am -3" first tries to apply the patch without any extra trick, and
applies it to a synthesized tree for 3-way merge after the first attempt
fails. "git apply" exits with status 1 for a patch that is well-formed
but is not applicable (and it dies on other errors with non-zereo, non-1
status) and has an optimization to fall back to the 3-way merge only in
the case.

An earlier patch 3ddd170 (am: suppress apply errors when using 3-way,
2009-06-16) squelched diagnostic messages from the first attempt, not to
be shown to the end user. This worked reasonably well if the reason the
first application failed was because the patch was made against a wrong
version.

When the patch is corrupt (e.g. line-wrapped or leading whitespaces got
dropped), however, because the second patch application is not even
attempted, the error message from the first application is never shown
and is forever lost. This message is necessary to locate where the patch
is corrupt and fix it up.

We could fix this issue by reverting 3dd170, or keeping the error message
to somewhere and showing it, but because this is an error codepath, the
easiest is to disable the optimization. The second patch application is
attempted even when the input is corrupt, and it will notice, diagnose,
and stop with an error message.

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

diff: add --word-diff option that generalizes --color... Thomas Rast Wed, 14 Apr 2010 15:59:06 +0000 (17:59 +0200)

diff: add --word-diff option that generalizes --color-words

This teaches the --color-words engine a more general interface that
supports two new modes:

* --word-diff=plain, inspired by the 'wdiff' utility (most similar to
'wdiff -n <old> <new>'): uses delimiters [-removed-] and {+added+}

* --word-diff=porcelain, which generates an ad-hoc machine readable
format:
- each diff unit is prefixed by [-+ ] and terminated by newline as
in unified diff
- newlines in the input are output as a line consisting only of a
tilde '~'

Both of these formats still support color if it is enabled, using it
to highlight the differences. --color-words becomes a synonym for
--word-diff=color, which is the color-only format. Also adds some
compatibility/convenience options.

Thanks to Junio C Hamano and Miles Bader for good ideas.

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

Merge branch 'maint'Junio C Hamano Wed, 14 Apr 2010 01:21:29 +0000 (18:21 -0700)

Merge branch 'maint'

* maint:
Documentation/config.txt: default gc.aggressiveWindow is 250, not 10
Docs: Add -X option to git-merge's synopsis.

Conflicts:
Documentation/merge-options.txt

pretty: Initialize notes if %N is usedJohannes Gilger Tue, 13 Apr 2010 20:31:12 +0000 (22:31 +0200)

pretty: Initialize notes if %N is used

When using git log --pretty='%N' without an explicit --show-notes, git
would segfault. This patches fixes this behaviour by loading the needed
notes datastructures if --pretty is used and the format contains %N.
When --pretty='%N' is used together with --no-notes, %N won't be
expanded.

This is an extension to a proposed patch by Jeff King.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

describe: Break annotated tag ties by tagger dateShawn O. Pearce Mon, 12 Apr 2010 23:25:29 +0000 (16:25 -0700)

describe: Break annotated tag ties by tagger date

If more than one annotated tag points at the same commit, use the
tag whose tagger field has a more recent date stamp. This resolves
non-deterministic cases where the maintainer has done:

$ git tag -a -m "2.1-rc1" v2.1-rc1 deadbeef
$ git tag -a -m "2.1" v2.1 deadbeef

If the tag is an older-style annotated tag with no tagger date, we
assume a date stamp at the UNIX epoch. This will cause us to prefer
an annotated tag that has a valid date.

We could also try to consider the tag object chain, favoring a tag
that "includes" another one:

$ git tag -a -m "2.1-rc0" v2.1-rc1 deadbeef
$ git tag -a -m "2.1" v2.1 v2.1-rc1

However traversing the tag's object chain looking for inclusion
is much more complicated. Its already very likely that even in
these cases the v2.1 tag will have a more recent tagger date than
v2.1-rc1, so with this change describe should still resolve this
by selecting the more recent v2.1.

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

Documentation/config.txt: default gc.aggressiveWindow... Jay Soffian Tue, 13 Apr 2010 16:52:55 +0000 (12:52 -0400)

Documentation/config.txt: default gc.aggressiveWindow is 250, not 10

The default for gc.aggressiveWindow has been 250 since 1c192f3
(gc --aggressive: make it really aggressive, 2007-12-06).

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

t5800: testgit helper requires Python supportJonathan Nieder Mon, 12 Apr 2010 14:24:28 +0000 (09:24 -0500)

t5800: testgit helper requires Python support

git remote-testgit is written in Python. In a NO_PYTHON build, tests
using it would fail, so skip them.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tag.c: Parse tagger date (if present)Shawn O. Pearce Mon, 12 Apr 2010 23:25:28 +0000 (16:25 -0700)

tag.c: Parse tagger date (if present)

Just like with committer dates, we parse the tagger date into the
struct tag so its available for further downstream processing.
However since the tagger header was not introduced until Git 0.99.1
we must consider it optional. For tags missing this header we use
the default date of 0.

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

tag.c: Refactor parse_tag_buffer to be saner to programShawn O. Pearce Mon, 12 Apr 2010 23:25:27 +0000 (16:25 -0700)

tag.c: Refactor parse_tag_buffer to be saner to program

This code was horribly ugly to follow. The structure of the headers
in an annotated tag object must follow a prescribed order, and most
of these are required. Simplify the entire parsing logic by going
through the headers in the order they are supposed to appear in,
acting on each header as its identified in the buffer.

This change has the same behavior as the older version, its just
easier to read and maintain.

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

tag.h: Remove unused signature fieldShawn O. Pearce Mon, 12 Apr 2010 23:25:26 +0000 (16:25 -0700)

tag.h: Remove unused signature field

Its documented as unused. So lets just drop it from the structure
since we haven't ever used it.

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

tag.c: Correct indentationShawn O. Pearce Mon, 12 Apr 2010 23:25:25 +0000 (16:25 -0700)

tag.c: Correct indentation

These lines were incorrectly indented with spaces, violating our
coding style. Its annoying to read with 4 position tab stops, so
fix the indentation to be correct.

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