gitweb.git
Merge branch 'maint'Junio C Hamano Thu, 9 Dec 2010 18:45:53 +0000 (10:45 -0800)

Merge branch 'maint'

* maint:
contrib/hooks/post-receive-email: fix return values from prep_for_email

Merge branch 'jn/ignore-doc' into maintJunio C Hamano Thu, 9 Dec 2010 18:38:16 +0000 (10:38 -0800)

Merge branch 'jn/ignore-doc' into maint

* jn/ignore-doc:
Documentation: point to related commands from gitignore
Documentation: split gitignore page into sections

Merge branch 'jn/cherry-pick-refresh-index' into maintJunio C Hamano Thu, 9 Dec 2010 18:36:51 +0000 (10:36 -0800)

Merge branch 'jn/cherry-pick-refresh-index' into maint

* jn/cherry-pick-refresh-index:
cherry-pick/revert: transparently refresh index

Merge branch 'jl/add-p-reverse-message' into maintJunio C Hamano Thu, 9 Dec 2010 18:36:47 +0000 (10:36 -0800)

Merge branch 'jl/add-p-reverse-message' into maint

* jl/add-p-reverse-message:
Correct help blurb in checkout -p and friends

Merge branch 'np/diff-in-corrupt-repository' into maintJunio C Hamano Thu, 9 Dec 2010 18:36:39 +0000 (10:36 -0800)

Merge branch 'np/diff-in-corrupt-repository' into maint

* np/diff-in-corrupt-repository:
diff: don't presume empty file when corresponding object is missing

Merge branch 'fc/apply-p2-get-header-name' into maintJunio C Hamano Thu, 9 Dec 2010 18:36:36 +0000 (10:36 -0800)

Merge branch 'fc/apply-p2-get-header-name' into maint

* fc/apply-p2-get-header-name:
test: git-apply -p2 rename/chmod only
Fix git-apply with -p greater than 1

Merge branch 'np/pack-broken-boundary' into maintJunio C Hamano Thu, 9 Dec 2010 18:36:23 +0000 (10:36 -0800)

Merge branch 'np/pack-broken-boundary' into maint

* np/pack-broken-boundary:
make pack-objects a bit more resilient to repo corruption

Merge branch 'ak/apply-non-git-epoch' into maintJunio C Hamano Thu, 9 Dec 2010 18:36:16 +0000 (10:36 -0800)

Merge branch 'ak/apply-non-git-epoch' into maint

* ak/apply-non-git-epoch:
apply: handle patches with funny filename and colon in timezone
apply: Recognize epoch timestamps with : in the timezone

Merge branch 'cm/diff-check-at-eol' into maintJunio C Hamano Thu, 9 Dec 2010 18:36:10 +0000 (10:36 -0800)

Merge branch 'cm/diff-check-at-eol' into maint

* cm/diff-check-at-eol:
diff --check: correct line numbers of new blank lines at EOF

Merge branch 'tc/smart-http-post-redirect' into maintJunio C Hamano Thu, 9 Dec 2010 18:36:04 +0000 (10:36 -0800)

Merge branch 'tc/smart-http-post-redirect' into maint

* tc/smart-http-post-redirect:
smart-http: Don't change POST to GET when following redirect

Merge branch 'ab/require-perl-5.8' into maintJunio C Hamano Thu, 9 Dec 2010 18:35:21 +0000 (10:35 -0800)

Merge branch 'ab/require-perl-5.8' into maint

* ab/require-perl-5.8:
perl: use "use warnings" instead of -w
perl: bump the required Perl version to 5.8 from 5.6.[21]

contrib/hooks/post-receive-email: fix return values... Alan Raison Thu, 9 Dec 2010 16:03:05 +0000 (16:03 +0000)

contrib/hooks/post-receive-email: fix return values from prep_for_email

The function was returning 0 for failure and 1 for success which was
breaking the logic in the main loop. It now also returns in all
cases, rather than exiting.

Signed-off-by: Alan Raison <alan@theraisons.me.uk>
Acked-by: Kevin P. Fleming <kpfleming@digium.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9010 fails when no svn is availableJunio C Hamano Thu, 9 Dec 2010 06:53:59 +0000 (22:53 -0800)

t9010 fails when no svn is available

Running test t9010 without svn currently errors out for no good reason.

The test uses "svnadmin" without checking if svn is available. This was a
regression introduced by b0ad24b (t9010 (svn-fe): Eliminate dependency on
svn perl bindings, 2010-10-10) when it stopped including ./lib-git-svn.sh
that had the safety.

This should fix it.

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

Do not link with -lcrypto under NO_OPENSSLJunio C Hamano Wed, 8 Dec 2010 22:54:13 +0000 (14:54 -0800)

Do not link with -lcrypto under NO_OPENSSL

With 401857c (imap-send: link against libcrypto for HMAC and others,
2010-11-24) we started linking imap-send unconditionally with -lcrypto by
mistake; disable this when we are building under NO_OPENSSL.

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

Merge branch 'nd/maint-fix-add-typo-detection' (early... Junio C Hamano Wed, 8 Dec 2010 19:25:52 +0000 (11:25 -0800)

Merge branch 'nd/maint-fix-add-typo-detection' (early part)

* 'nd/maint-fix-add-typo-detection' (early part):
add: do not rely on dtype being NULL behavior

Merge branch 'jn/gitweb-time-hires-comes-with-5.8'Junio C Hamano Wed, 8 Dec 2010 19:25:04 +0000 (11:25 -0800)

Merge branch 'jn/gitweb-time-hires-comes-with-5.8'

* jn/gitweb-time-hires-comes-with-5.8:
gitweb: Time::HiRes is in core for Perl 5.8

Merge branch 'il/remote-fd-ext'Junio C Hamano Wed, 8 Dec 2010 19:24:14 +0000 (11:24 -0800)

Merge branch 'il/remote-fd-ext'

* il/remote-fd-ext:
remote-fd/ext: finishing touches after code review
git-remote-ext
git-remote-fd
Add bidirectional_transfer_loop()

Conflicts:
compat/mingw.h

Merge branch 'jk/pager-per-command'Junio C Hamano Wed, 8 Dec 2010 19:24:14 +0000 (11:24 -0800)

Merge branch 'jk/pager-per-command'

* jk/pager-per-command:
allow command-specific pagers in pager.<cmd>

Merge branch 'jk/maint-decorate-01-bool'Junio C Hamano Wed, 8 Dec 2010 19:24:14 +0000 (11:24 -0800)

Merge branch 'jk/maint-decorate-01-bool'

* jk/maint-decorate-01-bool:
log.decorate: accept 0/1 bool values

Merge branch 'gc/http-with-non-ascii-username-url'Junio C Hamano Wed, 8 Dec 2010 19:24:14 +0000 (11:24 -0800)

Merge branch 'gc/http-with-non-ascii-username-url'

* gc/http-with-non-ascii-username-url:
Fix username and password extraction from HTTP URLs
t5550: test HTTP authentication and userinfo decoding

Conflicts:
t/lib-httpd/apache.conf

Merge branch 'ks/maint-getenv-fix'Junio C Hamano Wed, 8 Dec 2010 19:24:13 +0000 (11:24 -0800)

Merge branch 'ks/maint-getenv-fix'

* ks/maint-getenv-fix:
setup: make sure git_dir path is in a permanent buffer, getenv(3) case

Merge branch 'gb/gitweb-remote-heads'Junio C Hamano Wed, 8 Dec 2010 19:24:13 +0000 (11:24 -0800)

Merge branch 'gb/gitweb-remote-heads'

* gb/gitweb-remote-heads:
git instaweb: enable remote_heads
gitweb: group remote heads by remote
gitweb: provide a routine to display (sub)sections
gitweb: refactor repository URL printing
gitweb: remotes view for a single remote
gitweb: allow action specialization in page header
gitweb: nagivation menu for tags, heads and remotes
gitweb: separate heads and remotes lists
gitweb: git_get_heads_list accepts an optional list of refs
gitweb: introduce remote_heads feature
gitweb: use fullname as hash_base in heads link

Merge branch 'mg/maint-tag-rfc1991'Junio C Hamano Wed, 8 Dec 2010 19:24:13 +0000 (11:24 -0800)

Merge branch 'mg/maint-tag-rfc1991'

* mg/maint-tag-rfc1991:
tag: recognize rfc1991 signatures
tag: factor out sig detection for tag display
tag: factor out sig detection for body edits
verify-tag: factor out signature detection
t/t7004-tag: test handling of rfc1991 signatures

Merge branch 'jh/notes-merge'Junio C Hamano Wed, 8 Dec 2010 19:24:12 +0000 (11:24 -0800)

Merge branch 'jh/notes-merge'

* jh/notes-merge: (23 commits)
Provide 'git merge --abort' as a synonym to 'git reset --merge'
cmd_merge(): Parse options before checking MERGE_HEAD
Provide 'git notes get-ref' to easily retrieve current notes ref
git notes merge: Add testcases for merging notes trees at different fanouts
git notes merge: Add another auto-resolving strategy: "cat_sort_uniq"
git notes merge: --commit should fail if underlying notes ref has moved
git notes merge: List conflicting notes in notes merge commit message
git notes merge: Manual conflict resolution, part 2/2
git notes merge: Manual conflict resolution, part 1/2
Documentation: Preliminary docs on 'git notes merge'
git notes merge: Add automatic conflict resolvers (ours, theirs, union)
git notes merge: Handle real, non-conflicting notes merges
builtin/notes.c: Refactor creation of notes commits.
git notes merge: Initial implementation handling trivial merges only
builtin/notes.c: Split notes ref DWIMmery into a separate function
notes.c: Use two newlines (instead of one) when concatenating notes
(trivial) t3303: Indent with tabs instead of spaces for consistency
notes.h/c: Propagate combine_notes_fn return value to add_note() and beyond
notes.h/c: Allow combine_notes functions to remove notes
notes.c: Reorder functions in preparation for next commit
...

Conflicts:
builtin.h

Merge branch 'jk/diff-CBM'Junio C Hamano Wed, 8 Dec 2010 19:24:11 +0000 (11:24 -0800)

Merge branch 'jk/diff-CBM'

* jk/diff-CBM:
diff: report bogus input to -C/-M/-B

Merge branch 'maint'Junio C Hamano Wed, 8 Dec 2010 00:13:43 +0000 (16:13 -0800)

Merge branch 'maint'

* maint:
git-rm.txt: Fix quoting

vcs-svn: fix intermittent repo_tree corruptionJonathan Nieder Sun, 5 Dec 2010 09:32:53 +0000 (03:32 -0600)

vcs-svn: fix intermittent repo_tree corruption

Pointers to directory entries do not remain valid after a call to
dent_insert.

Noticed in the course of importing a small Subversion repository
(~1000 revs); after setting up a dirent for a certain path as a
placeholder, by luck dent_insert would trigger a realloc that
shifted around addresses, resulting in an import with that file
replaced by a directory.

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

treap: make treap_insert return inserted nodeJonathan Nieder Sun, 5 Dec 2010 09:35:17 +0000 (03:35 -0600)

treap: make treap_insert return inserted node

Suppose I try the following:

struct int_node *node = node_pointer(node_alloc(1));
node->n = 5;
treap_insert(&root, node);
printf("%d\n", node->n);

Usually the result will be 5. But since treap_insert draws memory
from the node pool, if the caller is unlucky then (1) the node pool
will be full and (2) realloc will be forced to move the node pool to
find room, so the node address becomes invalid and the result of
dereferencing it is undefined.

So we ought to use offsets in preference to pointers for references
that would remain valid after a call to treap_insert. Tweak the
signature to hint at a certain special case: since the inserted node
can change address (though not offset), as a convenience teach
treap_insert to return its new address.

So the motivational example could be fixed by adding "node =".

struct int_node *node = node_pointer(node_alloc(1));
node->n = 5;
node = treap_insert(&root, node);
printf("%d\n", node->n);

Based on a true story.

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

get_sha1: support relative path ":path" syntaxNguyễn Thái Ngọc Duy Sun, 28 Nov 2010 03:37:32 +0000 (10:37 +0700)

get_sha1: support relative path ":path" syntax

Currently :path and ref:path can be used to refer to a specific object
in index or ref respectively. "path" component is absolute path. This
patch allows "path" to be written as "./path" or "../path", which is
relative to user's original cwd.

This does not work in commands for which startup_info is NULL
(i.e. non-builtin ones, it seems none of them needs this anyway).

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

Make prefix_path() return char* without constNguyễn Thái Ngọc Duy Thu, 11 Nov 2010 14:08:03 +0000 (21:08 +0700)

Make prefix_path() return char* without const

prefix_path() allocates new buffer. There's no reason for it to keep
the buffer for itself and waste memory.

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

update-index: migrate to parse-options APIJonathan Nieder Wed, 1 Dec 2010 23:34:06 +0000 (17:34 -0600)

update-index: migrate to parse-options API

--refresh and --really-refresh accept flags (like -q) and modify
an error indicator. It might make sense to make the error
indicator global, but just pass the flags and a pointer to the error
indicator in a struct instead.

--cacheinfo wants 3 arguments. Use the OPTION_LOWLEVEL_CALLBACK
extension to grab them and PARSE_OPT_NOARG to disallow the "sticked"
--cacheinfo=foo form. (The resulting message

$ git update-index --cacheinfo=foo
error: option `cacheinfo' takes no value

is unfortunately incorrect.)

--assume-unchanged and --no-assume-unchanged probably should use the
OPT_UYN feature; but use a callback for now so the existing MARK_FLAG
and UNMARK_FLAG values can be used.

--stdin and --index-info are still constrained to be the last argument
(implemented using the OPTION_LOWLEVEL_CALLBACK extension).

--unresolve and --again consume all arguments that come after them
(also using OPTION_LOWLEVEL_CALLBACK).

The order of options matters. Each path on the command line is
affected only by the options that come before it. A custom
argument-parsing loop with parse_options_step() brings that about.

In exchange for all the fuss, we get the usual perks: support for
un-sticked options, better usage error messages, more useful -h
output, and argument parsing code that should be easier to tweak
in the future.

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

setup: save prefix (original cwd relative to toplevel... Nguyễn Thái Ngọc Duy Wed, 1 Dec 2010 23:33:22 +0000 (17:33 -0600)

setup: save prefix (original cwd relative to toplevel) in startup_info

Save the path from the original cwd to the cwd at the end of the
setup procedure in the startup_info struct introduced in e37c1329
(2010-08-05). The value cannot vary from thread to thread anyway,
since the cwd is global.

So now in your builtin command, instead of passing prefix around,
when you want to convert a user-supplied path to a cwd-relative
path, you can use startup_info->prefix directly.

Caveat: As with the return value from setup_git_directory_gently(),
startup_info->prefix would be NULL when the original cwd is not a
subdir of the toplevel.

Longer term, this would allow the prefix to be reused when several
noncooperating functions require access to the same repository (for
example, when accessing configuration before running a builtin).

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

parse-options: make resuming easier after PARSE_OPT_STO... Jonathan Nieder Wed, 1 Dec 2010 23:32:55 +0000 (17:32 -0600)

parse-options: make resuming easier after PARSE_OPT_STOP_AT_NON_OPTION

Introduce a PARSE_OPT_NON_OPTION state, so parse_option_step()
callers can easily distinguish between non-options and other
reasons for option parsing termination (like "--").

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

parse-options: allow git commands to invent new option... Jonathan Nieder Wed, 1 Dec 2010 23:32:16 +0000 (17:32 -0600)

parse-options: allow git commands to invent new option types

parse-options provides a variety of option behaviors, including
OPTION_CALLBACK, which should take care of just about any sane
behavior. All supported behaviors obey the following constraint:

A --foo option can only accept (and base its behavior on)
one argument, which would be the following command-line
argument in the "unsticked" form.

Alas, some existing git commands have options that do not obey that
constraint. For example, update-index --cacheinfo takes three
arguments, and update-index --resolve takes all later parameters as
arguments.

Introduces an OPTION_LOWLEVEL_CALLBACK backdoor to parse-options so
such option types can be supported without tempting inventors of other
commands through mention in the public API. Commands can set the
callback field to a function accepting three arguments: the option
parsing context, the option itself, and a flag indicating whether the
the option was negated. When the option is encountered, that function
is called to take over from get_value(). The return value should be
zero for success, -1 for usage errors.

Thanks to Stephen Boyd for API guidance.

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

parse-options: never suppress arghelp if LITERAL_ARGHEL... Jonathan Nieder Wed, 1 Dec 2010 23:31:36 +0000 (17:31 -0600)

parse-options: never suppress arghelp if LITERAL_ARGHELP is set

The PARSE_OPT_LITERAL_ARGHELP flag allows a program to override the
standard "<argument> for mandatory, [argument] for optional" markup in
its help message. Extend it to override the usual "no text for
disallowed", too (for the PARSE_OPT_NOARG | PARSE_OPT_LITERAL_ARGHELP
case, which was previously meaningless), to be more intuitive.

The motivation is to allow update-index to correctly advertise

--cacheinfo <mode> <object> <path>
add the specified entry to the index

while abusing PARSE_OPT_NOARG to disallow the "sticked form"

--cacheinfo=<mode> <object> <path>

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

parse-options: do not infer PARSE_OPT_NOARG from option... Stephen Boyd Wed, 1 Dec 2010 23:30:40 +0000 (17:30 -0600)

parse-options: do not infer PARSE_OPT_NOARG from option type

Simplify the "takes no value" error path by relying on PARSE_OPT_NOARG
being set correctly. That is:

- if the PARSE_OPT_NOARG flag is set, reject --opt=value
regardless of the option type;
- if the PARSE_OPT_NOARG flag is unset, accept --opt=value
regardless of the option type.

This way, the accepted usage more closely matches the usage advertised
with --help-all.

No functional change intended, since the NOARG flag is only used
with "boolean-only" option types in existing parse_options callers.

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

parse-options: sanity check PARSE_OPT_NOARG flagJonathan Nieder Thu, 2 Dec 2010 06:08:57 +0000 (00:08 -0600)

parse-options: sanity check PARSE_OPT_NOARG flag

Some option types cannot use an argument --- boolean options that
would set a bit or flag or increment a counter, for example. If
configured in the flag word to accept an argument anyway, the result
is an argument that is advertised in "program -h" output only to be
rejected by parse-options::get_value.

Luckily all current users of these option types use PARSE_OPT_NOARG
and do not use PARSE_OPT_OPTARG. Add a check to ensure that that
remains true. The check is run once for each invocation of
parse_option_start().

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

parse-options: move NODASH sanity checks to parse_optio... Jonathan Nieder Thu, 2 Dec 2010 06:05:05 +0000 (00:05 -0600)

parse-options: move NODASH sanity checks to parse_options_check

A dashless switch (like '(' passed to 'git grep') cannot be negated,
cannot be attached to an argument, and cannot have a long form.
Currently parse-options runs the related sanity checks when the
dashless option is used; better to always check them at the start of
option parsing, so mistakes can be caught more quickly.

The error message at the new call site is less specific about the
nature of the error, for simplicity. On the other hand, it prints
which switch was problematic. Before:

fatal: BUG: dashless options can't be long

After:

error: BUG: switch '(' uses feature not supported for dashless options

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

parse-options: clearer reporting of API misuseJonathan Nieder Thu, 2 Dec 2010 06:01:18 +0000 (00:01 -0600)

parse-options: clearer reporting of API misuse

The PARSE_OPT_LASTARG_DEFAULT flag is meant for options like
--contains that (1) traditionally had a mandatory argument and
(2) have some better behavior to use when appearing in the final
position. It makes no sense to combine this with OPTARG, so ever
since v1.6.4-rc0~71 (parse-options: add parse_options_check to
validate option specs, 2009-07-09) this mistake is flagged with

error: `--option` uses incompatible flags LASTARG_DEFAULT and OPTARG

and an exit status representing an error in commandline usage.

Unfortunately that which might confuse scripters calling such an
erroneous program into thinking the _script_ contains an error.
Clarify that it is an internal error by dying with a message beginning
"error: BUG: ..." and status 128.

While at it, clean up parse_options_check to prepare for more checks.

Long term, it would be nicer to make such checks happen at compile
time.

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

git-rm.txt: Fix quotingMichael J Gruber Tue, 7 Dec 2010 09:07:11 +0000 (10:07 +0100)

git-rm.txt: Fix quoting

Literal " produces typographically incorrect quotations, but "works" in
most circumstances. In the subheadings of git-rm.txt, it "works" for the
html backend but not for the docbook conversion to nroff: double "" and
spurious double spaces appear in the output.

Replace "incorrect" quotations by ``correct'' ones, and fix other
"quotations" which are really `code fragments`.

This should make git-rm.txt "-clean.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: dependencies for vcs-svn testsJonathan Nieder Sun, 10 Oct 2010 05:50:32 +0000 (00:50 -0500)

Makefile: dependencies for vcs-svn tests

The vcs-svn tests (test-treap.o et al) depend on the vcs-svn
headers for declarations and inline functions. Declare the
dependency. While at it, declare a dependency of the vcs-svn
objects (vcs-svn/string_pool.o et al) on $(LIB_H) to reflect use
within the vcs-svn library of git-compat-util.h and cache.h.

Without this change, tweaks to inline functions in those headers
do not provoke rebuilds of the corresponding tests[*], making
such changes unnecessarily difficult to test.

Before:

$ touch vcs-svn/*.h && make test-treap
$

After:

$ touch vcs-svn/*.h && make test-treap
CC test-treap.o
LINK test-treap
$

[*] unless COMPUTE_HEADER_DEPENDENCIES is enabled

Detected with "make CHECK_HEADER_DEPENDENCIES=1".

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

parse-remote: handle detached HEADSanti Béjar Mon, 6 Dec 2010 10:20:11 +0000 (11:20 +0100)

parse-remote: handle detached HEAD

get_remote_merge_branch with zero or one arguments returns the
upstream branch. But a detached HEAD does no have an upstream branch,
as it is not tracking anything. Handle this case testing the exit code
of "git symbolic-ref -q HEAD".

Reported-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Santi Béjar <santi@agolina.net>
Tested-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse-options: Don't call parse_options_check() so... Stephen Boyd Mon, 6 Dec 2010 07:57:42 +0000 (23:57 -0800)

parse-options: Don't call parse_options_check() so much

parse_options_check() is being called for each invocation of
parse_options_step which can be quite a bit for some commands. The
commit introducing this function cb9d398 (parse-options: add
parse_options_check to validate option specs., 2009-06-09) had the
correct motivation and explicitly states that parse_options_check()
should be called from parse_options_start(). However, the implementation
differs from the motivation. Fix it.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git submodule: Remove now obsolete tests before cloning... Jens Lehmann Sat, 4 Dec 2010 23:27:35 +0000 (00:27 +0100)

git submodule: Remove now obsolete tests before cloning a repo

Since 55892d23 "git clone" itself checks that the destination path is not
a file but an empty directory if it exists, so there is no need anymore
for module_clone() to check that too.

Two tests have been added to test the behavior of "git submodule add" when
path is a file or a directory (A subshell had to be added to the former
last test to stay in the right directory).

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git submodule -b ... of current HEAD failsJonathan Nieder Wed, 1 Dec 2010 18:50:46 +0000 (12:50 -0600)

git submodule -b ... of current HEAD fails

git submodule add -b $branch $repository

fails when HEAD already points to $branch in $repository.

Reported-by: Klaus Ethgen <Klaus@Ethgen.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9119: do not compare "Text Last Updated" line from... Junio C Hamano Tue, 7 Dec 2010 00:00:02 +0000 (16:00 -0800)

t9119: do not compare "Text Last Updated" line from "svn info"

On the "Text Last Updated" line, "git svn info <file>" does not give the
timestamp of the commit that touched the path most recently, unlike "svn
info <file>". Do not expect the output from two commands to match on
these lines.

There was a "ptouch" attempt to transplant the timestamp from svn working
tree files to corresponding git working tree files, which mostly hid this
difference, but is made pointless now with this change. Remove the helper
function and calls to it.

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

help: always suggest common-cmds if prefix of cmdErik Faye-Lund Fri, 26 Nov 2010 16:00:39 +0000 (17:00 +0100)

help: always suggest common-cmds if prefix of cmd

If someone runs "git st", the command "git status" is not suggested
because it's not one of the closest levenshtein-neighbour.

Reserve the distance of 0 for common commands where the entered command
is a prefixe, as these are often more likely to be what the user meant.

This way, "git status" is the first suggestion, while a list of possible
typos are still suggested as well.

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

Merge branch 'jn/ignore-doc'Junio C Hamano Sat, 4 Dec 2010 00:13:06 +0000 (16:13 -0800)

Merge branch 'jn/ignore-doc'

* jn/ignore-doc:
Documentation: point to related commands from gitignore
Documentation: split gitignore page into sections

Merge branch 'kb/maint-status-cquote'Junio C Hamano Sat, 4 Dec 2010 00:13:06 +0000 (16:13 -0800)

Merge branch 'kb/maint-status-cquote'

* kb/maint-status-cquote:
status: Quote paths with spaces in short format

Merge branch 'jn/thinner-wrapper'Junio C Hamano Sat, 4 Dec 2010 00:13:06 +0000 (16:13 -0800)

Merge branch 'jn/thinner-wrapper'

* jn/thinner-wrapper:
Remove pack file handling dependency from wrapper.o
pack-objects: mark file-local variable static
wrapper: give zlib wrappers their own translation unit
strbuf: move strbuf_branchname to sha1_name.c
path helpers: move git_mkstemp* to wrapper.c
wrapper: move odb_* to environment.c
wrapper: move xmmap() to sha1_file.c

Merge branch 'pn/commit-autosquash'Junio C Hamano Sat, 4 Dec 2010 00:13:06 +0000 (16:13 -0800)

Merge branch 'pn/commit-autosquash'

* pn/commit-autosquash:
add tests of commit --squash
commit: --squash option for use with rebase --autosquash
add tests of commit --fixup
commit: --fixup option for use with rebase --autosquash
pretty.c: teach format_commit_message() to reencode the output
commit: helper methods to reduce redundant blocks of code

Conflicts:
Documentation/git-commit.txt
t/t3415-rebase-autosquash.sh

Merge branch 'sn/diff-doc'Junio C Hamano Sat, 4 Dec 2010 00:10:36 +0000 (16:10 -0800)

Merge branch 'sn/diff-doc'

* sn/diff-doc:
docs: clarify git diff modes of operation
diff,difftool: Don't use the {0,2} notation in usage strings
CodingGuidelines: Add a section on writing documentation

Merge branch 'sp/emfile'Junio C Hamano Sat, 4 Dec 2010 00:10:35 +0000 (16:10 -0800)

Merge branch 'sp/emfile'

* sp/emfile:
Work around EMFILE when there are too many pack files
Use git_open_noatime when accessing pack data

Merge branch 'jc/abbrev-guard'Junio C Hamano Sat, 4 Dec 2010 00:10:35 +0000 (16:10 -0800)

Merge branch 'jc/abbrev-guard'

* jc/abbrev-guard:
core.abbrevguard: Ensure short object names stay unique a bit longer

Merge branch 'jj/icase-directory'Junio C Hamano Sat, 4 Dec 2010 00:10:34 +0000 (16:10 -0800)

Merge branch 'jj/icase-directory'

* jj/icase-directory:
Support case folding in git fast-import when core.ignorecase=true
Support case folding for git add when core.ignorecase=true
Add case insensitivity support when using git ls-files
Add case insensitivity support for directories when using git status
Case insensitivity support for .gitignore via core.ignorecase
Add string comparison functions that respect the ignore_case variable.
Makefile & configure: add a NO_FNMATCH_CASEFOLD flag
Makefile & configure: add a NO_FNMATCH flag

Conflicts:
Makefile
config.mak.in
configure.ac
fast-import.c

Merge branch 'maint' to sync with Git 1.7.3.3Junio C Hamano Fri, 3 Dec 2010 23:23:50 +0000 (15:23 -0800)

Merge branch 'maint' to sync with Git 1.7.3.3

* maint:
Git 1.7.3.3
CodingGuidelines: mention whitespace preferences for shell scripts
Documentation: do not misinterpret pull refspec as bold text

Conflicts:
Documentation/git-pull.txt
RelNotes

Git 1.7.3.3 v1.7.3.3Junio C Hamano Fri, 3 Dec 2010 23:18:06 +0000 (15:18 -0800)

Git 1.7.3.3

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

CodingGuidelines: mention whitespace preferences for... Giuseppe Bilotta Fri, 3 Dec 2010 16:47:35 +0000 (17:47 +0100)

CodingGuidelines: mention whitespace preferences for shell scripts

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: do not misinterpret pull refspec as... Jonathan Nieder Fri, 3 Dec 2010 20:04:17 +0000 (14:04 -0600)

Documentation: do not misinterpret pull refspec as bold text

Use the {asterisk} entity to avoid mistreating the asterisks
in "(e.g., refs/heads/*:refs/remotes/origin/*)" as delimiters
for bold text.

From a quick search with 'git grep -e "\*.*\*"', this seems to
be the last example of this particular formatting problem.

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

web--browse: better support for chromiumGiuseppe Bilotta Fri, 3 Dec 2010 16:47:39 +0000 (17:47 +0100)

web--browse: better support for chromium

On Debian-based distributions, Chromium the browser is available under
the name chromium-browser rather than chromium, to prevent conflicts
with the Chromium B.S.U. game.

Look for chromium-browser first when setting the path for chromium, and
also add chromium-browser as a supported browser name. Document the
dual-name support, and mention the dual-name support for
(google-)chrome too.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

web--browse: support opera, seamonkey and elinksGiuseppe Bilotta Fri, 3 Dec 2010 16:47:38 +0000 (17:47 +0100)

web--browse: support opera, seamonkey and elinks

The list of supported browsers is also updated in the documentation.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

web--browse: split valid_tool listGiuseppe Bilotta Fri, 3 Dec 2010 16:47:37 +0000 (17:47 +0100)

web--browse: split valid_tool list

It was getting too long, and we want to add some more.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

web--browse: coding styleGiuseppe Bilotta Fri, 3 Dec 2010 16:47:36 +0000 (17:47 +0100)

web--browse: coding style

Retab and deindent choices in case statements.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9300: remove unnecessary use of /dev/stdinJunio C Hamano Fri, 3 Dec 2010 20:28:00 +0000 (12:28 -0800)

t9300: remove unnecessary use of /dev/stdin

We really shouldn't be using these funny /dev/* files that did not exist
in V7 UNIX in our tests when we do not have to.

Output from

$ git grep -n -e /dev/ --and --not -e /dev/null t/

tells us that, aside from use of /dev/urandom in apache.conf used in http
tests, "dd if=/dev/stdin" added recently to t/t9300-fast-import.sh are the
only offenders, and "dd" reads from the standard input by default, so
removing them should be straightforward.

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

git-pull.txt: Mention branch.autosetuprebaseJari Aalto Fri, 3 Dec 2010 08:20:54 +0000 (10:20 +0200)

git-pull.txt: Mention branch.autosetuprebase

In "Options related to merging" mention also related option
branch.autosetuprebase in git-config(1).

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.4Junio C Hamano Thu, 2 Dec 2010 22:33:26 +0000 (14:33 -0800)

Update draft release notes to 1.7.4

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

Merge branch 'maint'Junio C Hamano Thu, 2 Dec 2010 22:32:52 +0000 (14:32 -0800)

Merge branch 'maint'

* maint:
Git 1.7.0.8
Documentation: Fix mark-up of lines with more than one tilde

Conflicts:
GIT-VERSION-GEN

Prepare for 1.7.3.3Junio C Hamano Thu, 2 Dec 2010 20:24:42 +0000 (12:24 -0800)

Prepare for 1.7.3.3

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

Git 1.7.2.4 v1.7.2.4Junio C Hamano Thu, 2 Dec 2010 22:28:01 +0000 (14:28 -0800)

Git 1.7.2.4

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

Git 1.7.1.3 v1.7.1.3Junio C Hamano Thu, 2 Dec 2010 20:18:49 +0000 (12:18 -0800)

Git 1.7.1.3

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

Git 1.7.0.8 v1.7.0.8Junio C Hamano Thu, 2 Dec 2010 20:06:06 +0000 (12:06 -0800)

Git 1.7.0.8

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

Documentation: Fix mark-up of lines with more than... Junio C Hamano Thu, 2 Dec 2010 19:23:50 +0000 (11:23 -0800)

Documentation: Fix mark-up of lines with more than one tilde

The manual pages of cherry-pick and revert had examples with two revisions
on the same line in the examples section, that looked like this:

git cherry-pick master~4 master~2::

Unfortunately, this is taken as a mark-up to make the part between two
tildes, "4 master", subscript. Use {tilde} to make it explicit that we
do want ~ characters in these places (backslash does not help).

Reported-by: Sylvain Rabot <sylvain.rabot@f-secure.com>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'cb/maint-orphan-merge-noclobber' into... Junio C Hamano Thu, 2 Dec 2010 19:27:13 +0000 (11:27 -0800)

Merge branch 'cb/maint-orphan-merge-noclobber' into maint

* cb/maint-orphan-merge-noclobber:
do not overwrite untracked during merge from unborn branch

Merge branch 'jk/add-e-doc' into maintJunio C Hamano Thu, 2 Dec 2010 19:27:08 +0000 (11:27 -0800)

Merge branch 'jk/add-e-doc' into maint

* jk/add-e-doc:
docs: give more hints about how "add -e" works
docs: give more hints about how "add -e" works

Merge branch 'bg/maint-gitweb-test-lib' into maintJunio C Hamano Thu, 2 Dec 2010 19:26:49 +0000 (11:26 -0800)

Merge branch 'bg/maint-gitweb-test-lib' into maint

* bg/maint-gitweb-test-lib:
t/gitweb-lib: Don't pass constant to decode_utf8

Merge branch 'tr/maint-merge-file-subdir' into maintJunio C Hamano Thu, 2 Dec 2010 19:26:40 +0000 (11:26 -0800)

Merge branch 'tr/maint-merge-file-subdir' into maint

* tr/maint-merge-file-subdir:
merge-file: correctly find files when called in subdir
prefix_filename(): safely handle the case where pfx_len=0

Merge branch 'ks/no-textconv-symlink' into maintJunio C Hamano Thu, 2 Dec 2010 19:26:24 +0000 (11:26 -0800)

Merge branch 'ks/no-textconv-symlink' into maint

* ks/no-textconv-symlink:
blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''
blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinks
blame,cat-file: Prepare --textconv tests for correctly-failing conversion program

Merge branch 'bc/fortran-userdiff' into maintJunio C Hamano Thu, 2 Dec 2010 19:25:36 +0000 (11:25 -0800)

Merge branch 'bc/fortran-userdiff' into maint

* bc/fortran-userdiff:
userdiff.c: add builtin fortran regex patterns

Merge branch 'maint'Junio C Hamano Thu, 2 Dec 2010 00:41:13 +0000 (16:41 -0800)

Merge branch 'maint'

* maint:
add: introduce add.ignoreerrors synonym for add.ignore-errors
bash: Match lightweight tags in prompt
git-commit.txt: (synopsis): move -i and -o before "--"

Merge branch 'maint-1.7.2' into maintJunio C Hamano Thu, 2 Dec 2010 00:40:26 +0000 (16:40 -0800)

Merge branch 'maint-1.7.2' into maint

* maint-1.7.2:
add: introduce add.ignoreerrors synonym for add.ignore-errors
bash: Match lightweight tags in prompt
git-commit.txt: (synopsis): move -i and -o before "--"

Merge branch 'maint-1.7.1' into maint-1.7.2Junio C Hamano Thu, 2 Dec 2010 00:40:20 +0000 (16:40 -0800)

Merge branch 'maint-1.7.1' into maint-1.7.2

* maint-1.7.1:
add: introduce add.ignoreerrors synonym for add.ignore-errors

Merge branch 'maint-1.7.0' into maint-1.7.1Junio C Hamano Thu, 2 Dec 2010 00:37:34 +0000 (16:37 -0800)

Merge branch 'maint-1.7.0' into maint-1.7.1

* maint-1.7.0:
add: introduce add.ignoreerrors synonym for add.ignore-errors

Make the tab width used for whitespace checks configurableJohannes Sixt Tue, 30 Nov 2010 08:29:11 +0000 (09:29 +0100)

Make the tab width used for whitespace checks configurable

A new whitespace "rule" is added that sets the tab width to use for
whitespace checks and fix-ups and replaces the hard-coded constant 8.

Since the setting is part of the rules, it can be set per file using
.gitattributes.

The new configuration is backwards compatible because older git versions
simply ignore unknown whitespace rules.

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

Merge branch 'js/maint-apply-tab-in-indent-fix' into... Junio C Hamano Wed, 1 Dec 2010 22:42:00 +0000 (14:42 -0800)

Merge branch 'js/maint-apply-tab-in-indent-fix' into HEAD

* js/maint-apply-tab-in-indent-fix:
apply --whitespace=fix: fix tab-in-indent

apply --whitespace=fix: fix tab-in-indentJohannes Sixt Tue, 30 Nov 2010 08:22:04 +0000 (09:22 +0100)

apply --whitespace=fix: fix tab-in-indent

When the whitespace rule tab-in-indent is enabled, apply --whitespace=fix
replaces tabs by the appropriate amount of blanks. The code used
"dst->len % 8" as the criterion to stop adding blanks. But it forgot that
dst holds more than just the current line. Consequently, the modulus was
computed correctly only for the first added line, but not for the second
and subsequent lines. Fix it.

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

add: introduce add.ignoreerrors synonym for add.ignore... Jonathan Nieder Wed, 1 Dec 2010 18:36:15 +0000 (12:36 -0600)

add: introduce add.ignoreerrors synonym for add.ignore-errors

The "[add] ignore-errors" tweakable introduced by v1.5.6-rc0~30^2 (Add
a config option to ignore errors for git-add, 2008-05-12) does not
follow the usual convention for naming values in the git configuration
file.

What convention? Glad you asked.

The section name indicates the affected subsystem.

The subsection name, if any, indicates which of
an unbound set of things to set the value for.

The variable name describes the effect of tweaking
this knob.

The section and variable names can be broken into
words using bumpyCaps in documentation as a hint to
the reader. These word breaks are not significant
at the level of code, since the section and variable
names are not case sensitive.

The name "add.ignore-errors" includes a dash, meaning a naive
configuration file like

[add]
ignoreErrors

does not have any effect. Avoid such confusion by renaming to the
more consistent add.ignoreErrors, but keep the old version for
backwards compatibility.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: Allow cat-blob requests at arbitrary point... Jonathan Nieder Sun, 28 Nov 2010 19:45:58 +0000 (13:45 -0600)

fast-import: Allow cat-blob requests at arbitrary points in stream

The new rule: a "cat-blob" can be inserted wherever a comment is
allowed, which means at the start of any line except in the middle of
a "data" command.

This saves frontends from having to loop over everything they want to
commit in the next commit and cat-ing the necessary objects in
advance.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: let importers retrieve blobsDavid Barr Sun, 28 Nov 2010 19:45:01 +0000 (13:45 -0600)

fast-import: let importers retrieve blobs

New objects written by fast-import are not available immediately.
Until a checkpoint has been started and finishes writing the pack
index, any new blobs will not be accessible using standard git tools.

So introduce a new way to access them: a "cat-blob" command in the
command stream requests for fast-import to print a blob to stdout or a
file descriptor specified by the argument to --cat-blob-fd. The value
for cat-blob-fd cannot be specified in the stream because that would
be a layering violation: the decision of where to direct a stream has
to be made when fast-import is started anyway, so we might as well
make the stream format is independent of that detail.

Output uses the same format as "git cat-file --batch".

Thanks to Sverre Rabbelier and Sam Vilain for guidance in designing
the protocol.

Based-on-patch-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Acked-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: clarify documentation of "feature" commandJonathan Nieder Sun, 28 Nov 2010 19:43:57 +0000 (13:43 -0600)

fast-import: clarify documentation of "feature" command

The "feature" command allows streams to specify options for the import
that must not be ignored. Logically, they are part of the stream,
even though technically most supported features are synonyms to
command-line options.

Make this more obvious by being more explicit about how the analogy
between most "feature" commands and command-line options works. Treat
the feature (import-marks) that does not fit this analogy separately.

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

fast-import: stricter parsing of integer optionsJonathan Nieder Sun, 28 Nov 2010 19:42:46 +0000 (13:42 -0600)

fast-import: stricter parsing of integer options

Check the result from strtoul to avoid accepting arguments like
--depth=-1 and --active-branches=foo,bar,baz.

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

commit.c: Remove backward goto in read_craft_line()Ralf Thielow Wed, 1 Dec 2010 19:15:59 +0000 (20:15 +0100)

commit.c: Remove backward goto in read_craft_line()

Bad graft data is noticed in several places in read_graft_line(), and in
each case we go back to the first site of detection. It in general is a
better style to have an exception handling out of line from the main
codepath and make error codepath jump forward.

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash: Match lightweight tags in promptknittl Wed, 1 Dec 2010 13:17:00 +0000 (14:17 +0100)

bash: Match lightweight tags in prompt

The bash prompt would display a commit's object name when having checked
out a lightweight tag. Provide `--tags` to `git describe` in the completion
script, so it will display lightweight tag names, as it already does for
annotated tags.

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-commit.txt: (synopsis): move -i and -o before "--"Jari Aalto Wed, 1 Dec 2010 14:51:25 +0000 (16:51 +0200)

git-commit.txt: (synopsis): move -i and -o before "--"

All options, including -i and -o, must come before "--" which is the
end of options marker.

Reported-by: Joey Hess <joey@kitenet.net>
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "excluded_1(): support exclude files in index"Nguyễn Thái Ngọc Duy Fri, 26 Nov 2010 18:17:47 +0000 (01:17 +0700)

Revert "excluded_1(): support exclude files in index"

This reverts commit c84de70781674a35b9bfd20aa5bc8c47582615df.
The commit provided a workaround for matching directories in
index. But it is no longer needed.

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

unpack-trees: fix sparse checkout's "unable to match... Nguyễn Thái Ngọc Duy Fri, 26 Nov 2010 18:17:46 +0000 (01:17 +0700)

unpack-trees: fix sparse checkout's "unable to match directories"

Matching index entries against an excludes file currently has two
problems.

First, there's no function to do it. Code paths (like sparse
checkout) that wanted to try it would iterate over index entries and
for each index entry pass that path to excluded_from_list(). But that
is not how excluded_from_list() works; one is supposed to feed in each
ancester of a path before a given path to find out if it was excluded
because of some parent or grandparent matching a

bigsubdirectory/

pattern despite the path not matching any .gitignore pattern directly.

Second, it's inefficient. The excludes mechanism is supposed to let
us block off vast swaths of the filesystem as uninteresting; separately
checking every index entry doesn't fit that model.

Introduce a new function to take care of both these problems. This
traverses the index in depth-first order (well, that's what order the
index is in) to mark un-excluded entries.

Maybe some day the in-core index format will be restructured to make
this sort of operation easier. Or maybe we will want to try some
binary search based thing. The interface is simple enough to allow
all those things. Example:

clear_ce_flags(the_index.cache, the_index.cache_nr,
CE_CANDIDATE, CE_CLEARME, exclude_list);

would clear the CE_CLEARME flag on all index entries with
CE_CANDIDATE flag and not matched by exclude_list.

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

Merge branch 'cb/leading-path-removal'Junio C Hamano Tue, 30 Nov 2010 01:52:36 +0000 (17:52 -0800)

Merge branch 'cb/leading-path-removal'

* cb/leading-path-removal:
use persistent memory for rejected paths
do not overwrite files in leading path
lstat_cache: optionally return match_len
add function check_ok_to_remove()
t7607: add leading-path tests
t7607: use test-lib functions and check MERGE_HEAD

Conflicts:
t/t7607-merge-overwrite.sh

Merge branch 'en/merge-recursive'Junio C Hamano Tue, 30 Nov 2010 01:52:35 +0000 (17:52 -0800)

Merge branch 'en/merge-recursive'

* en/merge-recursive: (41 commits)
t6022: Use -eq not = to test output of wc -l
merge-recursive:make_room_for_directories - work around dumb compilers
merge-recursive: Remove redundant path clearing for D/F conflicts
merge-recursive: Make room for directories in D/F conflicts
handle_delete_modify(): Check whether D/F conflicts are still present
merge_content(): Check whether D/F conflicts are still present
conflict_rename_rename_1to2(): Fix checks for presence of D/F conflicts
conflict_rename_delete(): Check whether D/F conflicts are still present
merge-recursive: Delay modify/delete conflicts if D/F conflict present
merge-recursive: Delay content merging for renames
merge-recursive: Delay handling of rename/delete conflicts
merge-recursive: Move handling of double rename of one file to other file
merge-recursive: Move handling of double rename of one file to two
merge-recursive: Avoid doubly merging rename/add conflict contents
merge-recursive: Update merge_content() call signature
merge-recursive: Update conflict_rename_rename_1to2() call signature
merge-recursive: Structure process_df_entry() to handle more cases
merge-recursive: Have process_entry() skip D/F or rename entries
merge-recursive: New function to assist resolving renames in-core only
merge-recursive: New data structures for deferring of D/F conflicts
...

Conflicts:
t/t6020-merge-df.sh
t/t6036-recursive-corner-cases.sh

Merge branch 'jl/clone-recurse-sm-synonym'Junio C Hamano Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)

Merge branch 'jl/clone-recurse-sm-synonym'

* jl/clone-recurse-sm-synonym:
clone: Add the --recurse-submodules option as alias for --recursive

Merge branch 'jn/cherry-pick-refresh-index'Junio C Hamano Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)

Merge branch 'jn/cherry-pick-refresh-index'

* jn/cherry-pick-refresh-index:
cherry-pick/revert: transparently refresh index

Merge branch 'jc/emfile'Junio C Hamano Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)

Merge branch 'jc/emfile'

* jc/emfile:
A loose object is not corrupt if it cannot be read due to EMFILE
read_sha1_file(): report correct name of packfile with a corrupt object