]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
14 years agoAdd a macro DIFF_QUEUE_CLEAR.
Bo Yang [Fri, 7 May 2010 04:52:27 +0000 (21:52 -0700)] 
Add a macro DIFF_QUEUE_CLEAR.

Refactor the diff_queue_struct code, this macro help
to reset the structure.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowt-status: take advice.statusHints seriously
Michael J Gruber [Thu, 22 Apr 2010 20:30:20 +0000 (22:30 +0200)] 
wt-status: take advice.statusHints seriously

Currently, status gives a lot of hints even when advice.statusHints is
false. Change this so that all hints depend on the config variable.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot7508: test advice.statusHints
Michael J Gruber [Thu, 22 Apr 2010 20:30:19 +0000 (22:30 +0200)] 
t7508: test advice.statusHints

edf563f (status: make "how to stage" messages optional, 2009-09-09)
introduced advice.statusHints without tests. Add a few tests to describe
and test the status quo.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotest-lib: some shells do not let $? propagate into an eval
Jonathan Nieder [Thu, 6 May 2010 08:41:10 +0000 (03:41 -0500)] 
test-lib: some shells do not let $? propagate into an eval

In 3bf7886 (test-lib: Let tests specify commands to be run at end of
test, 2010-05-02), the git test harness learned to run cleanup
commands unconditionally at the end of a test.  During each test,
the intended cleanup actions are collected in the test_cleanup variable
and evaluated.  That variable looks something like this:

eval_ret=$?; clean_something && (exit "$eval_ret")
eval_ret=$?; clean_something_else && (exit "$eval_ret")
eval_ret=$?; final_cleanup && (exit "$eval_ret")
eval_ret=$?

All cleanup actions are run unconditionally but if one of them fails
it is properly reported through $eval_ret.

On FreeBSD, unfortunately, $? is set at the beginning of an ‘eval’
to 0 instead of the exit status of the previous command.  This results
in tests using test_expect_code appearing to fail and all others
appearing to pass, unless their cleanup fails.  Avoid the problem by
setting eval_ret before the ‘eval’ begins.

Thanks to Jeff King for the explanation.

Cc: Jeff King <peff@peff.net>
Cc: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agopretty: Respect --abbrev option
Will Palmer [Tue, 4 May 2010 03:18:57 +0000 (22:18 -0500)] 
pretty: Respect --abbrev option

Prior to this, the output of git log -1 --format=%h was always 7
characters long, without regard to whether --abbrev had been passed.

Signed-off-by: Will Palmer <wmpalmer@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoshortlog: Document and test --format option
Jonathan Nieder [Tue, 4 May 2010 02:59:55 +0000 (21:59 -0500)] 
shortlog: Document and test --format option

Do not document the --pretty synonym, since it takes too long to
explain the name to people.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot4201 (shortlog): Test output format with multiple authors
Jonathan Nieder [Tue, 4 May 2010 02:58:04 +0000 (21:58 -0500)] 
t4201 (shortlog): Test output format with multiple authors

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot4201 (shortlog): guard setup with test_expect_success
Jonathan Nieder [Tue, 4 May 2010 02:57:36 +0000 (21:57 -0500)] 
t4201 (shortlog): guard setup with test_expect_success

Follow the current prevailing style.  This also has the benefit of
capturing any stray output and noticing if any of the setup commands
start failing.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/shortlog: scripted users should not rely on implicit HEAD
Jonathan Nieder [Tue, 4 May 2010 02:57:10 +0000 (21:57 -0500)] 
Documentation/shortlog: scripted users should not rely on implicit HEAD

When passed no revision arguments, ‘git shortlog’ reads a log from
stdin if and only if stdin is not a tty.  So scripts that need to
function identically when standard input is a terminal (as when run
interactively) and not (as when run through a cron job) should either
supply a log themselves or specify the desired revisions explicitly.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotest-lib: Let tests specify commands to be run at end of test
Jonathan Nieder [Sun, 2 May 2010 08:53:41 +0000 (03:53 -0500)] 
test-lib: Let tests specify commands to be run at end of test

Certain actions can imply that if the test fails early, recovery from
within other tests is too much to expect:

 - creating unwritable directories, like the EACCESS test in t0001-init
 - setting unusual configuration, like user.signingkey in t7004-tag
 - crashing and leaving the index lock held, like t3600-rm once did

Some test scripts work around this by running cleanup actions outside
the supervision of the test harness, with the unfortunate consequence
that those commands are not appropriately echoed and their output not
suppressed.  Others explicitly save exit status, clean up, and then
reset the exit status within the tests, which has excellent behavior
but makes the tests hard to read.  Still others ignore the problem.

Allow tests a fourth option: by calling this function, tests can
stack up commands they would like to be run to clean up.

Commands passed to test_when_finished during a test are
unconditionally run in the test environment immediately before the
test is completed, in last-in-first-out order.  If some cleanup
command fails, then the other cleanup commands are still run before
the failure is reported and the test script allowed to continue.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint-1.7.0' into maint
Junio C Hamano [Tue, 4 May 2010 22:20:47 +0000 (15:20 -0700)] 
Merge branch 'maint-1.7.0' into maint

* maint-1.7.0:
  remove ecb parameter from xdi_diff_outf()

14 years agoremove ecb parameter from xdi_diff_outf()
René Scharfe [Tue, 4 May 2010 20:41:34 +0000 (22:41 +0200)] 
remove ecb parameter from xdi_diff_outf()

xdi_diff_outf() overrides the structure members of its last parameter,
ignoring any value that callers pass in.  It's no surprise then that all
callers pass a pointer to an uninitialized structure.  They also don't
read it after the call, so the parameter is neither used for input nor
for output.   Turn it into a local variable of xdi_diff_outf().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-send-email: Add "Use gmail as the smtp server"
Ping Yin [Sat, 24 Apr 2010 07:34:02 +0000 (15:34 +0800)] 
Documentation/git-send-email: Add "Use gmail as the smtp server"

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Acked by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoclone: quell the progress report from init and report on clone
Junio C Hamano [Fri, 23 Apr 2010 12:37:22 +0000 (14:37 +0200)] 
clone: quell the progress report from init and report on clone

Currently, a local git clone reports only initializing an empty
git dir, which is potentially confusing.

Instead, report that cloning is in progress and when it is done
(unless -q) is given, and suppress the init report.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotest-lib.sh: Add explicit license detail, with change from GPLv2 to GPLv2+.
Michal Sojka [Fri, 16 Apr 2010 13:53:59 +0000 (15:53 +0200)] 
test-lib.sh: Add explicit license detail, with change from GPLv2 to GPLv2+.

Dear Junio,

this is a resend of relicensing patch for test suite library, which
was initially sent by Carl Worth. Since the time you sent me acks for
this patch collected by you, I collected 8 additional acks as is
documented at
https://git.wiki.kernel.org/index.php/Test-lib_reclicensing. There are
still three contributors missing: Bert Wesarg, Stephan Beyer and Bryan
Donlan. The contributions of first two are clearly not copyrightable.
I'm not sure about the copyrightability of Bryan Donlan's
contributions (git log -p --author='Bryan Donlan' t/test-lib.sh).

Carl told me that in your ack collection process you missed only three
acks. So I wonder whether you already did some analysis of which
contributions are copyrightable. If so, are the missing acks in the
list bellow?

Thanks
Michal

8<--------8<--------8<--------
This file has had no explicit license information noted in it, but
has clearly been created and modified according to the terms of GPLv2
as with the rest of the git code base.

The purpose of relicensing is to allow other GPLv3+ projects (in
particular, the notmuch project: http://notmuchmail.org) to use this
same test-suite structure and to contribute changes back as well.

Signed-off-by: Carl Worth <cworth@cworth.org>
Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Acked-by: Brandon Casey <drafnel@gmail.com>
Acked-by: Clemens Buchacher <drizzd@aon.at>
Acked-by: David Reiss <dreiss@facebook.com>
Acked-by: Emil Sit <sit@emilsit.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Acked-by: Fredrik Kuivinen <frekui@gmail.com>
Acked-by: Gerrit Pape <pape@smarden.org>
Acked-by: Christian Couder <chriscool@tuxfamily.org>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Acked-by: Johan Herland <johan@herland.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Lea Wiemann <lewiemann@gmail.com>
Acked-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: Martin Waitz <tali@admingilde.org>
Acked-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Acked-by: Matthias Lederhofer <matled@gmx.net>
Acked-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Michele Ballabio <barra_cuda@katamail.com>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Acked-by: Pavel Roskin <proski@gnu.org>
Acked-by: Petr Baudis <pasky@ucw.cz>
Acked-by: Pierre Habouzit <madcoder@debian.org>
Acked-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Stephen Boyd <bebarino@gmail.com>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGitweb: ignore built file
Sverre Rabbelier [Sun, 25 Apr 2010 20:17:05 +0000 (22:17 +0200)] 
Gitweb: ignore built file

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowt-status: fix 'fprintf' compilation warning
Junio 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>
14 years agoMerge 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

14 years agogitweb: Create install target for gitweb in Makefile
Jakub 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>
14 years agogitweb: Improve installation instructions in gitweb/INSTALL
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>
14 years agogitweb: Silence 'Variable VAR may be unavailable' warnings
Jakub 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>
14 years agofsck: check ident lines in commit objects
Jonathan 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>
14 years agogitweb: Move generating page title to separate subroutine
Jakub 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>
14 years agogitweb: Add custom error handler using die_error
Jakub 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>
14 years agogitweb: Use nonlocal jump instead of 'exit' in die_error
Jakub 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>
14 years agogitweb: 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>
14 years agoExport more test-related variables when running external tests
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>
14 years agoindex-pack: fix trivial typo in usage string
Michael 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>
14 years agogit-submodule.sh: properly initialize shell variables
Gerrit 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>
14 years agoxdiff/xmerge.c: use memset() instead of explicit for-loop
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>
14 years agorequest-pull: protect against OPTIONS_KEEPDASHDASH from environment
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>
14 years agotests for request-pull
Jonathan 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>
14 years agoGit 1.7.1 v1.7.1
Junio 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>
14 years agoMerge 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.

14 years agoDocumentation improvements for the description of short format.
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>
14 years agoSync with 1.7.0.6
Junio 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>
14 years agoGit 1.7.0.6 v1.7.0.6
Junio 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>
14 years agoMerge branch 'mg/use-default-abbrev-length-in-rev-list' into maint
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

14 years agoMerge branch 'wp/doc-filter-direction' into maint
Junio 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

14 years agoMerge branch 'jk/maint-diffstat-overflow' into maint
Junio 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

14 years agoMerge branch 'da/maint-python-startup' into maint
Junio 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

14 years agoMerge 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

14 years agoDocumentation/Makefile: fix interrupted builds of user-manual.xml
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>
14 years agostash tests: stash can lose data in a file removed from the index
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>
14 years agoMerge 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

14 years agot5516-fetch-push.sh: style cleanup
Jay 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>
14 years agoreceive-pack: detect aliased updates which can occur with symrefs
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>
14 years agoreceive-pack: switch global variable 'commands' to a parameter
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>
14 years agofix "bundle --stdin" segfault
Jonathan 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>
14 years agot5704 (bundle): add tests for bundle --stdin
Jonathan 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>
14 years agot7012: Mark missing tests as TODO
Michael 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>
14 years agohttp.c::new_http_pack_request: do away with the temp variable filename
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>
14 years agohttp-fetch: Use temporary files for pack-*.idx until verified
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>
14 years agohttp-fetch: Use index-pack rather than verify-pack to check packs
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>
14 years agoAllow parse_pack_index on temporary files
Shawn 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>
14 years agoExtract verify_pack_index for reuse from verify_pack
Shawn 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>
14 years agoIntroduce close_pack_index to permit replacement
Shawn 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>
14 years agohttp.c: Remove unnecessary strdup of sha1_to_hex result
Shawn 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>
14 years agoreflog: remove 'show' from 'expire's usage string
SZEDER 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>
14 years agoremote add: add a --[no-]tags option
Samuel 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>
14 years agoHonor "tagopt = --tags" configuration option
Samuel 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>
14 years agopatch-id: Add support for mbox format
Paolo 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>
14 years agopatch-id: extract parsing one diff out of generate_id_list
Paolo 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>
14 years agoMerge branch 'maint-1.6.6' into maint
Junio 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

14 years agoMSVC: Fix build by adding missing termios.h dummy
Johannes 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>
14 years agoGit 1.7.1-rc2 v1.7.1-rc2
Junio 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>
14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge branch 'jg/auto-initialize-notes-with-percent-n-in-format'
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

14 years agoMerge 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

14 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio 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

14 years agoSubmittingPatches: Add new section about what to base work on
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>
14 years agostash: Don't overwrite files that have gone from the index
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>
14 years agoDocumentation/remote-helpers: Fix typos and improve language
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>
14 years agoFixup: Second argument may be any arbitrary string
Ramkumar 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>
14 years agoDocumentation/remote-helpers: Add invocation section
Ramkumar 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>
14 years agoDocumentation/urls: Rewrite to accomodate <transport>::<address>
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>
14 years agoDocumentation/remote-helpers: Rewrite description
Ramkumar 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>
14 years agoDocumentation: Describe other situations where -z affects git diff
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>
14 years agorebase-interactive: silence warning when no commits rewritten
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>
14 years agot3301: 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>
14 years agoreflog --expire-unreachable: special case entries in "HEAD" reflog
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>
14 years agomore war on "sleep" in tests
Junio 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>
14 years agohttp.c: Don't store destination name in request structures
Shawn 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>
14 years agohttp.c: Drop useless != NULL test in finish_http_pack_request
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>
14 years agohttp.c: Tiny refactoring of finish_http_pack_request
Shawn 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>
14 years agot5550-http-fetch: Use subshell for repository operations
Shawn 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>
14 years agohttp.c: Remove bad free of static block
Shawn 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>
14 years agoMerge 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

14 years agot6006: do not write to /tmp
Matthew 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>
14 years agogit-instaweb: pass through invoking user's path to gitweb CGI scripts
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>
14 years agogitweb: simplify gitweb.min.* generation and clean-up rules
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>
14 years agotag -v: use RUN_GIT_CMD to run verify-tag
Jonathan 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>
14 years agodocumentation: clarify direction of core.autocrlf
Will 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>
14 years agodiff: use large integers for diffstat calculations
Jeff 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>
14 years agot1010-mktree: Adjust expected result to code and documentation
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>
14 years agocombined diff: correctly handle truncated file
Thomas 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>
14 years agogitk: Display dirty submodules correctly
Jens 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>
14 years agoautoconf: Check if <paths.h> exists and set HAVE_PATHS_H
Jakub 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>