gitweb.git
builtin-apply.c: get rid of an unnecessary use of tempo... Junio C Hamano Tue, 1 Sep 2009 09:18:29 +0000 (02:18 -0700)

builtin-apply.c: get rid of an unnecessary use of temporary array

Instead of allocating a temporary array imglen[], copying contents to it
from another array img->line[], and then using imglen[], use the value
from img->line[], whose value does not change during the whole process.

This incidentally removes a use of C99 variable length array, which some
older compilers apparently are not happy with.

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

builtin-pack-objects.c: avoid vlaJunio C Hamano Tue, 1 Sep 2009 09:18:52 +0000 (02:18 -0700)

builtin-pack-objects.c: avoid vla

This is one of only two places that we use C99 variable length array on
the stack, which some older compilers apparently are not happy with.

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

Style fixes, add a space after if/for/while.Brian Gianforcaro Tue, 1 Sep 2009 05:35:10 +0000 (01:35 -0400)

Style fixes, add a space after if/for/while.

The majority of code in core git appears to use a single
space after if/for/while. This is an attempt to bring more
code to this standard. These are entirely cosmetic changes.

Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'lt/approxidate'Junio C Hamano Tue, 1 Sep 2009 05:11:36 +0000 (22:11 -0700)

Merge branch 'lt/approxidate'

* lt/approxidate:
fix approxidate parsing of relative months and years
tests: add date printing and parsing tests
refactor test-date interface
Add date formatting and parsing functions relative to a given time
Further 'approxidate' improvements
Improve on 'approxidate'

Conflicts:
date.c

Merge branch 'mr/gitweb-snapshot'Junio C Hamano Tue, 1 Sep 2009 05:09:53 +0000 (22:09 -0700)

Merge branch 'mr/gitweb-snapshot'

* mr/gitweb-snapshot:
gitweb: add t9501 tests for checking HTTP status codes
gitweb: split test suite into library and tests
gitweb: improve snapshot error handling

Merge branch 'tf/diff-whitespace-incomplete-line'Junio C Hamano Tue, 1 Sep 2009 05:08:57 +0000 (22:08 -0700)

Merge branch 'tf/diff-whitespace-incomplete-line'

* tf/diff-whitespace-incomplete-line:
xutils: Fix xdl_recmatch() on incomplete lines
xutils: Fix hashing an incomplete line with whitespaces at the end

fix approxidate parsing of relative months and yearsJeff King Mon, 31 Aug 2009 02:31:42 +0000 (22:31 -0400)

fix approxidate parsing of relative months and years

These were broken by b5373e9. The problem is that the code
marks the month and year with "-1" for "we don't know it
yet", but the month and year code paths were not adjusted to
fill in the current time before doing their calculations
(whereas other units follow a different code path and are
fine).

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

tests: add date printing and parsing testsJeff King Mon, 31 Aug 2009 02:30:16 +0000 (22:30 -0400)

tests: add date printing and parsing tests

Until now, there was no coverage of relative date printing
or approxidate parsing routines (mainly because we had no
way of faking the "now" time for relative date calculations,
which made consistent testing impossible).

This new script tries to exercise the basic features of
show_date and approxidate. Most of the tests are just "this
obvious thing works" to prevent future regressions, with a
few exceptions:

- We confirm the fix in 607a9e8 that relative year/month
dates in the latter half of a year round correctly.

- We confirm that the improvements in b5373e9 and 1bddb25
work.

- A few tests are marked to expect failure, which are
regressions recently introduced by the two commits
above.

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

refactor test-date interfaceJeff King Mon, 31 Aug 2009 02:26:46 +0000 (22:26 -0400)

refactor test-date interface

The test-date program goes back to the early days of git,
where it was presumably used to do manual sanity checks on
changes to the date code. However, it is not actually used
by the test suite to do any sort of automatic of systematic
tests.

This patch refactors the interface to the program to try to
make it more suitable for use by the test suite. There
should be no fallouts to changing the interface since it is
not actually installed and is not internally called by any
other programs.

The changes are:

- add a "mode" parameter so the caller can specify which
operation to test

- add a mode to test relative date output from show_date

- allow faking a fixed time via the TEST_DATE_NOW
environment variable, which allows consistent automated
testing

- drop the use of ctime for showing dates in favor of our
internal iso8601 printing routines. The ctime output is
somewhat redundant (because of the day-of-week) which
makes writing test cases more annoying.

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

Add date formatting and parsing functions relative... Alex Riesen Mon, 31 Aug 2009 02:26:05 +0000 (22:26 -0400)

Add date formatting and parsing functions relative to a given time

The main purpose is to allow predictable testing of the code.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: fix typoes in commentsJim Meyering Sun, 30 Aug 2009 20:27:02 +0000 (22:27 +0200)

diff.c: fix typoes in comments

Should be squashed when we reroll 'next' into the main commit.

Sync with 1.6.4.2Junio C Hamano Sat, 29 Aug 2009 21:52:03 +0000 (14:52 -0700)

Sync with 1.6.4.2

GIT 1.6.4.2 v1.6.4.2Junio C Hamano Sat, 29 Aug 2009 21:31:01 +0000 (14:31 -0700)

GIT 1.6.4.2

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

UI consistency: allow --force for where -f means forceRené Scharfe Sat, 29 Aug 2009 09:05:00 +0000 (11:05 +0200)

UI consistency: allow --force for where -f means force

git branch, checkout, clean, mv and tag all have an option -f to override
certain checks. This patch makes them accept the long option --force as
a synonym.

While we're at it, document that checkout support --quiet as synonym for
its short option -q.

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

update-server-info: make builtin, use parseoptRené Scharfe Sat, 29 Aug 2009 09:04:52 +0000 (11:04 +0200)

update-server-info: make builtin, use parseopt

Convert git update-server-info to a built-in command and use parseopt.

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

Remove unused t/t8005/iso8859-5.txtNanako Shiraishi Sat, 29 Aug 2009 07:49:32 +0000 (00:49 -0700)

Remove unused t/t8005/iso8859-5.txt

This file is no longer used since 54bc13c (t8005: Nobody writes Russian in
shift_jis, 2009-06-18).

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

upload-pack: feed "kind [clone|fetch]" to post-upload... Junio C Hamano Sat, 29 Aug 2009 05:19:45 +0000 (22:19 -0700)

upload-pack: feed "kind [clone|fetch]" to post-upload-pack hook

A request to clone the repository does not give any "have" but asks for
all the refs we offer with "want". When a request does not ask to clone
the repository fully, but asks to fetch some refs into an empty
repository, it will not give any "have" but its "want" won't ask for all
the refs we offer.

If we suppose (and I would say this is a rather big if) that it makes
sense to distinguish these two cases, a hook cannot reliably do this
alone. The hook can detect lack of "have" and bunch of "want", but there
is no direct way to tell if the other end asked for all refs we offered,
or merely most of them.

Between the time we talked with the other end and the time the hook got
called, we may have acquired more refs or lost some refs in the repository
by concurrent operations. Given that we plan to introduce selective
advertisement of refs with a protocol extension, it would become even more
difficult for hooks to guess between these two cases.

This adds "kind [clone|fetch]" to hook's input, as a stable interface to
allow the hooks to tell these cases apart.

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

upload-pack: add a trigger for post-upload-pack hookJunio C Hamano Wed, 26 Aug 2009 23:39:10 +0000 (16:39 -0700)

upload-pack: add a trigger for post-upload-pack hook

After upload-pack successfully finishes its operation, post-upload-pack
hook can be called for logging purposes.

The hook is passed various pieces of information, one per line, from its
standard input. Currently the following items can be fed to the hook, but
more types of information may be added in the future:

want SHA-1::
40-byte hexadecimal object name the client asked to include in the
resulting pack. Can occur one or more times in the input.

have SHA-1::
40-byte hexadecimal object name the client asked to exclude from
the resulting pack, claiming to have them already. Can occur zero
or more times in the input.

time float::
Number of seconds spent for creating the packfile.

size decimal::
Size of the resulting packfile in bytes.

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

Draft release notes to 1.6.5 before -rc0Junio C Hamano Sat, 29 Aug 2009 02:48:56 +0000 (19:48 -0700)

Draft release notes to 1.6.5 before -rc0

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

Merge branch 'mm/reset-report'Junio C Hamano Sat, 29 Aug 2009 02:39:26 +0000 (19:39 -0700)

Merge branch 'mm/reset-report'

* mm/reset-report:
reset: make the reminder output consistent with "checkout"
Rename REFRESH_SAY_CHANGED to REFRESH_IN_PORCELAIN.

Merge branch 'jk/maint-1.6.3-checkout-unborn'Junio C Hamano Sat, 29 Aug 2009 02:39:07 +0000 (19:39 -0700)

Merge branch 'jk/maint-1.6.3-checkout-unborn'

* jk/maint-1.6.3-checkout-unborn:
checkout: do not imply "-f" on unborn branches

Merge branch 'np/maint-1.6.3-deepen'Junio C Hamano Sat, 29 Aug 2009 02:38:56 +0000 (19:38 -0700)

Merge branch 'np/maint-1.6.3-deepen'

* np/maint-1.6.3-deepen:
fix simple deepening of a repo

Conflicts:
t/t5500-fetch-pack.sh

Merge branch 'jc/shortstatus'Junio C Hamano Sat, 29 Aug 2009 02:38:19 +0000 (19:38 -0700)

Merge branch 'jc/shortstatus'

* jc/shortstatus:
git commit --dry-run -v: show diff in color when asked
Documentation/git-commit.txt: describe --dry-run
wt-status: collect untracked files in a separate "collect" phase
Make git_status_config() file scope static to builtin-commit.c
wt-status: move wt_status_colors[] into wt_status structure
wt-status: move many global settings to wt_status structure
commit: --dry-run
status: show worktree status of conflicted paths separately
wt-status.c: rework the way changes to the index and work tree are summarized
diff-index: keep the original index intact
diff-index: report unmerged new entries

Merge branch 'maint'Junio C Hamano Sat, 29 Aug 2009 02:37:57 +0000 (19:37 -0700)

Merge branch 'maint'

* maint:
http.c: set slot callback members to NULL when releasing object

Merge branch 'rc/maint-http-fix' into maintJunio C Hamano Sat, 29 Aug 2009 02:34:16 +0000 (19:34 -0700)

Merge branch 'rc/maint-http-fix' into maint

* rc/maint-http-fix:
http.c: don't assume that urls don't end with slash

http.c: set slot callback members to NULL when releasin... Tay Ray Chuan Wed, 26 Aug 2009 12:20:53 +0000 (20:20 +0800)

http.c: set slot callback members to NULL when releasing object

Set the members callback_func and callback_data of freq->slot to NULL
when releasing a http_object_request. release_active_slot() is also
invoked on the slot to remove the curl handle associated with the slot
from the multi stack (CURLM *curlm in http.c).

These prevent the callback function and data from being used in http
methods (like http.c::finish_active_slot()) after a
http_object_request has been free'd.

Noticed by Ali Polatel, who later tested this patch to verify that it
fixes the problem he saw; Dscho helped to identify the problem spot.

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

t/test-lib.sh: provide a shell implementation of the... Brandon Casey Fri, 28 Aug 2009 22:32:41 +0000 (17:32 -0500)

t/test-lib.sh: provide a shell implementation of the 'yes' utility

Some platforms (IRIX 6.5, Solaris 7) do not provide the 'yes' utility.
Currently, some tests, including t7610 and t9001, try to call this program.
Due to the way the tests are structured, the tests still pass even though
this program is missing. Rather than succeeding by chance, let's provide
an implementation of the simple 'yes' utility in shell for all platforms to
use.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Fri, 28 Aug 2009 05:01:01 +0000 (22:01 -0700)

Merge branch 'maint'

* maint:
Fix overridable written with an extra 'e'
Documentation: git-archive: mark --format as optional in summary
Round-down years in "years+months" relative date view

Merge branch 'maint-1.6.3' into maintJunio C Hamano Fri, 28 Aug 2009 03:42:42 +0000 (20:42 -0700)

Merge branch 'maint-1.6.3' into maint

* maint-1.6.3:
Fix overridable written with an extra 'e'
Documentation: git-archive: mark --format as optional in summary
Round-down years in "years+months" relative date view

Merge branch 'maint-1.6.2' into maint-1.6.3Junio C Hamano Fri, 28 Aug 2009 03:42:38 +0000 (20:42 -0700)

Merge branch 'maint-1.6.2' into maint-1.6.3

* maint-1.6.2:
Fix overridable written with an extra 'e'
Documentation: git-archive: mark --format as optional in summary
Round-down years in "years+months" relative date view

Conflicts:
Documentation/git-archive.txt

Fix overridable written with an extra 'e'Nanako Shiraishi Fri, 28 Aug 2009 03:18:49 +0000 (12:18 +0900)

Fix overridable written with an extra 'e'

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint-1.6.1' into maint-1.6.2Junio C Hamano Fri, 28 Aug 2009 03:41:37 +0000 (20:41 -0700)

Merge branch 'maint-1.6.1' into maint-1.6.2

* maint-1.6.1:
Documentation: git-archive: mark --format as optional in summary

Merge branch 'maint-1.6.0' into maint-1.6.1Junio C Hamano Fri, 28 Aug 2009 03:41:31 +0000 (20:41 -0700)

Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
Documentation: git-archive: mark --format as optional in summary

Documentation: git-archive: mark --format as optional... Wesley J. Landaker Fri, 28 Aug 2009 02:55:43 +0000 (20:55 -0600)

Documentation: git-archive: mark --format as optional in summary

The --format option was made optional in 8ff21b1 (git-archive: make
tar the default format, 2007-04-09), but it was not marked as optional
in the summary. This trival patch just changes the summary to match
the rest of the documentation.

Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint-1.5.6' into maint-1.6.0Junio C Hamano Fri, 28 Aug 2009 03:03:35 +0000 (20:03 -0700)

Merge branch 'maint-1.5.6' into maint-1.6.0

* maint-1.5.6:
revision traversal and pack: notice and die on missing commit

Round-down years in "years+months" relative date viewDavid Reiss Thu, 27 Aug 2009 23:39:38 +0000 (16:39 -0700)

Round-down years in "years+months" relative date view

Previously, a commit from 1 year and 7 months ago would display as
"2 years, 7 months ago".

Signed-off-by: David Reiss <dreiss@facebook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: add t9501 tests for checking HTTP status codesMark Rada Tue, 25 Aug 2009 05:03:48 +0000 (01:03 -0400)

gitweb: add t9501 tests for checking HTTP status codes

Adds a new test file, t9501, that checks HTTP status codes and messages
from gitweb.

Currently, the only tests are for the snapshot feature.

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

gitweb: split test suite into library and testsMark Rada Fri, 28 Aug 2009 02:07:07 +0000 (22:07 -0400)

gitweb: split test suite into library and tests

To accommodate additions to the test cases for gitweb, the preamble
from t9500 is now in its own library so that new sets of tests for
gitweb can use the same setup without copying the code.

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

Merge branch 'lt/block-sha1'Junio C Hamano Fri, 28 Aug 2009 00:00:35 +0000 (17:00 -0700)

Merge branch 'lt/block-sha1'

* lt/block-sha1:
remove ARM and Mozilla SHA1 implementations
block-sha1: guard gcc extensions with __GNUC__
make sure byte swapping is optimal for git
block-sha1: make the size member first in the context struct

Merge branch 'as/maint-graph-interesting-fix'Junio C Hamano Thu, 27 Aug 2009 23:59:56 +0000 (16:59 -0700)

Merge branch 'as/maint-graph-interesting-fix'

* as/maint-graph-interesting-fix:
Add tests for rev-list --graph with options that simplify history
graph API: fix bug in graph_is_interesting()

Merge branch 'jh/submodule-foreach'Junio C Hamano Thu, 27 Aug 2009 23:59:25 +0000 (16:59 -0700)

Merge branch 'jh/submodule-foreach'

* jh/submodule-foreach:
git clone: Add --recursive to automatically checkout (nested) submodules
t7407: Use 'rev-parse --short' rather than bash's substring expansion notation
git submodule status: Add --recursive to recurse into nested submodules
git submodule update: Introduce --recursive to update nested submodules
git submodule foreach: Add --recursive to recurse into nested submodules
git submodule foreach: test access to submodule name as '$name'
Add selftest for 'git submodule foreach'
git submodule: Cleanup usage string and add option parsing to cmd_foreach()
git submodule foreach: Provide access to submodule name, as '$name'

Conflicts:
Documentation/git-submodule.txt
git-submodule.sh

Merge branch 'jc/maint-unpack-objects-strict'Junio C Hamano Thu, 27 Aug 2009 23:59:08 +0000 (16:59 -0700)

Merge branch 'jc/maint-unpack-objects-strict'

* jc/maint-unpack-objects-strict:
Fix "unpack-objects --strict"

Conflicts:
builtin-unpack-objects.c

Merge branch 'wl/insta-mongoose'Junio C Hamano Thu, 27 Aug 2009 23:57:34 +0000 (16:57 -0700)

Merge branch 'wl/insta-mongoose'

* wl/insta-mongoose:
Add support for the Mongoose web server.

Merge branch 'nd/sparse' (early part)Junio C Hamano Thu, 27 Aug 2009 23:56:33 +0000 (16:56 -0700)

Merge branch 'nd/sparse' (early part)

* 'nd/sparse' (early part):
Prevent diff machinery from examining assume-unchanged entries on worktree

Make test case number uniqueJohannes Sixt Thu, 27 Aug 2009 07:38:27 +0000 (09:38 +0200)

Make test case number unique

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

Make test case number uniqueJohannes Sixt Thu, 27 Aug 2009 07:35:55 +0000 (09:35 +0200)

Make test case number unique

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

commit.c: rename variable named 'n' which masks previou... Brandon Casey Thu, 27 Aug 2009 16:16:34 +0000 (11:16 -0500)

commit.c: rename variable named 'n' which masks previous declaration

The variable named 'n' was initially declared to be of type int. The name
'n' was reused inside inner blocks as a different type. Rename the uses
within inner blocks to avoid confusion and give them a slightly more
descriptive name.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

abspath.c: move declaration of 'len' into inner block... Brandon Casey Thu, 27 Aug 2009 16:16:33 +0000 (11:16 -0500)

abspath.c: move declaration of 'len' into inner block and use appropriate type

The 'len' variable was declared at the beginning of the make_absolute_path
function and also in an inner 'if' block which masked the outer declaration.
It is only used in two 'if' blocks, so remove the outer declaration and
make a new declaration inside the other 'if' block that uses 'len'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: remove pointless conditional assignment in... Brandon Casey Thu, 27 Aug 2009 15:35:46 +0000 (10:35 -0500)

Makefile: remove pointless conditional assignment in SunOS section

It is true that NEEDS_RESOLV is needed on SunOS if NO_IPV6 is set since
hstrerror() resides in libresolv, but performing this test at its current
location is not very useful. It will only have any effect if the user
modifies the make variables from the make command line, and will have no
effect if a config.mak file is used. A better location for this
conditional would have been further down in the Makefile after the
config.mak and config.mak.autogen had been parsed. Rather than adding
clutter to the Makefile for a conditional that will likely never be
triggered, just remove it, and any user on SunOS that manually sets NO_IPV6
can also set NEEDS_RESOLV.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailinfo.scissors: new configurationJunio C Hamano Thu, 27 Aug 2009 05:30:33 +0000 (22:30 -0700)

mailinfo.scissors: new configuration

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

am/mailinfo: Disable scissors processing by defaultJunio C Hamano Thu, 27 Aug 2009 04:36:05 +0000 (21:36 -0700)

am/mailinfo: Disable scissors processing by default

You can enable it by giving --scissors to "git am".

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

Documentation: describe the scissors mark support of... Nanako Shiraishi Tue, 25 Aug 2009 08:20:00 +0000 (17:20 +0900)

Documentation: describe the scissors mark support of "git am"

Describe what a scissors mark looks like, and explain in what situation
it is often used.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Teach mailinfo to ignore everything before -- >8 -... Junio C Hamano Sun, 23 Aug 2009 08:56:19 +0000 (01:56 -0700)

Teach mailinfo to ignore everything before -- >8 -- mark

This teaches mailinfo the scissors -- >8 -- mark; the command ignores
everything before it in the message body.

For lefties among us, we also support -- 8< -- ;-)

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

builtin-mailinfo.c: fix confusing internal API to maili... Junio C Hamano Thu, 27 Aug 2009 05:17:25 +0000 (22:17 -0700)

builtin-mailinfo.c: fix confusing internal API to mailinfo()

It fed two arguments to override the corresponding global variables,
but the caller always assigned the values to the global variables
first and then passed those global variables to this function.

Stop pretending to be a proper API to confuse people.

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

clone: add --branch option to select a different HEADJeff King Wed, 26 Aug 2009 19:05:08 +0000 (15:05 -0400)

clone: add --branch option to select a different HEAD

We currently point the HEAD of a newly cloned repo to the
same ref as the parent repo's HEAD. While a user can then
"git checkout -b foo origin/foo" whichever branch they
choose, it is more convenient and more efficient to tell
clone which branch you want in the first place.

Based on a patch by Kirill A. Korinskiy.

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

git-gui: Ensure submodule path is quoted properlyShawn O. Pearce Thu, 27 Aug 2009 00:39:45 +0000 (17:39 -0700)

git-gui: Ensure submodule path is quoted properly

When quoting an arbitrary user string in Tcl, its better to use
[list ...] than to use {...}, in case the user string has spaces
or { embedded within it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: fix diff for partially staged submodule changesJens Lehmann Wed, 26 Aug 2009 20:25:15 +0000 (22:25 +0200)

git-gui: fix diff for partially staged submodule changes

When a submodule commit had already been staged and another commit had
been checked out inside the submodule, the diff always displayed the
submodule commit log messages between the last supermodule commit and
the working tree, totally ignoring the commit in the index.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Merge branch 'maint'Junio C Hamano Wed, 26 Aug 2009 19:15:15 +0000 (12:15 -0700)

Merge branch 'maint'

* maint:
git-log: allow --decorate[=short|full]
Minor improvement to the write-tree documentation
git-bisect: call the found commit "*the* first bad commit"

git-log: allow --decorate[=short|full]Lars Hjemli Sat, 15 Aug 2009 14:23:12 +0000 (16:23 +0200)

git-log: allow --decorate[=short|full]

Commit de435ac0 changed the behavior of --decorate from printing the
full ref (e.g., "refs/heads/master") to a shorter, more human-readable
version (e.g., just "master"). While this is nice for human readers,
external tools using the output from "git log" may prefer the full
version.

This patch introduces an extension to --decorate to allow the caller to
specify either the short or the full versions.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Minor improvement to the write-tree documentationDavid Kågedal Wed, 26 Aug 2009 14:04:54 +0000 (16:04 +0200)

Minor improvement to the write-tree documentation

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-bisect: call the found commit "*the* first bad... Nanako Shiraishi Wed, 26 Aug 2009 08:38:50 +0000 (17:38 +0900)

git-bisect: call the found commit "*the* first bad commit"

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/maint-cover-letter-non-ascii' into... Junio C Hamano Wed, 26 Aug 2009 19:05:57 +0000 (12:05 -0700)

Merge branch 'js/maint-cover-letter-non-ascii' into maint

* js/maint-cover-letter-non-ascii:
Correctly mark cover letters' encodings if they are not pure ASCII
Expose the has_non_ascii() function

Merge branch 'jc/maint-clean-nested-dir-safety' into... Junio C Hamano Wed, 26 Aug 2009 19:05:57 +0000 (12:05 -0700)

Merge branch 'jc/maint-clean-nested-dir-safety' into maint

* jc/maint-clean-nested-dir-safety:
clean: require double -f options to nuke nested git repository and work tree

Merge branch 'jk/maint-merge-msg-fix' into maintJunio C Hamano Wed, 26 Aug 2009 19:05:57 +0000 (12:05 -0700)

Merge branch 'jk/maint-merge-msg-fix' into maint

* jk/maint-merge-msg-fix:
merge: indicate remote tracking branches in merge message
merge: fix incorrect merge message for ambiguous tag/branch
add tests for merge message headings

Merge branch 'jc/apply-epoch-patch' into maintJunio C Hamano Wed, 26 Aug 2009 19:05:57 +0000 (12:05 -0700)

Merge branch 'jc/apply-epoch-patch' into maint

* jc/apply-epoch-patch:
apply: notice creation/removal patches produced by GNU diff

Merge branch 'jp/symlink-dirs' into maintJunio C Hamano Wed, 26 Aug 2009 19:05:57 +0000 (12:05 -0700)

Merge branch 'jp/symlink-dirs' into maint

* jp/symlink-dirs:
t6035-merge-dir-to-symlink depends on SYMLINKS prerequisite
git-checkout: be careful about untracked symlinks
lstat_cache: guard against full match of length of 'name' parameter
Demonstrate bugs when a directory is replaced with a symlink

Merge branch 'maint-1.6.3' into maintJunio C Hamano Wed, 26 Aug 2009 19:05:57 +0000 (12:05 -0700)

Merge branch 'maint-1.6.3' into maint

* maint-1.6.3:
add -p: do not attempt to coalesce mode changes
git add -p: demonstrate failure when staging both mode and hunk

Merge branch 'tr/maint-1.6.3-add-p-modeonly-fix' into... Junio C Hamano Wed, 26 Aug 2009 18:22:00 +0000 (11:22 -0700)

Merge branch 'tr/maint-1.6.3-add-p-modeonly-fix' into maint-1.6.3

* tr/maint-1.6.3-add-p-modeonly-fix:
add -p: do not attempt to coalesce mode changes
git add -p: demonstrate failure when staging both mode and hunk

gitweb: improve snapshot error handlingMark Rada Tue, 25 Aug 2009 04:59:48 +0000 (00:59 -0400)

gitweb: improve snapshot error handling

The last check in the second block of checks in the &git_snapshot routine
is never executed because the second to last check is a superset of the
last check.

Switch the order of the last two checks. It has the advantage of giving
clients a more specific reason why they cannot get a snapshot format if
the format they have chosen is disabled.

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

Merge branch 'aj/fix-read-tree-from-scratch'Junio C Hamano Tue, 25 Aug 2009 21:48:15 +0000 (14:48 -0700)

Merge branch 'aj/fix-read-tree-from-scratch'

* aj/fix-read-tree-from-scratch:
read-tree: Fix regression with creation of a new index file.

Merge branch 'jc/maint-checkout-index-to-prefix'Junio C Hamano Tue, 25 Aug 2009 21:47:56 +0000 (14:47 -0700)

Merge branch 'jc/maint-checkout-index-to-prefix'

* jc/maint-checkout-index-to-prefix:
check_path(): allow symlinked directories to checkout-index --prefix

Merge branch 'jl/submodule-summary-diff-files'Junio C Hamano Tue, 25 Aug 2009 21:46:43 +0000 (14:46 -0700)

Merge branch 'jl/submodule-summary-diff-files'

* jl/submodule-summary-diff-files:
Documentaqtion/git-submodule.txt: Typofix
git submodule summary: add --files option

Merge branch 'lh/short-decorate'Junio C Hamano Tue, 25 Aug 2009 21:46:12 +0000 (14:46 -0700)

Merge branch 'lh/short-decorate'

* lh/short-decorate:
git-log: allow --decorate[=short|full]

Merge branch 'oa/stash-na'Junio C Hamano Tue, 25 Aug 2009 21:46:04 +0000 (14:46 -0700)

Merge branch 'oa/stash-na'

* oa/stash-na:
git stash: Give friendlier errors when there is nothing to apply

Documentation: consistently refer to check-ref-formatNanako Shiraishi Sat, 22 Aug 2009 00:45:18 +0000 (09:45 +0900)

Documentation: consistently refer to check-ref-format

Change the <name> placeholder to <tagname> in the SYNOPSIS section of
git-tag documentation, and describe it in the OPTIONS section in a way
similar to how documentation for git-branch does.

Add SEE ALSO section to list the other documentation pages these two pages
refer to.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout: do not imply "-f" on unborn branchesJeff King Tue, 25 Aug 2009 03:03:16 +0000 (23:03 -0400)

checkout: do not imply "-f" on unborn branches

When checkout sees that HEAD points to a non-existent ref,
it currently acts as if "-f" was given; this behavior dates
back to 5a03e7f, which enabled checkout from unborn branches
in the shell version of "git-checkout". The reasoning given
is to avoid the code path which tries to merge the tree
contents. When checkout was converted to C, this code
remained intact.

The unfortunate side effect of this strategy is that the
"force" code path will overwrite working tree and index
state that may be precious to the user. Instead of enabling
"force", this patch uses the normal "merge" codepath for an
unborn branch, but substitutes the empty tree for the "old"
commit.

This means that in the absence of an index, any files in the
working tree will be treated as untracked files, and a
checkout which would overwrite them is aborted. Similarly,
any paths in the index will be merged with an empty entry
as the base, meaning that unless the new branch's content is
identical to what's in the index, there will be a conflict
and the checkout will be aborted.

The user is then free to correct the situation or proceed
with "-f" as appropriate.

This patch also removes the "warning: you are on a branch
yet to be born" message. Its function was to warn the user
that we were enabling the "-f" option. Since we are no
longer doing that, there is no reason for the user to care
whether we are switching away from an unborn branch.

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

fix simple deepening of a repoNicolas Pitre Mon, 24 Aug 2009 04:04:09 +0000 (00:04 -0400)

fix simple deepening of a repo

If all refs sent by the remote repo during a fetch are reachable
locally, then no further conversation is performed with the remote. This
check is skipped when the --depth argument is provided to allow the
deepening of a shallow clone which corresponding remote repo has no
changed.

However, some additional filtering was added in commit c29727d5 to
remove those refs which are equal on both sides. If the remote repo has
not changed, then the list of refs to give the remote process becomes
empty and simply attempting to deepen a shallow repo always fails.

Let's stop being smart in that case and simply send the whole list over
when that condition is met. The remote will do the right thing anyways.

Test cases for this issue are also provided.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add tests for rev-list --graph with options that simpli... Adam Simpkins Fri, 21 Aug 2009 18:20:34 +0000 (11:20 -0700)

Add tests for rev-list --graph with options that simplify history

These tests help make sure graph_is_interesting() is doing the right
thing.

Signed-off-by: Adam Simpkins <simpkins@facebook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/verify-pack-stat'Junio C Hamano Mon, 24 Aug 2009 00:19:19 +0000 (17:19 -0700)

Merge branch 'jc/verify-pack-stat'

* jc/verify-pack-stat:
verify-pack --stat-only: show histogram without verifying

Merge branch 'mr/gitweb-xz'Junio C Hamano Mon, 24 Aug 2009 00:19:06 +0000 (17:19 -0700)

Merge branch 'mr/gitweb-xz'

* mr/gitweb-xz:
gitweb: add support for XZ compressed snapshots
gitweb: update INSTALL regarding specific snapshot settings
gitweb: support to globally disable a snapshot format

Merge branch 'ld/p4'Junio C Hamano Mon, 24 Aug 2009 00:18:52 +0000 (17:18 -0700)

Merge branch 'ld/p4'

* ld/p4:
git-p4: stream from perforce to speed up clones

sparse checkout: inhibit empty worktreeNguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:13 +0000 (20:47 +0700)

sparse checkout: inhibit empty worktree

The way sparse checkout works, users may empty their worktree
completely, because of non-matching sparse-checkout spec, or empty
spec. I believe this is not desired. This patch makes Git refuse to
produce such worktree.

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

Add tests for sparse checkoutNguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:12 +0000 (20:47 +0700)

Add tests for sparse checkout

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

read-tree: add --no-sparse-checkout to disable sparse... Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:11 +0000 (20:47 +0700)

read-tree: add --no-sparse-checkout to disable sparse checkout support

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

unpack-trees(): ignore worktree check outside checkout... Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:10 +0000 (20:47 +0700)

unpack-trees(): ignore worktree check outside checkout area

verify_absent() and verify_uptodate() are used to ensure worktree
is safe to be updated, then CE_REMOVE or CE_UPDATE will be set.
Finally check_updates() bases on CE_REMOVE, CE_UPDATE and the
recently added CE_WT_REMOVE to update working directory accordingly.

The entries that are checked may eventually be left out of checkout
area (done later in apply_sparse_checkout()). We don't want to update
outside checkout area. This patch teaches Git to assume "good",
skip these checks when it's sure those entries will be outside checkout
area, and clear CE_REMOVE|CE_UPDATE that could be set due to this
assumption.

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

unpack_trees(): apply $GIT_DIR/info/sparse-checkout... Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:09 +0000 (20:47 +0700)

unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final index

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

unpack-trees(): "enable" sparse checkout and load ... Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:08 +0000 (20:47 +0700)

unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkout

This patch introduces core.sparseCheckout, which will control whether
sparse checkout support is enabled in unpack_trees()

It also loads sparse-checkout file that will be used in the next patch.
I split it out so the next patch will be shorter, easier to read.

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

unpack-trees.c: generalize verify_* functionsNguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:07 +0000 (20:47 +0700)

unpack-trees.c: generalize verify_* functions

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

unpack-trees(): add CE_WT_REMOVE to remove on worktree... Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:06 +0000 (20:47 +0700)

unpack-trees(): add CE_WT_REMOVE to remove on worktree alone

CE_REMOVE now removes both worktree and index versions. Sparse
checkout must be able to remove worktree version while keep the
index intact when checkout area is narrowed.

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

Introduce "sparse checkout"Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:05 +0000 (20:47 +0700)

Introduce "sparse checkout"

With skip-worktree bit, you can manually set it to unwanted files,
then remove them: you would have the so-called sparse checkout. The
disadvantages are:

- Porcelain tools are not aware of this. Everytime you do an
operation that may update working directory, skip-worktree may be
cleared out. You have to set them again.

- You still have to remove skip-worktree'd files manually, which is
boring and ineffective.

These will be addressed in the following patches. This patch gives an
idea what is "sparse checkout" in Documentation/git-read-tree.txt.
This file is chosen instead of git-checkout.txt because it is quite
technical and user-unfriendly. I'd expect git-checkout.txt to have
something when Porcelain support is done.

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

dir.c: export excluded_1() and add_excludes_from_file_1()Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:04 +0000 (20:47 +0700)

dir.c: export excluded_1() and add_excludes_from_file_1()

These functions are used to handle .gitignore. They are now exported
so that sparse checkout can reuse.

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

excluded_1(): support exclude files in indexNguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:03 +0000 (20:47 +0700)

excluded_1(): support exclude files in index

Index does not really have "directories", attempts to match "foo/"
against index will fail unless someone tries to reconstruct directories
from a list of file.

Observing that dtype in this function can never be NULL (otherwise
it would segfault), dtype NULL will be used to say "hey.. you are
matching against index" and behave properly.

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

unpack-trees(): carry skip-worktree bit over in merged_... Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:02 +0000 (20:47 +0700)

unpack-trees(): carry skip-worktree bit over in merged_entry()

In this code path, we would remove "old" and replace it with "merge".
"old" may have skip-worktree bit, so re-add it to "merge".

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

Read .gitignore from index if it is skip-worktreeNguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:01 +0000 (20:47 +0700)

Read .gitignore from index if it is skip-worktree

This adds index as a prerequisite for directory listing (with
exclude). At the moment directory listing is used by "git clean",
"git add", "git ls-files" and "git status"/"git commit" and
unpack_trees()-related commands. These commands have been
checked/modified to populate index before doing directory listing.

add_excludes_from_file() does not enable this feature, because it
is used to read .git/info/exclude and some explicit files specified
by "git ls-files".

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

Avoid writing to buffer in add_excludes_from_file_1()Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:47:00 +0000 (20:47 +0700)

Avoid writing to buffer in add_excludes_from_file_1()

In the next patch, the buffer that is being used within
add_excludes_from_file_1() comes from another function and does not
have extra space to put \n at the end.

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

Teach Git to respect skip-worktree bit (writing part)Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:46:59 +0000 (20:46 +0700)

Teach Git to respect skip-worktree bit (writing part)

This part is mainly to remove CE_VALID shortcuts (and as a
consequence, ce_uptodate() shortcuts as it may be turned on by
CE_VALID) in writing code path if skip-worktree is used. Various tests
are added to avoid future breakages.

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

Teach Git to respect skip-worktree bit (reading part)Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:46:58 +0000 (20:46 +0700)

Teach Git to respect skip-worktree bit (reading part)

grep: turn on --cached for files that is marked skip-worktree
ls-files: do not check for deleted file that is marked skip-worktree
update-index: ignore update request if it's skip-worktree, while still allows removing
diff*: skip worktree version

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

Introduce "skip-worktree" bit in index, teach Git to... Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:46:57 +0000 (20:46 +0700)

Introduce "skip-worktree" bit in index, teach Git to get/set this bit

Detail about this bit is in Documentation/git-update-index.txt.

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

Add test-index-versionNguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:46:56 +0000 (20:46 +0700)

Add test-index-version

Commit 06aaaa0bf70fe37d198893f4e25fa73b6516f8a9 may step index format
version up and down, depends on whether extended flags present in the
index. This adds a test to check for index format version.

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

update-index: refactor mark_valid() in preparation... Nguyễn Thái Ngọc Duy Thu, 20 Aug 2009 13:46:55 +0000 (20:46 +0700)

update-index: refactor mark_valid() in preparation for new options

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