gitweb.git
Merge branch 'mr/hpux' into maintJunio C Hamano Mon, 21 Mar 2011 05:11:15 +0000 (22:11 -0700)

Merge branch 'mr/hpux' into maint

* mr/hpux:
git-compat-util.h: Honor HP C's noreturn attribute
Makefile: add NO_FNMATCH_CASEFOLD to HP-UX section

Merge branch 'so/submodule-no-update-first-time' into... Junio C Hamano Mon, 21 Mar 2011 05:11:02 +0000 (22:11 -0700)

Merge branch 'so/submodule-no-update-first-time' into maint

* so/submodule-no-update-first-time:
t7406: "git submodule update {--merge|--rebase]" with new submodules
submodule: no [--merge|--rebase] when newly cloned

Merge branch 'mo/perl-bidi-pipe-envfix' into maintJunio C Hamano Mon, 21 Mar 2011 05:10:31 +0000 (22:10 -0700)

Merge branch 'mo/perl-bidi-pipe-envfix' into maint

* mo/perl-bidi-pipe-envfix:
perl: command_bidi_pipe() method should set-up git environmens

Merge branch 'ae/better-template-failure-report' into... Junio C Hamano Mon, 21 Mar 2011 05:09:39 +0000 (22:09 -0700)

Merge branch 'ae/better-template-failure-report' into maint

* ae/better-template-failure-report:
Improve error messages when temporary file creation fails

Work around broken ln on solaris as used in t8006Ben Walton Mon, 21 Mar 2011 01:12:26 +0000 (21:12 -0400)

Work around broken ln on solaris as used in t8006

The test setup in t8006-blame-textconv.sh uses "ln -sf" to
overwrite an existing symlink. Unfortunately, both /usr/bin/ln
and /usr/xpg4/bin/ln on solaris 9 don't properly handle -f and -s
used at the same time. This caused the test setup and subsequent
checks to fail.

Instead, remove the symlink and then create a new one in the
setup code.

The upstream Solaris bug (fixed in 10, but not 9) is documented
here:

http://bugs.opensolaris.org/view_bug.do?bug_id=4372462

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch-pack: use smaller handshake window for initial... Junio C Hamano Mon, 21 Mar 2011 04:52:45 +0000 (21:52 -0700)

fetch-pack: use smaller handshake window for initial request

Start the initial request small by halving the INITIAL_FLUSH (we will try
to stay one window ahead of the server, so we would end up giving twice as
many "have" in flight at the very beginning). We may want to tweak these
values even more, taking MTU into account.

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

fetch-pack: progressively use larger handshake windowsJunio C Hamano Mon, 21 Mar 2011 04:52:44 +0000 (21:52 -0700)

fetch-pack: progressively use larger handshake windows

The client has to dig the history deeper when more recent parts of its
history do not have any overlap with the server it is fetching from. Make
the handshake window exponentially larger as we dig deeper, with a
reasonable upper cap.

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

fetch-pack: factor out hardcoded handshake window sizeJunio C Hamano Mon, 21 Mar 2011 04:52:40 +0000 (21:52 -0700)

fetch-pack: factor out hardcoded handshake window size

The "git fetch" client presents the most recent 32 commits it has to the
server and gives a chance to the server to say "ok, we heard enough", and
continues reporting what it has in chunks of 32 commits, digging its
history down to older commits.

Move the hardcoded size of the handshake window outside the code, so that
we can tweak it more easily.

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

Add test: git stash shows status relative to current dirPiotr Krukowiecki Mon, 14 Mar 2011 19:19:36 +0000 (20:19 +0100)

Add test: git stash shows status relative to current dir

[jc: moved "cd subdir" inside subshell and fixed comparison with expected]

Signed-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: Add a note about running commands under valgrindCarlos Martín Nieto Tue, 15 Mar 2011 09:32:11 +0000 (10:32 +0100)

t/README: Add a note about running commands under valgrind

The test suite runs valgrind with certain options activated. Add a
note saying how to run commands under the same conditions as the test
suite does.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout: tweak detached-orphan warning formatJeff King Sun, 20 Mar 2011 09:19:01 +0000 (05:19 -0400)

checkout: tweak detached-orphan warning format

When orphaning a commit on a detached HEAD, the warning
currently looks like:

Warning: you are leaving 3 commits behind, not connected to
any of your branches:

- commit subject 1
- commit subject 2
- commit subject 3

If you want to keep them by creating a new branch, this
may be a good time to do so with:

git branch new_branch_name 933a615ab0bc566dcfd8c01ec8af159f770d3fe5

Instead of using the "-" list, let's provide a more
traditional oneline format, with the abbreviated sha1 before
each subject. Users are accustomed to seeing commits in this
format, and having the sha1 of each commit can be useful if
you want to cherry-pick instead of creating a new branch.

The new format looks like:

Warning: you are leaving 3 commits behind, not connected to
any of your branches:

933a615 commit subject 1
824fcde commit subject 2
fa49b1a commit subject 3

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

checkout: clear commit marks after detached-orphan... Jeff King Sun, 20 Mar 2011 09:09:18 +0000 (05:09 -0400)

checkout: clear commit marks after detached-orphan check

When leaving a detached HEAD, we do a revision walk to make
sure the commit we are leaving isn't being orphaned.
However, this leaves crufty marks in the commit objects
which can confuse later walkers, like the one in
stat_tracking_info.

Let's clean up after ourselves to prevent this conflict.

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

checkout: add basic tests for detached-orphan warningJeff King Sun, 20 Mar 2011 09:04:16 +0000 (05:04 -0400)

checkout: add basic tests for detached-orphan warning

Commit 8e2dc6ac added a warning when we leave a detached
HEAD whose commit is not reachable from any ref tip. Let's
add a few basic tests to make sure it works.

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

Merge branch 'mm/maint-log-n-with-diff-filtering'Junio C Hamano Sun, 20 Mar 2011 06:25:38 +0000 (23:25 -0700)

Merge branch 'mm/maint-log-n-with-diff-filtering'

* mm/maint-log-n-with-diff-filtering:
log: fix --max-count when used together with -S or -G

Merge branch 'mg/rev-list-n-reverse-doc'Junio C Hamano Sun, 20 Mar 2011 06:25:32 +0000 (23:25 -0700)

Merge branch 'mg/rev-list-n-reverse-doc'

* mg/rev-list-n-reverse-doc:
git-log.txt,rev-list-options.txt: put option blocks in proper order
git-log.txt,rev-list-options.txt: -n/--max-count is commit limiting

Merge branch 'js/rerere-forget-always-take-pathspec'Junio C Hamano Sun, 20 Mar 2011 06:24:48 +0000 (23:24 -0700)

Merge branch 'js/rerere-forget-always-take-pathspec'

* js/rerere-forget-always-take-pathspec:
rerere forget: deprecate invocation without pathspec

Merge branch 'ab/i18n-basic'Junio C Hamano Sun, 20 Mar 2011 06:24:42 +0000 (23:24 -0700)

Merge branch 'ab/i18n-basic'

* ab/i18n-basic:
i18n: "make distclean" should clean up after "make pot"
i18n: Makefile: "pot" target to extract messages marked for translation
i18n: add stub Q_() wrapper for ngettext
i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is set
i18n: add GETTEXT_POISON to simulate unfriendly translator
i18n: add no-op _() and N_() wrappers
commit, status: use status_printf{,_ln,_more} helpers
commit: refer to commit template as s->fp
wt-status: add helpers for printing wt-status lines

Conflicts:
builtin/commit.c

Merge branch 'uk/ls-remote-in-get-remote-url'Junio C Hamano Sun, 20 Mar 2011 06:24:34 +0000 (23:24 -0700)

Merge branch 'uk/ls-remote-in-get-remote-url'

* uk/ls-remote-in-get-remote-url:
git-request-pull: open-code the only invocation of get_remote_url
get_remote_url(): use the same data source as ls-remote to get remote urls

Merge branch 'ss/mergetool--lib'Junio C Hamano Sun, 20 Mar 2011 06:24:27 +0000 (23:24 -0700)

Merge branch 'ss/mergetool--lib'

* ss/mergetool--lib:
mergetool--lib: Add Beyond Compare 3 as a tool
mergetool--lib: Sort tools alphabetically for easier lookup

Merge branch 'jn/status-translatable'Junio C Hamano Sun, 20 Mar 2011 06:24:19 +0000 (23:24 -0700)

Merge branch 'jn/status-translatable'

* jn/status-translatable:
commit, status: use status_printf{,_ln,_more} helpers
commit: refer to commit template as s->fp
wt-status: add helpers for printing wt-status lines

Conflicts:
builtin/commit.c

Merge branch 'jk/trace-sifter'Junio C Hamano Sun, 20 Mar 2011 06:24:12 +0000 (23:24 -0700)

Merge branch 'jk/trace-sifter'

* jk/trace-sifter:
trace: give repo_setup trace its own key
add packet tracing debug code
trace: add trace_strbuf
trace: factor out "do we want to trace" logic
trace: refactor to support multiple env variables
trace: add trace_vprintf

Merge branch 'jk/format-patch-multiline-header'Junio C Hamano Sun, 20 Mar 2011 06:24:08 +0000 (23:24 -0700)

Merge branch 'jk/format-patch-multiline-header'

* jk/format-patch-multiline-header:
format-patch: rfc2047-encode newlines in headers
format-patch: wrap long header lines
strbuf: add fixed-length version of add_wrapped_text

Merge branch 'jk/merge-rename-ux'Junio C Hamano Sun, 20 Mar 2011 06:23:56 +0000 (23:23 -0700)

Merge branch 'jk/merge-rename-ux'

* jk/merge-rename-ux:
pull: propagate --progress to merge
merge: enable progress reporting for rename detection
add inexact rename detection progress infrastructure
commit: stop setting rename limit
bump rename limit defaults (again)
merge: improve inexact rename limit warning

Merge branch 'maint'Junio C Hamano Sun, 20 Mar 2011 06:21:10 +0000 (23:21 -0700)

Merge branch 'maint'

* maint:
gitweb: Always call parse_date with timezone parameter
bisect: explain the rationale behind 125

init, clone: support --separate-git-dir for .git fileNguyễn Thái Ngọc Duy Sat, 19 Mar 2011 15:16:56 +0000 (22:16 +0700)

init, clone: support --separate-git-dir for .git file

--separate-git-dir tells git to create git dir at the specified
location, instead of where it is supposed to be. A .git file that
points to that location will be put in place so that it appears normal
to repo discovery process.

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

git-init.txt: move description section upNguyễn Thái Ngọc Duy Sat, 19 Mar 2011 15:16:55 +0000 (22:16 +0700)

git-init.txt: move description section up

It's more or less standard that synopsis is followed by description,
then options.

This is not just a clean move though:

- The paragraphs are realigned a bit
- The text mentioning git-init-db is dropped. init-db is
deprecated, no need to confuse new users

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

grep: read patterns from stdin with -f -René Scharfe Sat, 19 Mar 2011 18:33:15 +0000 (19:33 +0100)

grep: read patterns from stdin with -f -

Support the well-know convention of reading standard input instead of a
named file if "-" (dash) is specified. GNU grep does the same.

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

gitweb: Always call parse_date with timezone parameterJakub Narebski Sat, 19 Mar 2011 22:53:55 +0000 (23:53 +0100)

gitweb: Always call parse_date with timezone parameter

Timezone is required to correctly set local time, which would be needed
for future 'localtime' feature.

While at it, remove unnecessary call to the function from git_log_body,
as its return value is not used anywhere.

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

bisect: explain the rationale behind 125Junio C Hamano Sun, 20 Mar 2011 04:46:06 +0000 (21:46 -0700)

bisect: explain the rationale behind 125

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

Merge branch 'maint'Junio C Hamano Fri, 18 Mar 2011 23:20:49 +0000 (16:20 -0700)

Merge branch 'maint'

* maint:
docs: fix grammar in gitattributes.txt

gitweb: fix #patchNN anchors when path_info is enabledKevin Cernekee Fri, 18 Mar 2011 16:00:16 +0000 (17:00 +0100)

gitweb: fix #patchNN anchors when path_info is enabled

When $feature{'pathinfo'} is used, gitweb script sets the base URL to
itself, so that relative links to static files work correctly. It
does it by adding something like below to HTML head:

<base href="http://HOST/gitweb.cgi">

This breaks the "patch" anchor links seen on the commitdiff pages,
because these links, being relative (<a href="#patch1">), are resolved
(computed) relative to the base URL and not relative to current URL,
i.e. as:

http://HOST/gitweb.cgi#patch1

Instead, they should look like this:

http://HOST/gitweb.cgi/myproject.git/commitdiff/35a9811ef9d68eae9afd76bede121da4f89b448c#patch1

Add an "-anchor" parameter to href(), and use href(-anchor=>"patch1")
to generate "patch" anchor links, so that the full path is included in
the patch link.

While at it, convert

print "foo";
print "bar";

to

print "foo" .
"bar";

in the neighborhood of changes.

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

docs: fix grammar in gitattributes.txtAlexei Sholik Fri, 18 Mar 2011 13:14:27 +0000 (15:14 +0200)

docs: fix grammar in gitattributes.txt

[jc: with a fixlet from Marc Branchaud]

Signed-off-by: Alexei Sholik <alcosholik@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch-pack: objects in our alternates are available... Junio C Hamano Fri, 11 Mar 2011 19:53:52 +0000 (11:53 -0800)

fetch-pack: objects in our alternates are available to us

Use the helper function split from the receiving end of "git push" to
allow the same optimization on the receiving end of "git fetch".

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

refs_from_alternate: helper to use refs from alternatesJunio C Hamano Fri, 11 Mar 2011 19:32:53 +0000 (11:32 -0800)

refs_from_alternate: helper to use refs from alternates

The receiving end of "git push" advertises the objects that the repository
itself does not use, but are at the tips of refs in other repositories
whose object databases are used as alternates for it. This helps it avoid
having to receive (and the pusher having to send) objects that are already
available to the receiving repository via the alternates mechanism.

Tweak the helper function that implements this feature, and move it to
transport.[ch] for future reuse by other programs.

The additional test demonstrates how this optimization is helping "git push",
and "git fetch" is ignorant about it.

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

Name make_*_path functions more accuratelyCarlos Martín Nieto Thu, 17 Mar 2011 11:26:46 +0000 (12:26 +0100)

Name make_*_path functions more accurately

Rename the make_*_path functions so it's clearer what they do, in
particlar make clear what the differnce between make_absolute_path and
make_nonrelative_path is by renaming them real_path and absolute_path
respectively. make_relative_path has an understandable name and is
renamed to relative_path to maintain the name convention.

The function calls have been replaced 1-to-1 in their usage.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

run-command: prettify -D_FORTIFY_SOURCE workaroundJonathan Nieder Wed, 16 Mar 2011 07:32:39 +0000 (02:32 -0500)

run-command: prettify -D_FORTIFY_SOURCE workaround

Current gcc + glibc with -D_FORTIFY_SOURCE try very aggressively to
protect against a programming style which uses write(...) without
checking the return value for errors. Even the usual hint of casting
to (void) does not suppress the warning.

Sometimes when there is an output error, especially right before exit,
there really is nothing to be done. The obvious solution, adopted in
v1.7.0.3~20^2 (run-command.c: fix build warnings on Ubuntu,
2010-01-30), is to save the return value to a dummy variable:

ssize_t dummy;
dummy = write(...);

But that (1) is ugly and (2) triggers -Wunused-but-set-variable
warnings with gcc-4.6 -Wall, so we are not much better off than when
we started.

Instead, use an "if" statement with an empty body to make the intent
clear.

if (write(...))
; /* yes, yes, there was an error. */

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

unbreak and eliminate NO_C99_FORMATJonathan Nieder Wed, 16 Mar 2011 05:15:31 +0000 (00:15 -0500)

unbreak and eliminate NO_C99_FORMAT

In the spirit of v1.5.0.2~21 (Check for PRIuMAX rather than
NO_C99_FORMAT in fast-import.c, 2007-02-20), use PRIuMAX from
git-compat-util.h on all platforms instead of C99-specific formats
like %zu with dangerous fallbacks to %u or %lu.

So now C99-challenged platforms can build git without provoking
warnings or errors from printf, even if pointers do not have the same
size as an int or long.

The need for a fallback PRIuMAX is detected in git-compat-util.h with
"#ifndef PRIuMAX". So while at it, simplify the Makefile and configure
script by eliminating the NO_C99_FORMAT knob altogether.

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

mktag: avoid %td in format stringJonathan Nieder Wed, 16 Mar 2011 05:14:22 +0000 (00:14 -0500)

mktag: avoid %td in format string

Since v1.7.0-rc0~34 (make "mktag" a built-in, 2010-01-22), git mktag
uses the C99-style %td format to print ptrdiff_t values. It falls
back to %d when NO_C99_FORMAT is set, on the assumption that pre-C99
systems probably are using 32-bit pointers.

But many modern systems are 64-bit and

* sometimes one wants to test the NO_C99_FORMAT fallbacks using a
modern development platform;
* some platforms (I'm looking at you, msvc) have not gotten with the
program and are still C89-only.

These ptrdiff_t values are offsets from the beginning of a buffer, so
a size_t or uintmax_t would work about as well. Use the latter so we
can take advantage of the PRIuMAX fallback in git-compat-util.h, even
on C99-challenged systems with 64-bit pointers.

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

stash: copy the index using --index-output instead... Johannes Sixt Wed, 16 Mar 2011 08:18:49 +0000 (09:18 +0100)

stash: copy the index using --index-output instead of cp -p

'git stash create' must operate with a temporary index. For this purpose,
it used 'cp -p' to create a copy. -p is needed to preserve the timestamp
of the index file. Now Jakob Pfender reported a certain combination of
a Linux NFS client, OpenBSD NFS server, and cp implementation where this
operation failed.

Luckily, the first operation in git-stash after copying the index is to
call 'git read-tree'. Therefore, use --index-output instead of 'cp -p'
to write the copy of the index.

--index-output requires that the specified file is on the same volume as
the source index, so that the lock file can be rename()d. For this reason,
the name of the temporary index is constructed in a way different from the
other temporary files. The code path of 'stash -p' also needs a temporary
index, but we do not use the new name because it does not depend on the
same precondition as --index-output.

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

stash: fix incorrect quoting in cleanup of temporary... Johannes Sixt Wed, 16 Mar 2011 08:14:33 +0000 (09:14 +0100)

stash: fix incorrect quoting in cleanup of temporary files

The * was inside the quotes, so that the pattern was never expanded and the
temporary files were never removed. As a consequence, 'stash -p' left a
.git-stash-*-patch file in $GIT_DIR. Other code paths did not leave files
behind because they removed the temporary file themselves, at least in
non-error paths.

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

RelNotes/1.7.5.txt: typo and language fixesMichael J Gruber Wed, 16 Mar 2011 09:23:23 +0000 (10:23 +0100)

RelNotes/1.7.5.txt: typo and language fixes

Also remove entries for fixes that are already present in the
maintenance track.

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

Merge branch 'maint'Junio C Hamano Wed, 16 Mar 2011 23:59:30 +0000 (16:59 -0700)

Merge branch 'maint'

* maint:
Prepare draft release notes to 1.7.4.2
gitweb: highlight: replace tabs with spaces
make_absolute_path: return the input path if it points to our buffer
valgrind: ignore SSE-based strlen invalid reads
diff --submodule: split into bite-sized pieces
cherry: split off function to print output lines
branch: split off function that writes tracking info and commit subject
standardize brace placement in struct definitions
compat: make gcc bswap an inline function
enums: omit trailing comma for portability

Conflicts:
RelNotes

Prepare draft release notes to 1.7.4.2Junio C Hamano Wed, 16 Mar 2011 23:29:03 +0000 (16:29 -0700)

Prepare draft release notes to 1.7.4.2

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

Merge branch 'jn/maint-commit-missing-template' into... Junio C Hamano Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)

Merge branch 'jn/maint-commit-missing-template' into maint

* jn/maint-commit-missing-template:
commit: error out for missing commit message template

Merge branch 'lt/rename-no-extra-copy-detection' into... Junio C Hamano Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)

Merge branch 'lt/rename-no-extra-copy-detection' into maint

* lt/rename-no-extra-copy-detection:
diffcore-rename: improve estimate_similarity() heuristics
diffcore-rename: properly honor the difference between -M and -C
for_each_hash: allow passing a 'void *data' pointer to callback

Merge branch 'jk/diffstat-binary' into maintJunio C Hamano Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)

Merge branch 'jk/diffstat-binary' into maint

* jk/diffstat-binary:
diff: don't retrieve binary blobs for diffstat
diff: handle diffstat of rewritten binary files

Merge branch 'mg/maint-difftool-vim-readonly' into... Junio C Hamano Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)

Merge branch 'mg/maint-difftool-vim-readonly' into maint

* mg/maint-difftool-vim-readonly:
mergetool-lib: call vim in readonly mode for diffs

Merge branch 'jn/test-terminal-punt-on-osx-breakage... Junio C Hamano Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)

Merge branch 'jn/test-terminal-punt-on-osx-breakage' into maint

* jn/test-terminal-punt-on-osx-breakage:
tests: skip terminal output tests on OS X

Merge branch 'jk/fail-null-clone' into maintJunio C Hamano Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)

Merge branch 'jk/fail-null-clone' into maint

* jk/fail-null-clone:
clone: die when trying to clone missing local path

Merge branch 'jh/push-default-upstream-configname'... Junio C Hamano Wed, 16 Mar 2011 23:47:26 +0000 (16:47 -0700)

Merge branch 'jh/push-default-upstream-configname' into maint

* jh/push-default-upstream-configname:
push.default: Rename 'tracking' to 'upstream'

Merge branch 'mg/placeholders-are-lowercase' into maintJunio C Hamano Wed, 16 Mar 2011 23:47:25 +0000 (16:47 -0700)

Merge branch 'mg/placeholders-are-lowercase' into maint

* mg/placeholders-are-lowercase:
Make <identifier> lowercase in Documentation
Make <identifier> lowercase as per CodingGuidelines
Make <identifier> lowercase as per CodingGuidelines
Make <identifier> lowercase as per CodingGuidelines
CodingGuidelines: downcase placeholders in usage messages

Merge branch 'mg/patch-id' into maintJunio C Hamano Wed, 16 Mar 2011 23:47:25 +0000 (16:47 -0700)

Merge branch 'mg/patch-id' into maint

* mg/patch-id:
git-patch-id: do not trip over "no newline" markers
git-patch-id: test for "no newline" markers

Merge branch 'js/maint-merge-use-prepare-commit-msg... Junio C Hamano Wed, 16 Mar 2011 23:47:25 +0000 (16:47 -0700)

Merge branch 'js/maint-merge-use-prepare-commit-msg-hook' into maint

* js/maint-merge-use-prepare-commit-msg-hook:
merge: honor prepare-commit-msg hook

gitweb: highlight: replace tabs with spacesKevin Cernekee Wed, 16 Mar 2011 22:34:13 +0000 (15:34 -0700)

gitweb: highlight: replace tabs with spaces

Consider the following code fragment:

/*
* test
*/

vim ":set list" mode shows that the first character on each line is a
tab:

^I/*$
^I * test$
^I */$

By default, the "highlight" program will retain the tabs in the HTML
output:

$ highlight --fragment --syntax c test.c
<span class="hl com">/*</span>
<span class="hl com"> * test</span>
<span class="hl com"> */</span>

vim list mode:

^I<span class="hl com">/*</span>$
<span class="hl com">^I * test</span>$
<span class="hl com">^I */</span>$

In gitweb, this winds up looking something like:

1 /*
2 * test
3 */

I tried both Firefox and Opera and saw the same behavior.

The desired output is:

1 /*
2 * test
3 */

This can be accomplished by specifying "--replace-tabs=8" on the
highlight command line.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Acked-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff --quiet: disable optimization when --diff-filter... Junio C Hamano Wed, 16 Mar 2011 22:46:08 +0000 (15:46 -0700)

diff --quiet: disable optimization when --diff-filter=X is used

The code notices that the caller does not want any detail of the changes
and only wants to know if there is a change or not by specifying --quiet.
And it breaks out of the loop when it knows it already found any change.

When you have a post-process filter (e.g. --diff-filter), however, the
path we found to be different in the previous round and set HAS_CHANGES
bit may end up being uninteresting, and there may be no output at the end.
The optimization needs to be disabled for such case.

Note that the f245194 (diff: change semantics of "ignore whitespace"
options, 2009-05-22) already disables this optimization by refraining
from setting HAS_CHANGES when post-process filters that need to inspect
the contents of the files (e.g. -S, -w) in diff_change() function.

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

git-p4: test sync new branchPete Wyckoff Wed, 16 Mar 2011 20:53:53 +0000 (16:53 -0400)

git-p4: test sync new branch

Add two new unit tests. One to test the feature that that
was added in e32e00d, and another to test the regression
that was fixed in the parent to this commit.

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

git-p4: fix sync new branch regressionPete Wyckoff Wed, 16 Mar 2011 20:52:46 +0000 (16:52 -0400)

git-p4: fix sync new branch regression

e32e00d (git-p4: better message for "git-p4 sync" when not
cloned, 2011-02-19) broke another use case, that of using
"git-p4 sync" to import a new branch into an existing repository.

Refine the fix again, on top of the fix in ac34efc.

Reported-by: Michael Horowitz <michael.horowitz@ieee.org>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Tested-by: Michael Horowitz <michael.horowitz@ieee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

make_absolute_path: return the input path if it points... Carlos Martín Nieto Wed, 16 Mar 2011 16:06:17 +0000 (17:06 +0100)

make_absolute_path: return the input path if it points to our buffer

Some codepaths call make_absolute_path with its own return value as
input. In such a cases, return the path immediately.

This fixes a valgrind-discovered error, whereby we tried to copy a
string onto itself.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

valgrind: ignore SSE-based strlen invalid readsCarlos Martín Nieto Wed, 16 Mar 2011 11:46:01 +0000 (12:46 +0100)

valgrind: ignore SSE-based strlen invalid reads

Some versions of strlen use SSE to speed up the calculation and load 4
bytes at a time, even if it means reading past the end of the
allocated memory. This read is safe and when the strlen function is
inlined, it is not replaced by valgrind, which reports a
false-possitive.

Tell valgrind to ignore this particular error, as the read is, in
fact, safe. Current upstream-released version 3.6.1 is affected. Some
distributions have this fixed in their latest versions.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

vcs-svn: remove spurious semicolonsJonathan Nieder Wed, 16 Mar 2011 07:02:42 +0000 (02:02 -0500)

vcs-svn: remove spurious semicolons

trp_gen is not a statement or function call, so it should not be
followed with a semicolon. Noticed by gcc -pedantic.

vcs-svn/repo_tree.c:41:81: warning: ISO C does not allow extra ';'
outside of a function [-pedantic]

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

diff --submodule: split into bite-sized piecesJonathan Nieder Wed, 16 Mar 2011 07:14:11 +0000 (02:14 -0500)

diff --submodule: split into bite-sized pieces

Introduce two functions:

- prepare_submodule_summary prepares the revision walker
to list changes in a submodule. That is, it:

* finds merge bases between the commits pointed to this
path from before ("left") and after ("right") the change;
* checks whether this is a fast-forward or fast-backward;
* prepares a revision walk to list commits in the symmetric
difference between the commits at each endpoint.

It returns nonzero on error.

- print_submodule_summary runs the revision walk and saves
the result to a strbuf in --left-right format.

The goal is just readability. No functional change intended.

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>

cherry: split off function to print output linesJonathan Nieder Wed, 16 Mar 2011 07:12:48 +0000 (02:12 -0500)

cherry: split off function to print output lines

Readers uninterested in the details of "git cherry"'s output format
can see

print_commit('-', commit, verbose, abbrev);

and ignore the details.

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

branch: split off function that writes tracking info... Jonathan Nieder Wed, 16 Mar 2011 07:10:14 +0000 (02:10 -0500)

branch: split off function that writes tracking info and commit subject

Introduce a add_verbose_info function that takes care of adding

- an abbreviated object name;
- a summary of the form [ahead x, behind y] of the relationship
to the corresponding upstream branch;
- a one line commit subject

for the tip commit of a branch, for use in "git branch -v" output.

No functional change intended. This just unindents the code a little
and makes it easier to skip on first reading.

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

standardize brace placement in struct definitionsJonathan Nieder Wed, 16 Mar 2011 07:08:34 +0000 (02:08 -0500)

standardize brace placement in struct definitions

In a struct definitions, unlike functions, the prevailing style is for
the opening brace to go on the same line as the struct name, like so:

struct foo {
int bar;
char *baz;
};

Indeed, grepping for 'struct [a-z_]* {$' yields about 5 times as many
matches as 'struct [a-z_]*$'.

Linus sayeth:

Heretic people all over the world have claimed that this inconsistency
is ... well ... inconsistent, but all right-thinking people know that
(a) K&R are _right_ and (b) K&R are right.

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

compat: make gcc bswap an inline functionJonathan Nieder Wed, 16 Mar 2011 07:00:49 +0000 (02:00 -0500)

compat: make gcc bswap an inline function

Without this change, gcc -pedantic warns:

cache.h: In function 'ce_to_dtype':
cache.h:270:21: warning: ISO C forbids braced-groups within expressions [-pedantic]

An inline function is more readable anyway.

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

enums: omit trailing comma for portabilityJonathan Nieder Wed, 16 Mar 2011 06:59:10 +0000 (01:59 -0500)

enums: omit trailing comma for portability

Since v1.7.2-rc0~23^2~2 (Add per-repository eol normalization,
2010-05-19), building with gcc -std=gnu89 -pedantic produces warnings
like the following:

convert.c:21:11: warning: comma at end of enumerator list [-pedantic]

gcc is right to complain --- these commas are not permitted in C89.
In the spirit of v1.7.2-rc0~32^2~16 (2010-05-14), remove them.

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

Merge branch 'nd/struct-pathspec'Junio C Hamano Wed, 16 Mar 2011 07:17:05 +0000 (00:17 -0700)

Merge branch 'nd/struct-pathspec'

* nd/struct-pathspec:
declare 1-bit bitfields to be unsigned

declare 1-bit bitfields to be unsignedJonathan Nieder Wed, 16 Mar 2011 03:42:32 +0000 (22:42 -0500)

declare 1-bit bitfields to be unsigned

As "gcc -pedantic" notices, a two's complement 1-bit signed integer
cannot represent the value '1'.

dir.c: In function 'init_pathspec':
dir.c:1291:4: warning: overflow in implicit constant conversion [-Woverflow]

In the spirit of v1.7.1-rc1~10 (2010-04-06), 'unsigned' is what was
intended, so let's make the flags unsigned.

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

git-p4: Fix error message crash in P4Sync.commit.Tor Arvid Lund Tue, 15 Mar 2011 12:08:03 +0000 (13:08 +0100)

git-p4: Fix error message crash in P4Sync.commit.

There is an error message that crashes the script because of an invalid ref
to the non-existing "path" variable. It is almost never printed, which
would explain why nobody encountered this problem before... But anyway,
this oneliner fixes it.

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Teach git-p4 to ignore case in perforce filenames if... Tor Arvid Lund Tue, 15 Mar 2011 12:08:02 +0000 (13:08 +0100)

Teach git-p4 to ignore case in perforce filenames if configured.

When files are added to perforce, the path to that file has whichever case
configuration that exists on the machine of the user who added the file.
What does that mean? It means that when Alice adds a file

//depot/DirA/FileA.txt

... and Bob adds:

//depot/dirA/FileB.txt

... we may or may not get a problem. If a user sets the config variable
git-p4.ignorecase to "true", we will consider //depot/DirA and //depot/dirA
to be the same directory.

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Teach gitConfig method about arguments.Tor Arvid Lund Tue, 15 Mar 2011 12:08:01 +0000 (13:08 +0100)

git-p4: Teach gitConfig method about arguments.

With this patch, it is possible to call the gitConfig method with an optional
argument string, which will be passed to the "git config" executable. For
instance:

gitConfig("core.ignorecase", "--bool")

will ensure that you get the value "true", and won't have to check the returned
value for [1, true, on, yes].

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-bisect.txt: example for bisecting with hot-fixMichael J Gruber Tue, 15 Mar 2011 21:24:56 +0000 (22:24 +0100)

git-bisect.txt: example for bisecting with hot-fix

Give an example on how to bisect when older revisions need a hot-fix to
build, run or test. Triggered by the binutils/kernel issue at

http://thread.gmane.org/gmane.comp.gnu.binutils/52601/focus=1112779

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

git-bisect.txt: streamline run presentationMichael J Gruber Tue, 15 Mar 2011 21:24:55 +0000 (22:24 +0100)

git-bisect.txt: streamline run presentation

Streamline the presentation of "bisect run" by removing one example
which does not introduce new concepts.

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

Update draft release notes to 1.7.5Junio C Hamano Tue, 15 Mar 2011 22:17:54 +0000 (15:17 -0700)

Update draft release notes to 1.7.5

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

Merge branch 'jk/strbuf-vaddf'Junio C Hamano Tue, 15 Mar 2011 21:23:04 +0000 (14:23 -0700)

Merge branch 'jk/strbuf-vaddf'

* jk/strbuf-vaddf:
compat: fall back on __va_copy if available
strbuf: add strbuf_vaddf
compat: provide a fallback va_copy definition

Merge branch 'mm/push-default-advice'Junio C Hamano Tue, 15 Mar 2011 21:22:55 +0000 (14:22 -0700)

Merge branch 'mm/push-default-advice'

* mm/push-default-advice:
push: better error message when no remote configured
push: better error messages when push.default = tracking

Merge branch 'jn/maint-instaweb-plack-fix'Junio C Hamano Tue, 15 Mar 2011 21:22:37 +0000 (14:22 -0700)

Merge branch 'jn/maint-instaweb-plack-fix'

* jn/maint-instaweb-plack-fix:
git-instaweb: Change how gitweb.psgi is made runnable as standalone app

Merge branch 'sp/maint-fd-limit'Junio C Hamano Tue, 15 Mar 2011 21:22:23 +0000 (14:22 -0700)

Merge branch 'sp/maint-fd-limit'

* sp/maint-fd-limit:
sha1_file.c: Don't retain open fds on small packs
mingw: add minimum getrlimit() compatibility stub
Limit file descriptors used by packs

Merge branch 'jc/checkout-orphan-warning'Junio C Hamano Tue, 15 Mar 2011 21:22:16 +0000 (14:22 -0700)

Merge branch 'jc/checkout-orphan-warning'

* jc/checkout-orphan-warning:
commit: give final warning when reattaching HEAD to leave commits behind

Merge branch 'jh/maint-do-not-track-non-branches'Junio C Hamano Tue, 15 Mar 2011 21:22:13 +0000 (14:22 -0700)

Merge branch 'jh/maint-do-not-track-non-branches'

* jh/maint-do-not-track-non-branches:
branch/checkout --track: Ensure that upstream branch is indeed a branch

Merge branch 'fk/maint-cvsimport-early-failure'Junio C Hamano Tue, 15 Mar 2011 21:22:09 +0000 (14:22 -0700)

Merge branch 'fk/maint-cvsimport-early-failure'

* fk/maint-cvsimport-early-failure:
git-cvsimport.perl: Bail out right away when reading from the server fails

Merge branch 'jc/maint-apply-report-offset'Junio C Hamano Tue, 15 Mar 2011 21:22:02 +0000 (14:22 -0700)

Merge branch 'jc/maint-apply-report-offset'

* jc/maint-apply-report-offset:
apply -v: show offset count when patch did not apply exactly

Merge branch 'jc/maint-apply-no-double-patch'Junio C Hamano Tue, 15 Mar 2011 21:22:00 +0000 (14:22 -0700)

Merge branch 'jc/maint-apply-no-double-patch'

* jc/maint-apply-no-double-patch:
apply: do not patch lines that were already patched

Merge branch 'mr/hpux'Junio C Hamano Tue, 15 Mar 2011 21:21:47 +0000 (14:21 -0700)

Merge branch 'mr/hpux'

* mr/hpux:
git-compat-util.h: Honor HP C's noreturn attribute
Makefile: add NO_FNMATCH_CASEFOLD to HP-UX section

Documentation: running test with --debug keeps "trash... Piotr Krukowiecki Tue, 15 Mar 2011 19:58:14 +0000 (20:58 +0100)

Documentation: running test with --debug keeps "trash" directory

Signed-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/doc-credits' of git://github.com/peff/gitJunio C Hamano Tue, 15 Mar 2011 20:32:09 +0000 (13:32 -0700)

Merge branch 'jk/doc-credits' of git://github.com/peff/git

* 'jk/doc-credits' of git://github.com/peff/git:
docs: point git.txt author credits to git-scm.com
doc: add missing git footers
doc: drop author/documentation sections from most pages

tests: scrub environment of GIT_* variablesJonathan Nieder Tue, 15 Mar 2011 10:10:45 +0000 (05:10 -0500)

tests: scrub environment of GIT_* variables

Variables from the inherited environment that are meaningful to git
can break tests in undesirable ways. For example,

GIT_PAGER=more sh t5400-send-pack.sh -v -i

hangs. So unset all environment variables in the GIT_ namespace in
test-lib, with a few exceptions:

- GIT_TRACE* are useful for tracking down bugs exhibited by a failing
test;

- GIT_DEBUG* are GIT_TRACE variables by another name, practically
speaking. They should probably be tweaked to follow the
GIT_TRACE_foo scheme and use trace_printf machinery some time.

- GIT_USE_LOOKUP from v1.5.6-rc0~134^2~1 (sha1-lookup: more memory
efficient search in sorted list of SHA-1, 2007-12-29) is about
trying an alternate implementation strategy rather than changing
semantics and it can be useful to compare performance with and
without it set.

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

config: drop support for GIT_CONFIG_NOGLOBALJonathan Nieder Tue, 15 Mar 2011 09:04:49 +0000 (04:04 -0500)

config: drop support for GIT_CONFIG_NOGLOBAL

Now that test-lib sets $HOME to protect against pollution from user
settings, GIT_CONFIG_NOGLOBAL is not needed for use by the test
suite any more. And as luck would have it, a quick code search
reveals no other users in the wild.

This patch does not affect GIT_CONFIG_NOSYSTEM, which is still
needed.

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

gitattributes: drop support for GIT_ATTR_NOGLOBALJonathan Nieder Tue, 15 Mar 2011 09:04:15 +0000 (04:04 -0500)

gitattributes: drop support for GIT_ATTR_NOGLOBAL

test-lib sets $HOME to protect against pollution from user settings,
so setting GIT_ATTR_NOGLOBAL would be redundant. Simplify by
eliminating support for that environment variable altogether.

GIT_ATTR_NOGLOBAL was introduced in v1.7.4-rc0~208^2 (Add global and
system-wide gitattributes, 2010-09-01) as an undocumented feature for
use by the test suite. It never ended up being used (neither within
git.git nor in other projects).

This patch does not affect GIT_ATTR_NOSYSTEM, which should still be
useful.

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

tests: suppress system gitattributesJonathan Nieder Tue, 15 Mar 2011 09:05:10 +0000 (04:05 -0500)

tests: suppress system gitattributes

Set GIT_ATTR_NOSYSTEM in test-lib to make tests more reliable in two
ways:

- an invalid GIT_ATTR_NOSYSTEM setting should not cause tests to fail
with "fatal: bad config value for 'GIT_ATTR_NOSYSTEM'".

- /etc/gitattributes should not change the outcome of tests.

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

tests: stop worrying about obsolete environment variablesJonathan Nieder Tue, 15 Mar 2011 10:09:24 +0000 (05:09 -0500)

tests: stop worrying about obsolete environment variables

After v0.99.7~99 (Retire support for old environment variables,
2005-09-09), there is no more need to unset a stray AUTHOR_NAME
variable that might have entered the test environment.

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

upload-pack: Implement no-done capabilityShawn O. Pearce Tue, 15 Mar 2011 00:59:40 +0000 (17:59 -0700)

upload-pack: Implement no-done capability

If the client requests both multi_ack_detailed and no-done then
upload-pack is free to immediately send a PACK following its first
'ACK %s ready' message. The upload-pack response actually winds
up being:

ACK %s common
... (maybe more) ...
ACK %s ready
NAK
ACK %s
PACK.... the pack stream ....

For smart HTTP connections this saves one HTTP RPC, reducing
the overall latency for a trivial fetch. For git:// and ssh://
a no-done option slightly reduces latency by removing one
server->client->server round-trip at the end of the common
ancestor negotiation.

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

fetch-pack: Implement no-done capabilityShawn O. Pearce Tue, 15 Mar 2011 00:59:39 +0000 (17:59 -0700)

fetch-pack: Implement no-done capability

If enabled on the connection "multi_ack_detailed no-done" as a
pair allows the remote upload-pack process to send a PACK down
to the client as soon as a "ACK %s ready" message was also sent.

Over git:// and ssh:// where a bi-directional stream is in place
this has very little difference over the classical version that
waits for the client to send a "done\n" line by itself. It does
slightly reduce the latency involved to start the pack stream as
there is one less round-trip from client->server required.

Over smart HTTP this avoids needing to send a final RPC that has
all of the prior common objects. Instead the server is able to
return a pack as soon as its ready to. For many common users the
smart HTTP fetch is now just 2 requests: GET .../info/refs, and
a POST .../git-upload-pack to not only negotiate but also receive
the pack stream. Only users who have more than 32 local unshared
commits with the remote will need additional requests to negotiate
a common merge base.

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

upload-pack: More aggressively send 'ACK %s ready'Shawn O. Pearce Mon, 14 Mar 2011 23:48:39 +0000 (16:48 -0700)

upload-pack: More aggressively send 'ACK %s ready'

If a client is merely following the remote (and has not made any
new commits itself), all "have %s" lines sent by the client will be
common to the server. As all lines are common upload-pack never
calls ok_to_give_up() and does not compute if it has a good cut
point in the commit graph.

Without this computation the following client is going to send all
tagged commits, as these were determined to be COMMON_REF during the
initial advertisement, but the client does not parse their history
to transitively pass the COMMON flag and empty its queue of commits.

For git.git with 339 commit tags, it takes clients 11 rounds of
negotation to fully send all tagged commits and exhaust its queue
of things to send as common. This is pretty slow for a client that
has not done any local development activity.

Force computing ok_to_give_up() and send "ACK %s ready" at the end
of the current round if this round only contained common objects
and ok_to_give_up() was therefore not called. This may allow the
client to break early, avoiding transmission of the COMMON_REFs.

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

fetch-pack: Finish negotation if remote replies "ACK... Shawn O. Pearce Mon, 14 Mar 2011 23:48:38 +0000 (16:48 -0700)

fetch-pack: Finish negotation if remote replies "ACK %s ready"

If multi_ack_detailed was selected in the protocol capabilities
(both client and server are >= Git 1.6.6) the upload-pack side will
send "ACK %s ready" when it knows how to safely cut the graph and
produce a reasonable pack for the want list that was already sent
on the connection.

Upon receiving "ACK %s ready" there is no point in looking at
the remaining commits inside of rev_list. Sending additional
"have %s" lines to the remote will not construct a smaller pack.
It is unlikely a commit older than the current cut point will have
a better delta base than the cut point itself has.

The original design of this code had fetch-pack empty rev_list by
marking a commit and its transitive ancestors COMMON whenever the
remote side said "ACK %s {continue,common}" and skipping over any
already COMMON commits during get_rev(). This approach does not
work when most of rev_list is actually COMMON_REF, commits that
are pointed to by a reference on the remote, which exist locally,
and which have not yet been sent to the remote as a "have %s" line.

Most of the common references are tags in the ref/tags namespace,
using points in the commit graph that are more than 1 commit apart.
In git.git itself, this is currently 340 tags, 339 of which point to
commits in the commit graph. fetch-pack pushes all of these into
rev_list, but is unable to mark them COMMON and discard during a
remote's "ACK %s {continue,common}" because it does not parse through
the entire parent chain. Not parsing the entire parent chain is
an optimization to avoid walking back to the roots of the repository.

Assuming the client is only following the remote (and does not make
its own local commits), the client needs 11 rounds to spin through
the entire list of tags (32 commits per round, ceil(339/32) == 11).
Unfortunately the server knows on the first "have %s" line that
it can produce a good pack, and does not need to see the remaining
320 tags in the other 10 rounds.

Over git:// and ssh:// this isn't as bad as it sounds, the client is
only transmitting an extra 16,000 bytes that it doesn't need to send.

Over smart HTTP, the client must do an additional 10 HTTP POST
requests, each of which incurs round-trip latency, and must upload
the entire state vector of all known common objects. On the final
POST request, this is 16 KiB worth of data.

Fix all of this by clearing rev_list as soon as the remote side
says it can construct a pack.

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

list-objects.c: don't add an unparsed NULL as a pending... Junio C Hamano Mon, 14 Mar 2011 19:29:50 +0000 (12:29 -0700)

list-objects.c: don't add an unparsed NULL as a pending tree

"git rev-list --first-parent --boundary $commit^..$commit" segfaults on a
merge commit since 8d2dfc4 (process_{tree,blob}: show objects without
buffering, 2009-04-10), as it tried to dereference a commit that was
discarded as UNINTERESTING without being parsed (hence lacking "tree").

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

Merge branch 'sp/maint-smart-http-sans-100-continue'Junio C Hamano Mon, 14 Mar 2011 18:59:10 +0000 (11:59 -0700)

Merge branch 'sp/maint-smart-http-sans-100-continue'

* sp/maint-smart-http-sans-100-continue:
smart-http: Really never use Expect: 100-continue

smart-http: Really never use Expect: 100-continueShawn O. Pearce Mon, 14 Mar 2011 18:28:17 +0000 (11:28 -0700)

smart-http: Really never use Expect: 100-continue

libcurl may choose to try and use Expect: 100-continue for
any type of POST, not just a Transfer: chunked-encoding type.
Force it to disable this feature, as not all proxy servers support
100-continue and leaving it enabled can cause 1 second stalls during
the negotiation phase of fetch-pack/upload-pack.

In ("206b099d26 smart-http: Don't use Expect: 100-Continue") we
tried to disable this for only large POST bodies, but it should be
disabled for every POST body.

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

Documentation: "rebase <onto> <that>" stays on <that... Drew Northup Mon, 14 Mar 2011 15:47:37 +0000 (11:47 -0400)

Documentation: "rebase <onto> <that>" stays on <that> branch upon exit

This change makes it clearer that the change to the history effected by
executing 'git rebase master' while on 'topic' branch, and by executing
'git rebase master topic' on any branch, will be the same; the implicit
checkout of the second form will remain after the rebase exits.

Signed-off-by: Drew Northup <drew.northup@maine.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

object.h: Remove obsolete struct object_refsJakob Pfender Mon, 14 Mar 2011 16:23:52 +0000 (17:23 +0100)

object.h: Remove obsolete struct object_refs

7914053 (Remove unused object-ref code, 2008-02-25) removed all uses of
the structure from the code, but forgot to remove the type definition
itself.

Signed-off-by: Jakob Pfender <jpfender@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>