gitweb.git
upload-pack: avoid parsing tag destinationsJeff King Fri, 6 Jan 2012 19:18:01 +0000 (14:18 -0500)

upload-pack: avoid parsing tag destinations

When upload-pack advertises refs, it dereferences any tags
it sees, and shows the resulting sha1 to the client. It does
this by calling deref_tag. That function must load and parse
each tag object to find the sha1 of the tagged object.
However, it also ends up parsing the tagged object itself,
which is not strictly necessary for upload-pack's use.

Each tag produces two object loads (assuming it is not a
recursive tag), when it could get away with only a single
one. Dropping the second load halves the effort we spend.

The downside is that we are no longer verifying the
resulting object by loading it. In particular:

1. We never cross-check the "type" field given in the tag
object with the type of the pointed-to object. If the
tag says it points to a tag but doesn't, then we will
keep peeling and realize the error. If the tag says it
points to a non-tag but actually points to a tag, we
will stop peeling and just advertise the pointed-to
tag.

2. If we are missing the pointed-to object, we will not
realize (because we never even look it up in the object
db).

However, both of these are errors in the object database,
and both will be detected if a client actually requests the
broken objects in question. So we are simply pushing the
verification away from the advertising stage, and down to
the actual fetching stage.

On my test repo with 120K refs, this drops the time to
advertise the refs from ~3.2s to ~2.0s.

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

upload-pack: avoid parsing objects during ref advertisementJeff King Fri, 6 Jan 2012 19:17:40 +0000 (14:17 -0500)

upload-pack: avoid parsing objects during ref advertisement

When we advertise a ref, the first thing we do is parse the
pointed-to object. This gives us two things:

1. a "struct object" we can use to store flags

2. the type of the object, so we know whether we need to
dereference it as a tag

Instead, we can just use lookup_unknown_object to get an
object struct, and then fill in just the type field using
sha1_object_info (which, in the case of packed files, can
find the information without actually inflating the object
data).

This can save time if you have a large number of refs, and
the client isn't actually going to request those refs (e.g.,
because most of them are already up-to-date).

The downside is that we are no longer verifying objects that
we advertise by fully parsing them (however, we do still
know we actually have them, because sha1_object_info must
find them to get the type). While we might fail to detect a
corrupt object here, if the client actually fetches the
object, we will parse (and verify) it then.

On a repository with 120K refs, the advertisement portion of
upload-pack goes from ~3.4s to 3.2s (the failure to speed up
more is largely due to the fact that most of these refs are
tags, which need dereferenced to find the tag destination
anyway).

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

Git 1.7.9-rc0 v1.7.9-rc0Junio C Hamano Fri, 6 Jan 2012 20:48:17 +0000 (12:48 -0800)

Git 1.7.9-rc0

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

Merge branch 'jc/show-sig'Junio C Hamano Fri, 6 Jan 2012 20:44:07 +0000 (12:44 -0800)

Merge branch 'jc/show-sig'

* jc/show-sig:
log --show-signature: reword the common two-head merge case
log-tree: show mergetag in log --show-signature output
log-tree.c: small refactor in show_signature()
commit --amend -S: strip existing gpgsig headers
verify_signed_buffer: fix stale comment
gpg-interface: allow use of a custom GPG binary
pretty: %G[?GS] placeholders
test "commit -S" and "log --show-signature"
log: --show-signature
commit: teach --gpg-sign option

Conflicts:
builtin/commit-tree.c
builtin/commit.c
builtin/merge.c
notes-cache.c
pretty.c

Merge branch 'jm/stash-diff-disambiguate'Junio C Hamano Fri, 6 Jan 2012 20:44:03 +0000 (12:44 -0800)

Merge branch 'jm/stash-diff-disambiguate'

* jm/stash-diff-disambiguate:
stash: Don't fail if work dir contains file named 'HEAD'

Merge branch 'jh/fetch-head-update'Junio C Hamano Fri, 6 Jan 2012 20:44:01 +0000 (12:44 -0800)

Merge branch 'jh/fetch-head-update'

* jh/fetch-head-update:
write first for-merge ref to FETCH_HEAD first

Merge branch 'pw/p4-view-updates'Junio C Hamano Fri, 6 Jan 2012 20:43:59 +0000 (12:43 -0800)

Merge branch 'pw/p4-view-updates'

* pw/p4-view-updates:
git-p4: view spec documentation
git-p4: rewrite view handling
git-p4: support single file p4 client view maps
git-p4: sort client views by reverse View number
git-p4: fix test for unsupported P4 Client Views
git-p4: test client view handling

Sync with 1.7.8.3Junio C Hamano Fri, 6 Jan 2012 20:42:48 +0000 (12:42 -0800)

Sync with 1.7.8.3

Git 1.7.8.3 v1.7.8.3Junio C Hamano Fri, 6 Jan 2012 20:41:39 +0000 (12:41 -0800)

Git 1.7.8.3

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

Merge branch 'jn/maint-gitweb-utf8-fix' into maintJunio C Hamano Fri, 6 Jan 2012 20:36:43 +0000 (12:36 -0800)

Merge branch 'jn/maint-gitweb-utf8-fix' into maint

* jn/maint-gitweb-utf8-fix:
gitweb: Fix fallback mode of to_utf8 subroutine
gitweb: Output valid utf8 in git_blame_common('data')
gitweb: esc_html() site name for title in OPML
gitweb: Call to_utf8() on input string in chop_and_escape_str()

Merge branch 'maint-1.7.7' into maintJunio C Hamano Fri, 6 Jan 2012 20:35:12 +0000 (12:35 -0800)

Merge branch 'maint-1.7.7' into maint

* maint-1.7.7:
Documentation: rerere.enabled is the primary way to configure rerere

Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano Fri, 6 Jan 2012 20:35:05 +0000 (12:35 -0800)

Merge branch 'maint-1.7.6' into maint-1.7.7

* maint-1.7.6:
Documentation: rerere.enabled is the primary way to configure rerere

Documentation: rerere.enabled is the primary way to... Thomas Rast Fri, 6 Jan 2012 13:08:02 +0000 (14:08 +0100)

Documentation: rerere.enabled is the primary way to configure rerere

The wording seems to suggest that creating the directory is needed and the
setting of rerere.enabled is only for disabling the feature by setting it
to 'false'. But the configuration is meant to be the primary control and
setting it to 'true' will enable it; the rr-cache directory will be
created as necessary and the user does not have to create it.

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

write_head_info(): handle "extra refs" locallyMichael Haggerty Fri, 6 Jan 2012 14:12:33 +0000 (15:12 +0100)

write_head_info(): handle "extra refs" locally

The old code basically did:

generate array of SHA1s for alternate refs
for each unique SHA1 in array:
add_extra_ref(".have", sha1)
for each ref (including real refs and extra refs):
show_ref(refname, sha1)

But there is no need to stuff the alternate refs in extra_refs; we can
call show_ref() directly when iterating over the array, then handle
real refs separately. So change the code to:

generate array of SHA1s for alternate refs
for each unique SHA1 in array:
show_ref(".have", sha1)
for each ref (this now only includes real refs):
show_ref(refname, sha1)

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

show_ref(): remove unused "flag" and "cb_data" argumentsMichael Haggerty Fri, 6 Jan 2012 14:12:32 +0000 (15:12 +0100)

show_ref(): remove unused "flag" and "cb_data" arguments

The function is not used as a callback, so it doesn't need these
arguments. Also change its return type to void.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

receive-pack: move more work into write_head_info()Michael Haggerty Fri, 6 Jan 2012 14:12:31 +0000 (15:12 +0100)

receive-pack: move more work into write_head_info()

Move some more code from the calling site into write_head_info(), and
inline add_alternate_refs() there. (Some more simplification is
coming, and it is easier if all this code is in the same place.)

Move some helper functions to avoid the need for forward declarations.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdiff: print post-image for common records instead... René Scharfe Fri, 6 Jan 2012 17:13:00 +0000 (18:13 +0100)

xdiff: print post-image for common records instead of pre-image

Normally it doesn't matter if we show the pre-image or th post-image
for the common parts of a diff because they are the same. If
white-space changes are ignored they can differ, though. The
new text after applying the diff is more interesting in that case,
so show that instead of the old contents.

Note: GNU diff shows the pre-image.

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

parse_object: try internal cache before reading object dbJeff King Thu, 5 Jan 2012 21:00:01 +0000 (16:00 -0500)

parse_object: try internal cache before reading object db

When parse_object is called, we do the following:

1. read the object data into a buffer via read_sha1_file

2. call parse_object_buffer, which then:

a. calls the appropriate lookup_{commit,tree,blob,tag}
to either create a new "struct object", or to find
an existing one. We know the appropriate type from
the lookup in step 1.

b. calls the appropriate parse_{commit,tree,blob,tag}
to parse the buffer for the new (or existing) object

In step 2b, all of the called functions are no-ops for
object "X" if "X->object.parsed" is set. I.e., when we have
already parsed an object, we end up going to a lot of work
just to find out at a low level that there is nothing left
for us to do (and we throw away the data from read_sha1_file
unread).

We can optimize this by moving the check for "do we have an
in-memory object" from 2a before the expensive call to
read_sha1_file in step 1.

This might seem circular, since step 2a uses the type
information determined in step 1 to call the appropriate
lookup function. However, we can notice that all of the
lookup_* functions are backed by lookup_object. In other
words, all of the objects are kept in a master hash table,
and we don't actually need the type to do the "do we have
it" part of the lookup, only to do the "and create it if it
doesn't exist" part.

This can save time whenever we call parse_object on the same
sha1 twice in a single program. Some code paths already
perform this optimization manually, with either:

if (!obj->parsed)
obj = parse_object(obj->sha1);

if you already have a "struct object", or:

struct object *obj = lookup_unknown_object(sha1);
if (!obj || !obj->parsed)
obj = parse_object(sha1);

if you don't. This patch moves the optimization into
parse_object itself.

Most git operations won't notice any impact. Either they
don't parse a lot of duplicate sha1s, or the calling code
takes special care not to re-parse objects. I timed two
code paths that do benefit (there may be more, but these two
were immediately obvious and easy to time).

The first is fast-export, which calls parse_object on each
object it outputs, like this:

object = parse_object(sha1);
if (!object)
die(...);
if (object->flags & SHOWN)
return;

which means that just to realize we have already shown an
object, we will read the whole object from disk!

With this patch, my best-of-five time for "fast-export --all" on
git.git dropped from 26.3s to 21.3s.

The second case is upload-pack, which will call parse_object
for each advertised ref (because it needs to peel tags to
show "^{}" entries). This doesn't matter for most
repositories, because they don't have a lot of refs pointing
to the same objects. However, if you have a big alternates
repository with a shared object db for a number of child
repositories, then the alternates repository will have
duplicated refs representing each of its children.

For example, GitHub's alternates repository for git.git has
~120,000 refs, of which only ~3200 are unique. The time for
upload-pack to print its list of advertised refs dropped
from 3.4s to 0.76s.

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

gitweb: Harden "grep" search against filenames with ':'Jakub Narebski Thu, 5 Jan 2012 20:32:56 +0000 (21:32 +0100)

gitweb: Harden "grep" search against filenames with ':'

Run "git grep" in "grep" search with '-z' option, to be able to parse
response also for files with filename containing ':' character. The
':' character is otherwise (without '-z') used to separate filename
from line number and from matched line.

Note that this does not protect files with filename containing
embedded newline. This would be hard but doable for text files, and
harder or even currently impossible with binary files: git does not
quote filename in

"Binary file <foo> matches"

message, but new `--break` and/or `--header` options to git-grep could
help here.

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

gitweb: Fix file links in "grep" searchJakub Narebski Thu, 5 Jan 2012 20:26:48 +0000 (21:26 +0100)

gitweb: Fix file links in "grep" search

There were two bugs in generating file links (links to "blob" view),
one hidden by the other. The correct way of generating file link is

href(action=>"blob", hash_base=>$co{'id'},
file_name=>$file);

It was $co{'hash'} (this key does not exist, and therefore this is
undef), and 'hash' instead of 'hash_base'.

To have this fix applied in single place, this commit also reduces
code duplication by saving file link (which is used for line links) in
$file_href.

Reported-by: Thomas Perl <th.perl@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log --show-signature: reword the common two-head merge... Junio C Hamano Thu, 5 Jan 2012 00:23:12 +0000 (16:23 -0800)

log --show-signature: reword the common two-head merge case

While identifying the commit merged to our history as "parent #2" is
technically correct, we will never say "parent #1" (as that is the tip of
our history before the merge is made), and we rarely would say "parent #3"
(which would mean the merge is an octopus), especially when responding to
a request to pull a signed tag.

Treat the most common case to merge a single commit specially, and just
say "merged tag '<tagname>'" instead.

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

log-tree: show mergetag in log --show-signature outputJunio C Hamano Wed, 4 Jan 2012 21:51:28 +0000 (13:51 -0800)

log-tree: show mergetag in log --show-signature output

A commit object that merges a signed tag records the "mergetag" extended
header. Check the validity of the GPG signature on it, and show it in a
way similar to how "gpgsig" extended header is shown.

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

log-tree.c: small refactor in show_signature()Junio C Hamano Wed, 4 Jan 2012 21:48:45 +0000 (13:48 -0800)

log-tree.c: small refactor in show_signature()

The next patch needs to show the result of signature verification on a
mergetag extended header in a way similar to how embedded signature for
the commit object itself is shown. Separate out the logic to go through
the message lines and show them in the "error" color (highlighted) or the
"correct" color (dim).

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

commit --amend -S: strip existing gpgsig headersJunio C Hamano Thu, 5 Jan 2012 18:54:14 +0000 (10:54 -0800)

commit --amend -S: strip existing gpgsig headers

Any existing commit signature was made against the contents of the old
commit, including its committer date that is about to change, and will
become invalid by amending it.

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

verify_signed_buffer: fix stale commentJunio C Hamano Wed, 4 Jan 2012 20:43:02 +0000 (12:43 -0800)

verify_signed_buffer: fix stale comment

The function used to take an integer flag to specify where the output
should go, but these days we supply a strbuf to receive it.

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

Merge branch 'jc/signed-commit' and 'jc/pull-signed... Junio C Hamano Thu, 5 Jan 2012 19:00:38 +0000 (11:00 -0800)

Merge branch 'jc/signed-commit' and 'jc/pull-signed-tag'

They both use the extended headers in commit objects, and the former has
necessary infrastructure to show them that is useful to view the result of
the latter.

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

Merge branch 'maint'Junio C Hamano Wed, 4 Jan 2012 19:21:42 +0000 (11:21 -0800)

Merge branch 'maint'

* maint:
t5550: repack everything into one file
Catch invalid --depth option passed to clone or fetch

t5550: repack everything into one fileClemens Buchacher Wed, 4 Jan 2012 15:55:34 +0000 (16:55 +0100)

t5550: repack everything into one file

Subsequently we assume that there is only one pack. Currently this is
true only by accident. Pass '-a -d' to repack in order to guarantee that
assumption to hold true.

The prune-packed command is now redundant since repack -d already calls
it.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: accept trailing "/" in $project_listMatthieu Moy Wed, 4 Jan 2012 10:07:45 +0000 (11:07 +0100)

gitweb: accept trailing "/" in $project_list

The current code is removing the trailing "/", but computing the string
length on the previous value, i.e. with the trailing "/". Later in the
code, we do

my $path = substr($File::Find::name, $pfxlen + 1);

And the "$pfxlen + 1" is supposed to mean "the length of the prefix, plus
1 for the / separating the prefix and the path", but with an incorrect
$pfxlen, this basically eats the first character of the path, and yields
"404 - No projects found".

While we're there, also fix $pfxdepth to use $dir, although a change of 1
in the depth shouldn't really matter.

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

Merge branch 'nd/maint-parse-depth' into maintJunio C Hamano Wed, 4 Jan 2012 17:43:26 +0000 (09:43 -0800)

Merge branch 'nd/maint-parse-depth' into maint

* nd/maint-parse-depth:
Catch invalid --depth option passed to clone or fetch

Catch invalid --depth option passed to clone or fetchNguyễn Thái Ngọc Duy Wed, 4 Jan 2012 10:01:55 +0000 (17:01 +0700)

Catch invalid --depth option passed to clone or fetch

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

write first for-merge ref to FETCH_HEAD firstJoey Hess Mon, 26 Dec 2011 16:16:56 +0000 (12:16 -0400)

write first for-merge ref to FETCH_HEAD first

The FETCH_HEAD refname is supposed to refer to the ref that was fetched
and should be merged. However all fetched refs are written to
.git/FETCH_HEAD in an arbitrary order, and resolve_ref_unsafe simply
takes the first ref as the FETCH_HEAD, which is often the wrong one,
when other branches were also fetched.

The solution is to write the for-merge ref(s) to FETCH_HEAD first.
Then, unless --append is used, the FETCH_HEAD refname behaves as intended.
If the user uses --append, they presumably are doing so in order to
preserve the old FETCH_HEAD.

While we are at it, update an old example in the read-tree documentation
that implied that each entry in FETCH_HEAD only has the object name, which
is not true for quite a while.

[jc: adjusted tests]

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

git-p4: view spec documentationPete Wyckoff Mon, 2 Jan 2012 23:05:54 +0000 (18:05 -0500)

git-p4: view spec documentation

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: rewrite view handlingPete Wyckoff Mon, 2 Jan 2012 23:05:53 +0000 (18:05 -0500)

git-p4: rewrite view handling

The old code was not very complete or robust. Redo it.

This new code should be useful for a few possible additions
in the future:

- support for * and %%n wildcards
- allowing ... inside paths
- representing branch specs (not just client specs)
- tracking changes to views

Mark the remaining 12 tests in t9809 as fixed.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: support single file p4 client view mapsGary Gibbons Mon, 2 Jan 2012 23:05:52 +0000 (18:05 -0500)

git-p4: support single file p4 client view maps

Perforce client views can map individual files,
mapping one //depot file path to one //client file path.
These mappings contain no meta/masking characters.
This patch add support for these file maps to
the currently supported '...' view mappings.

[pw: one test now suceeds]

Signed-off-by: Gary Gibbons <ggibbons@perforce.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: sort client views by reverse View numberGary Gibbons Mon, 2 Jan 2012 23:05:51 +0000 (18:05 -0500)

git-p4: sort client views by reverse View number

Correct view sorting to support the Perforce order,
where client views are ordered and later views
override earlier view mappings.

[pw: one test now succeeds]

Signed-off-by: Gary Gibbons <ggibbons@perforce.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: fix test for unsupported P4 Client ViewsGary Gibbons Mon, 2 Jan 2012 23:05:50 +0000 (18:05 -0500)

git-p4: fix test for unsupported P4 Client Views

Change re method in test for unsupported Client View types
(containing %% or *) anywhere in the string rather than
at the begining.

[pw: two tests now succeed]

Signed-off-by: Gary Gibbons <ggibbons@perforce.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: test client view handlingPete Wyckoff Mon, 2 Jan 2012 23:05:49 +0000 (18:05 -0500)

git-p4: test client view handling

Test many aspects of processing p4 client views with the
git-p4 option --use-client-spec. 16 out of 22 tests are
currently broken.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'pw/p4-docs-and-tests'Junio C Hamano Tue, 3 Jan 2012 22:09:28 +0000 (14:09 -0800)

Merge branch 'pw/p4-docs-and-tests'

* pw/p4-docs-and-tests:
git-p4: document and test submit options
git-p4: test and document --use-client-spec
git-p4: test --keep-path
git-p4: test --max-changes
git-p4: document and test --import-local
git-p4: honor --changesfile option and test
git-p4: document and test clone --branch
git-p4: test cloning with two dirs, clarify doc
git-p4: clone does not use --git-dir
git-p4: introduce asciidoc documentation
rename git-p4 tests

Merge branch 'maint'Junio C Hamano Tue, 3 Jan 2012 21:48:00 +0000 (13:48 -0800)

Merge branch 'maint'

* maint:
docs: describe behavior of relative submodule URLs
fix hang in git fetch if pointed at a 0 length bundle
Documentation: read-tree --prefix works with existing subtrees
Add MYMETA.json to perl/.gitignore

Merge branch 'maint-1.7.7' into maintJunio C Hamano Tue, 3 Jan 2012 21:47:46 +0000 (13:47 -0800)

Merge branch 'maint-1.7.7' into maint

* maint-1.7.7:
docs: describe behavior of relative submodule URLs
Documentation: read-tree --prefix works with existing subtrees
Add MYMETA.json to perl/.gitignore

Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano Tue, 3 Jan 2012 21:47:15 +0000 (13:47 -0800)

Merge branch 'maint-1.7.6' into maint-1.7.7

* maint-1.7.6:
Documentation: read-tree --prefix works with existing subtrees
Add MYMETA.json to perl/.gitignore

docs: describe behavior of relative submodule URLsJens Lehmann Sun, 1 Jan 2012 15:13:16 +0000 (16:13 +0100)

docs: describe behavior of relative submodule URLs

Since the relative submodule URLs have been introduced in f31a522a2d, they
do not conform to the rules for resolving relative URIs but rather to
those of relative directories.

Document that behavior.

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

fix hang in git fetch if pointed at a 0 length bundleBrian Harring Tue, 3 Jan 2012 13:46:03 +0000 (05:46 -0800)

fix hang in git fetch if pointed at a 0 length bundle

git-repo if interupted at the exact wrong time will generate zero
length bundles- literal empty files. git-repo is wrong here, but
git fetch shouldn't effectively spin loop if pointed at a zero
length bundle.

Signed-off-by: Brian Harring <ferringb@chromium.org>
Helped-by: Johannes Sixt
Helped-by: Nguyen Thai Ngoc Duy
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: read-tree --prefix works with existing... Clemens Buchacher Sat, 31 Dec 2011 11:50:56 +0000 (12:50 +0100)

Documentation: read-tree --prefix works with existing subtrees

Since 34110cd4 (Make 'unpack_trees()' have a separate source and
destination index) it is no longer true that a subdirectory with
the same prefix must not exist.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash: Don't fail if work dir contains file named ... Jonathon Mah Sat, 31 Dec 2011 00:14:01 +0000 (16:14 -0800)

stash: Don't fail if work dir contains file named 'HEAD'

When performing a plain "git stash" (without --patch), git-diff would fail
with "fatal: ambiguous argument 'HEAD': both revision and filename". The
output was piped into git-update-index, masking the failed exit status.
The output is now sent to a temporary file (which is cleaned up by
existing code), and the exit status is checked. The "HEAD" arg to the
git-diff invocation has been disambiguated too, of course.

In patch mode, "git stash -p" would fail harmlessly, leaving the working
dir untouched. Interactive adding is fine, but the resulting tree was
diffed with an ambiguous 'HEAD' argument.

Use >foo (no space) when redirecting output.

In t3904, checks and operations on each file are in the order they'll
appear when interactively staging.

In t3905, fix a bug in "stash save --include-untracked -q is quiet": The
redirected stdout file was considered untracked, and so was removed from
the working directory. Use test path helper functions where appropriate.

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

Add MYMETA.json to perl/.gitignoreJack Nagel Thu, 29 Dec 2011 04:42:05 +0000 (22:42 -0600)

Add MYMETA.json to perl/.gitignore

ExtUtils::MakeMaker generates MYMETA.json in addition to MYMETA.yml
since version 6.57_07. As it suggests, it is just meta information about
the build and is cleaned up with 'make clean', so it should be ignored.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.9Junio C Hamano Wed, 28 Dec 2011 20:07:22 +0000 (12:07 -0800)

Update draft release notes to 1.7.9

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

Sync with 1.7.8.2Junio C Hamano Wed, 28 Dec 2011 20:04:25 +0000 (12:04 -0800)

Sync with 1.7.8.2

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

Git 1.7.8.2 v1.7.8.2Junio C Hamano Wed, 28 Dec 2011 19:49:09 +0000 (11:49 -0800)

Git 1.7.8.2

Contains accumulated fixes since 1.7.8 that have been merged to the
'master' branch in preparation for the 1.7.9 release.

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

Merge branch 'jv/maint-config-set' into maintJunio C Hamano Wed, 28 Dec 2011 20:03:19 +0000 (12:03 -0800)

Merge branch 'jv/maint-config-set' into maint

* jv/maint-config-set:
Fix an incorrect reference to --set-all.

Merge branch 'jk/follow-rename-score' into maintJunio C Hamano Wed, 28 Dec 2011 19:49:37 +0000 (11:49 -0800)

Merge branch 'jk/follow-rename-score' into maint

* jk/follow-rename-score:
use custom rename score during --follow

Merge branch 'jc/checkout-m-twoway' into maintJunio C Hamano Wed, 28 Dec 2011 19:44:54 +0000 (11:44 -0800)

Merge branch 'jc/checkout-m-twoway' into maint

* jc/checkout-m-twoway:
t/t2023-checkout-m.sh: fix use of test_must_fail
checkout_merged(): squelch false warning from some gcc
Test 'checkout -m -- path'
checkout -m: no need to insist on having all 3 stages

Merge branch 'tr/doc-sh-setup' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:51 +0000 (11:42 -0800)

Merge branch 'tr/doc-sh-setup' into maint

* tr/doc-sh-setup:
git-sh-setup: make require_clean_work_tree part of the interface

Merge branch 'jk/maint-strbuf-missing-init' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:46 +0000 (11:42 -0800)

Merge branch 'jk/maint-strbuf-missing-init' into maint

* jk/maint-strbuf-missing-init:
commit, merge: initialize static strbuf

Merge branch 'jk/maint-push-v-is-verbose' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:42 +0000 (11:42 -0800)

Merge branch 'jk/maint-push-v-is-verbose' into maint

* jk/maint-push-v-is-verbose:
make "git push -v" actually verbose

Merge branch 'jk/http-push-to-empty' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:37 +0000 (11:42 -0800)

Merge branch 'jk/http-push-to-empty' into maint

* jk/http-push-to-empty:
remote-curl: don't pass back fake refs

Conflicts:
remote-curl.c

Merge branch 'jk/doc-fsck' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:33 +0000 (11:42 -0800)

Merge branch 'jk/doc-fsck' into maint

* jk/doc-fsck:
docs: brush up obsolete bits of git-fsck manpage

Merge branch 'jc/maint-lf-to-crlf-keep-crlf' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:27 +0000 (11:42 -0800)

Merge branch 'jc/maint-lf-to-crlf-keep-crlf' into maint

* jc/maint-lf-to-crlf-keep-crlf:
lf_to_crlf_filter(): resurrect CRLF->CRLF hack

Merge branch 'ef/setenv-putenv' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:24 +0000 (11:42 -0800)

Merge branch 'ef/setenv-putenv' into maint

* ef/setenv-putenv:
compat/setenv.c: error if name contains '='
compat/setenv.c: update errno when erroring out

Merge branch 'jc/advice-doc' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:39 +0000 (11:32 -0800)

Merge branch 'jc/advice-doc' into maint

* jc/advice-doc:
advice: Document that they all default to true

Merge branch 'jn/maint-sequencer-fixes' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:39 +0000 (11:32 -0800)

Merge branch 'jn/maint-sequencer-fixes' into maint

* jn/maint-sequencer-fixes:
revert: stop creating and removing sequencer-old directory
Revert "reset: Make reset remove the sequencer state"
revert: do not remove state until sequence is finished
revert: allow single-pick in the middle of cherry-pick sequence
revert: pass around rev-list args in already-parsed form
revert: allow cherry-pick --continue to commit before resuming
revert: give --continue handling its own function

Merge branch 'jk/maint-snprintf-va-copy' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:38 +0000 (11:32 -0800)

Merge branch 'jk/maint-snprintf-va-copy' into maint

* jk/maint-snprintf-va-copy:
compat/snprintf: don't look at va_list twice

Merge branch 'jk/maint-push-over-dav' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:37 +0000 (11:32 -0800)

Merge branch 'jk/maint-push-over-dav' into maint

* jk/maint-push-over-dav:
http-push: enable "proactive auth"
t5540: test DAV push with authentication

Merge branch 'jk/maint-mv' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:36 +0000 (11:32 -0800)

Merge branch 'jk/maint-mv' into maint

* jk/maint-mv:
mv: be quiet about overwriting
mv: improve overwrite warning
mv: make non-directory destination error more clear
mv: honor --verbose flag
docs: mention "-k" for both forms of "git mv"

Merge branch 'jk/fetch-no-tail-match-refs' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:36 +0000 (11:32 -0800)

Merge branch 'jk/fetch-no-tail-match-refs' into maint

* jk/fetch-no-tail-match-refs:
connect.c: drop path_match function
fetch-pack: match refs exactly
t5500: give fully-qualified refs to fetch-pack
drop "match" parameter from get_remote_heads

Merge branch 'ew/keepalive' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:36 +0000 (11:32 -0800)

Merge branch 'ew/keepalive' into maint

* ew/keepalive:
enable SO_KEEPALIVE for connected TCP sockets

Merge branch 'ci/stripspace-docs' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:35 +0000 (11:32 -0800)

Merge branch 'ci/stripspace-docs' into maint

* ci/stripspace-docs:
Update documentation for stripspace

Merge branch 'jh/fast-import-notes' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:35 +0000 (11:32 -0800)

Merge branch 'jh/fast-import-notes' into maint

* jh/fast-import-notes:
fast-import: Fix incorrect fanout level when modifying existing notes refs
t9301: Add 2nd testcase exposing bugs in fast-import's notes fanout handling
t9301: Fix testcase covering up a bug in fast-import's notes fanout handling

Merge branch 'aw/rebase-i-stop-on-failure-to-amend... Junio C Hamano Wed, 28 Dec 2011 19:32:34 +0000 (11:32 -0800)

Merge branch 'aw/rebase-i-stop-on-failure-to-amend' into maint

* aw/rebase-i-stop-on-failure-to-amend:
rebase -i: interrupt rebase when "commit --amend" failed during "reword"

Merge branch 'tj/maint-imap-send-remove-unused' into... Junio C Hamano Wed, 28 Dec 2011 19:32:34 +0000 (11:32 -0800)

Merge branch 'tj/maint-imap-send-remove-unused' into maint

* tj/maint-imap-send-remove-unused:
imap-send: Remove unused 'use_namespace' variable

Merge branch 'jn/branch-move-to-self' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:33 +0000 (11:32 -0800)

Merge branch 'jn/branch-move-to-self' into maint

* jn/branch-move-to-self:
Allow checkout -B <current-branch> to update the current branch
branch: allow a no-op "branch -M <current-branch> HEAD"

Merge branch 'na/strtoimax' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:33 +0000 (11:32 -0800)

Merge branch 'na/strtoimax' into maint

* na/strtoimax:
Support sizes >=2G in various config options accepting 'g' sizes.
Compatibility: declare strtoimax() under NO_STRTOUMAX
Add strtoimax() compatibility function.

Merge branch 'jk/refresh-porcelain-output' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:32 +0000 (11:32 -0800)

Merge branch 'jk/refresh-porcelain-output' into maint

* jk/refresh-porcelain-output:
refresh_index: make porcelain output more specific
refresh_index: rename format variables
read-cache: let refresh_cache_ent pass up changed flags

Fix an incorrect reference to --set-all.Jelmer Vernooij Tue, 27 Dec 2011 02:03:45 +0000 (03:03 +0100)

Fix an incorrect reference to --set-all.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: document and test submit optionsPete Wyckoff Sun, 25 Dec 2011 02:07:40 +0000 (21:07 -0500)

git-p4: document and test submit options

Clarify there is a -M option, but no -C. These are both
configurable through variables.

Explain that the allowSubmit variable takes a comma-separated
list of branch names.

Catch earlier an invalid branch name given as an argument to
"git p4 clone".

Test option --origin, variable allowSubmit, and explicit master
branch name.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: test and document --use-client-specPete Wyckoff Sun, 25 Dec 2011 02:07:39 +0000 (21:07 -0500)

git-p4: test and document --use-client-spec

The depot path is required, even with this option. Make sure
git-p4 fails and exits with non-zero.

Contents in the specified depot path will be rearranged according
to the client spec. Test this and add a note in the docs.

Leave an XXX suggesting that this is somewhat confusing behavior
that might be good to fix later.

Function stripRepoPath() looks at self.useClientSpec. Make sure
this is set both for command-line option --use-client-spec and
for configuration variable git-p4.useClientSpec. Test this.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: test --keep-pathPete Wyckoff Sun, 25 Dec 2011 02:07:38 +0000 (21:07 -0500)

git-p4: test --keep-path

Make sure it leaves the path, below //depot, in git.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: test --max-changesPete Wyckoff Sun, 25 Dec 2011 02:07:37 +0000 (21:07 -0500)

git-p4: test --max-changes

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: document and test --import-localPete Wyckoff Sun, 25 Dec 2011 02:07:36 +0000 (21:07 -0500)

git-p4: document and test --import-local

Explain that it is needed on future syncs to find p4 branches
in refs/heads. Test this behavior.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: honor --changesfile option and testPete Wyckoff Sun, 25 Dec 2011 02:07:35 +0000 (21:07 -0500)

git-p4: honor --changesfile option and test

When an explicit list of changes is given, it makes no sense to
use @all or @3,5 or any of the other p4 revision specifiers.
Make the code notice when this happens, instead of just ignoring
--changesfile. Test it.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: document and test clone --branchPete Wyckoff Sun, 25 Dec 2011 02:07:34 +0000 (21:07 -0500)

git-p4: document and test clone --branch

Clone with --branch will not checkout HEAD, unless the branch
happens to be called the default refs/remotes/p4/master. The
--branch option is most useful with sync; give an example of
that.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: test cloning with two dirs, clarify docPete Wyckoff Sun, 25 Dec 2011 02:07:33 +0000 (21:07 -0500)

git-p4: test cloning with two dirs, clarify doc

Document how git-p4 currently works when specifying multiple
depot paths:

1. No branches or directories are named.

2. Conflicting files are silently ignored---the last change
wins.

2. Option --destination is required, else the last path is construed
to be a directory.

3. Revision specifiers must be the same on all paths for them to
take effect.

Test this behavior.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: clone does not use --git-dirPete Wyckoff Sun, 25 Dec 2011 02:07:32 +0000 (21:07 -0500)

git-p4: clone does not use --git-dir

Complain if --git-dir is given during a clone. It has no
effect. Only --destination and --bare can change where the newly
cloned git dir will be.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: introduce asciidoc documentationPete Wyckoff Sun, 25 Dec 2011 02:07:31 +0000 (21:07 -0500)

git-p4: introduce asciidoc documentation

Add proper documentation for git-p4. Delete the old .txt
documentation from contrib/fast-import.

Cc: Frans Klaver <fransklaver@gmail.com>
Cc: Luke Diamand <luke@diamand.org>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rename git-p4 testsPete Wyckoff Sun, 25 Dec 2011 02:07:30 +0000 (21:07 -0500)

rename git-p4 tests

Use consistent naming for all tests: "t98<num>-git-p4-<topic>.sh"

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes in preparation for 1.7.9-rc0Junio C Hamano Thu, 22 Dec 2011 23:36:48 +0000 (15:36 -0800)

Update draft release notes in preparation for 1.7.9-rc0

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

Merge branch 'tr/bash-read-unescaped'Junio C Hamano Thu, 22 Dec 2011 23:30:38 +0000 (15:30 -0800)

Merge branch 'tr/bash-read-unescaped'

* tr/bash-read-unescaped:
bash completion: use read -r everywhere

Merge branch 'ab/sun-studio-portability'Junio C Hamano Thu, 22 Dec 2011 23:30:33 +0000 (15:30 -0800)

Merge branch 'ab/sun-studio-portability'

* ab/sun-studio-portability:
Appease Sun Studio by renaming "tmpfile"
Fix a bitwise negation assignment issue spotted by Sun Studio
Fix an enum assignment issue spotted by Sun Studio

Merge branch 'tr/doc-sh-setup'Junio C Hamano Thu, 22 Dec 2011 23:30:29 +0000 (15:30 -0800)

Merge branch 'tr/doc-sh-setup'

* tr/doc-sh-setup:
git-sh-setup: make require_clean_work_tree part of the interface

Merge branch 'rr/revert-cherry-pick'Junio C Hamano Thu, 22 Dec 2011 23:30:22 +0000 (15:30 -0800)

Merge branch 'rr/revert-cherry-pick'

* rr/revert-cherry-pick:
t3502, t3510: clarify cherry-pick -m failure
t3510 (cherry-pick-sequencer): use exit status
revert: simplify getting commit subject in format_todo()
revert: tolerate extra spaces, tabs in insn sheet
revert: make commit subjects in insn sheet optional
revert: free msg in format_todo()

Merge branch 'tr/pty-all'Junio C Hamano Thu, 22 Dec 2011 23:30:15 +0000 (15:30 -0800)

Merge branch 'tr/pty-all'

* tr/pty-all:
test-terminal: set output terminals to raw mode

Merge branch 'jn/maint-gitweb-utf8-fix'Junio C Hamano Thu, 22 Dec 2011 23:30:12 +0000 (15:30 -0800)

Merge branch 'jn/maint-gitweb-utf8-fix'

* jn/maint-gitweb-utf8-fix:
gitweb: Fix fallback mode of to_utf8 subroutine
gitweb: Output valid utf8 in git_blame_common('data')
gitweb: esc_html() site name for title in OPML
gitweb: Call to_utf8() on input string in chop_and_escape_str()

Update draft release notes to 1.7.9Junio C Hamano Thu, 22 Dec 2011 19:43:02 +0000 (11:43 -0800)

Update draft release notes to 1.7.9

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

Merge branch 'jk/maint-strbuf-missing-init'Junio C Hamano Thu, 22 Dec 2011 19:27:31 +0000 (11:27 -0800)

Merge branch 'jk/maint-strbuf-missing-init'

* jk/maint-strbuf-missing-init:
commit, merge: initialize static strbuf

Conflicts:
builtin/merge.c

Merge branch 'jc/maint-lf-to-crlf-keep-crlf'Junio C Hamano Thu, 22 Dec 2011 19:27:29 +0000 (11:27 -0800)

Merge branch 'jc/maint-lf-to-crlf-keep-crlf'

* jc/maint-lf-to-crlf-keep-crlf:
lf_to_crlf_filter(): resurrect CRLF->CRLF hack

Merge branch 'rs/diff-tree-combined-clean-up'Junio C Hamano Thu, 22 Dec 2011 19:27:29 +0000 (11:27 -0800)

Merge branch 'rs/diff-tree-combined-clean-up'

* rs/diff-tree-combined-clean-up:
submodule: use diff_tree_combined_merge() instead of diff_tree_combined()
pass struct commit to diff_tree_combined_merge()
use struct sha1_array in diff_tree_combined()

Merge branch 'jk/maint-push-v-is-verbose'Junio C Hamano Thu, 22 Dec 2011 19:27:29 +0000 (11:27 -0800)

Merge branch 'jk/maint-push-v-is-verbose'

* jk/maint-push-v-is-verbose:
make "git push -v" actually verbose

Merge branch 'tr/grep-threading'Junio C Hamano Thu, 22 Dec 2011 19:27:28 +0000 (11:27 -0800)

Merge branch 'tr/grep-threading'

* tr/grep-threading:
grep: disable threading in non-worktree case
grep: enable threading with -p and -W using lazy attribute lookup
grep: load funcname patterns for -W

Merge branch 'jk/pretty-reglog-ent'Junio C Hamano Thu, 22 Dec 2011 19:27:28 +0000 (11:27 -0800)

Merge branch 'jk/pretty-reglog-ent'

* jk/pretty-reglog-ent:
pretty: give placeholders to reflog identity