gitweb.git
Merge branch 'maint-1.7.11' into maintJunio C Hamano Wed, 12 Sep 2012 21:08:05 +0000 (14:08 -0700)

Merge branch 'maint-1.7.11' into maint

Merge branch 'jc/apply-binary-p0' into maint-1.7.11Junio C Hamano Wed, 12 Sep 2012 21:00:52 +0000 (14:00 -0700)

Merge branch 'jc/apply-binary-p0' into maint-1.7.11

"git apply -p0" did not parse pathnames on "diff --git" line
correctly. This caused patches that had pathnames in no other
places to be mistakenly rejected (most notably, binary patch that
does not rename nor change mode). Textual patches, renames or mode
changes have preimage and postimage pathnames in different places in
a form that can be parsed unambiguously and did not suffer from this
problem.

* jc/apply-binary-p0:
apply: compute patch->def_name correctly under -p0

Merge branch 'jc/dotdot-is-parent-directory' into maint... Junio C Hamano Wed, 12 Sep 2012 21:00:34 +0000 (14:00 -0700)

Merge branch 'jc/dotdot-is-parent-directory' into maint-1.7.11

"git log .." errored out saying it is both rev range and a path when
there is no disambiguating "--" is on the command line. Update the
command line parser to interpret ".." as a path in such a case.

* jc/dotdot-is-parent-directory:
specifying ranges: we did not mean to make ".." an empty set

Merge branch 'jc/maint-doc-checkout-b-always-takes... Junio C Hamano Wed, 12 Sep 2012 20:59:58 +0000 (13:59 -0700)

Merge branch 'jc/maint-doc-checkout-b-always-takes-branch-name' into maint-1.7.11

The synopsis said "checkout [-B branch]" to make it clear the
branch name is a parameter to the option, but the heading for the
option description was "-B::", not "-B branch::", making the
documentation misleading.

* jc/maint-doc-checkout-b-always-takes-branch-name:
doc: "git checkout -b/-B/--orphan" always takes a branch name

Merge branch 'jk/maint-http-half-auth-push' into maint... Junio C Hamano Wed, 12 Sep 2012 20:58:22 +0000 (13:58 -0700)

Merge branch 'jk/maint-http-half-auth-push' into maint-1.7.11

Pushing to smart HTTP server with recent Git fails without having
the username in the URL to force authentication, if the server is
configured to allow GET anonymously, while requiring authentication
for POST.

* jk/maint-http-half-auth-push:
http: prompt for credentials on failed POST
http: factor out http error code handling
t: test http access to "half-auth" repositories
t: test basic smart-http authentication
t/lib-httpd: recognize */smart/* repos as smart-http
t/lib-httpd: only route auth/dumb to dumb repos
t5550: factor out http auth setup
t5550: put auth-required repo in auth/dumb

Merge branch 'kk/maint-for-each-ref-multi-sort' into... Junio C Hamano Wed, 12 Sep 2012 20:57:43 +0000 (13:57 -0700)

Merge branch 'kk/maint-for-each-ref-multi-sort' into maint-1.7.11

"git for-each-ref" did not honor multiple "--sort=<key>" arguments
correctly.

* kk/maint-for-each-ref-multi-sort:
for-each-ref: Fix sort with multiple keys
t6300: test sort with multiple keys

Further merging down for 1.7.12.1Junio C Hamano Tue, 11 Sep 2012 18:27:35 +0000 (11:27 -0700)

Further merging down for 1.7.12.1

We will wait for a handful of other fixes that have graduated to the
'master' for 1.8.0 to be tested in the wild and then tag 1.7.12.1:

. mz/cherry-pick-cmdline-order
. jk/maint-quiet-is-synonym-to-s-in-log
. jk/maint-http-half-auth-push
. jc/apply-binary-p0
. jk/config-warn-on-inaccessible-paths
. kk/maint-for-each-ref-multi-sort

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

Sync with 1.7.11.6Junio C Hamano Tue, 11 Sep 2012 18:23:45 +0000 (11:23 -0700)

Sync with 1.7.11.6

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

Merge branch 'js/use-sc-open-max' into maintJunio C Hamano Tue, 11 Sep 2012 18:23:06 +0000 (11:23 -0700)

Merge branch 'js/use-sc-open-max' into maint

* js/use-sc-open-max:
sha1_file.c: introduce get_max_fd_limit() helper

Merge branch 'js/no-curl-easy-strerror-on-old-curl... Junio C Hamano Tue, 11 Sep 2012 18:22:58 +0000 (11:22 -0700)

Merge branch 'js/no-curl-easy-strerror-on-old-curl' into maint

* js/no-curl-easy-strerror-on-old-curl:
http.c: don't use curl_easy_strerror prior to curl-7.12.0

Git 1.7.11.6 v1.7.11.6Junio C Hamano Tue, 11 Sep 2012 18:18:48 +0000 (11:18 -0700)

Git 1.7.11.6

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

Merge branch 'jc/maint-mergetool-style-fix' into maint... Junio C Hamano Tue, 11 Sep 2012 18:10:23 +0000 (11:10 -0700)

Merge branch 'jc/maint-mergetool-style-fix' into maint-1.7.11

* jc/maint-mergetool-style-fix:
mergetool: style fixes

Merge branch 'sz/submodule-force-update' into maint... Junio C Hamano Tue, 11 Sep 2012 18:10:17 +0000 (11:10 -0700)

Merge branch 'sz/submodule-force-update' into maint-1.7.11

* sz/submodule-force-update:
Make 'git submodule update --force' always check out submodules.

Merge branch 'ph/stash-rerere' into maint-1.7.11Junio C Hamano Tue, 11 Sep 2012 18:10:12 +0000 (11:10 -0700)

Merge branch 'ph/stash-rerere' into maint-1.7.11

* ph/stash-rerere:
stash: invoke rerere in case of conflict
test: git-stash conflict sets up rerere

Merge branch 'jc/maint-sane-execvp-notdir' into maint... Junio C Hamano Tue, 11 Sep 2012 18:09:19 +0000 (11:09 -0700)

Merge branch 'jc/maint-sane-execvp-notdir' into maint-1.7.11

* jc/maint-sane-execvp-notdir:
sane_execvp(): ignore non-directory on $PATH

Merge branch 'jc/maint-config-exit-status' into maint... Junio C Hamano Tue, 11 Sep 2012 18:09:09 +0000 (11:09 -0700)

Merge branch 'jc/maint-config-exit-status' into maint-1.7.11

* jc/maint-config-exit-status:
config: "git config baa" should exit with status 1

Merge branch 'mh/maint-config-doc-proxy-command' into... Junio C Hamano Tue, 11 Sep 2012 18:09:01 +0000 (11:09 -0700)

Merge branch 'mh/maint-config-doc-proxy-command' into maint-1.7.11

* mh/maint-config-doc-proxy-command:
git-config doc: unconfuse an example
git-config.txt: fix example

Merge branch 'hv/submodule-path-unmatch' into maint... Junio C Hamano Tue, 11 Sep 2012 18:08:55 +0000 (11:08 -0700)

Merge branch 'hv/submodule-path-unmatch' into maint-1.7.11

* hv/submodule-path-unmatch:
Let submodule command exit with error status if path does not exist

Merge branch 'mz/empty-rebase-test' into maint-1.7.11Junio C Hamano Tue, 11 Sep 2012 18:08:48 +0000 (11:08 -0700)

Merge branch 'mz/empty-rebase-test' into maint-1.7.11

* mz/empty-rebase-test:
add tests for 'git rebase --keep-empty'

Merge branch 'jk/docs-docbook-monospace-display' into... Junio C Hamano Tue, 11 Sep 2012 18:08:40 +0000 (11:08 -0700)

Merge branch 'jk/docs-docbook-monospace-display' into maint-1.7.11

* jk/docs-docbook-monospace-display:
docs: monospace listings in docbook output

Merge branch 'ab/diff-write-incomplete-line' into maint... Junio C Hamano Tue, 11 Sep 2012 18:08:30 +0000 (11:08 -0700)

Merge branch 'ab/diff-write-incomplete-line' into maint-1.7.11

* ab/diff-write-incomplete-line:
Fix '\ No newline...' annotation in rewrite diffs

Merge branch 'jc/maint-t7406-rev-parse-max-count-huh... Junio C Hamano Tue, 11 Sep 2012 18:08:18 +0000 (11:08 -0700)

Merge branch 'jc/maint-t7406-rev-parse-max-count-huh' into maint-1.7.11

* jc/maint-t7406-rev-parse-max-count-huh:
t7406: fix misleading "rev-parse --max-count=1 HEAD"

Merge branch 'rr/precompose-utf8-cleanup' into maintJunio C Hamano Tue, 11 Sep 2012 18:07:14 +0000 (11:07 -0700)

Merge branch 'rr/precompose-utf8-cleanup' into maint

* rr/precompose-utf8-cleanup:
precompose-utf8: do not call checks for non-ascii "utf8"
cleanup precompose_utf8

Merge branch 'jc/capabilities' into maintJunio C Hamano Tue, 11 Sep 2012 18:06:45 +0000 (11:06 -0700)

Merge branch 'jc/capabilities' into maint

* jc/capabilities:
fetch-pack: mention server version with verbose output
parse_feature_request: make it easier to see feature values
fetch-pack: do not ask for unadvertised capabilities
do not send client agent unless server does first
send-pack: fix capability-sending logic
include agent identifier in capability string

Merge branch 'jc/doc-git-updates' into maintJunio C Hamano Tue, 11 Sep 2012 18:06:19 +0000 (11:06 -0700)

Merge branch 'jc/doc-git-updates' into maint

* jc/doc-git-updates:
Documentation: update the introductory section

Merge branch 'jk/check-docs-update' into maintJunio C Hamano Tue, 11 Sep 2012 18:06:14 +0000 (11:06 -0700)

Merge branch 'jk/check-docs-update' into maint

* jk/check-docs-update:
check-docs: get documented command list from Makefile
check-docs: drop git-help special-case
check-docs: list git-gui as a command
check-docs: factor out command-list
command-list: mention git-credential-* helpers
command-list: add git-sh-i18n
check-docs: update non-command documentation list
check-docs: mention gitweb specially

Merge branch 'tr/void-diff-setup-done' into maint-1... Junio C Hamano Tue, 11 Sep 2012 17:53:40 +0000 (10:53 -0700)

Merge branch 'tr/void-diff-setup-done' into maint-1.7.11

* tr/void-diff-setup-done:
diff_setup_done(): return void

Merge branch 'tr/merge-recursive-flush' into maint... Junio C Hamano Tue, 11 Sep 2012 17:53:31 +0000 (10:53 -0700)

Merge branch 'tr/merge-recursive-flush' into maint-1.7.11

* tr/merge-recursive-flush:
merge-recursive: eliminate flush_buffer() in favor of write_in_full()

Merge branch 'nd/index-errno' into maint-1.7.11Junio C Hamano Tue, 11 Sep 2012 17:53:21 +0000 (10:53 -0700)

Merge branch 'nd/index-errno' into maint-1.7.11

* nd/index-errno:
read_index_from: remove bogus errno assignments

Merge branch 'pg/maint-apply-remove-unused-variable... Junio C Hamano Tue, 11 Sep 2012 17:53:11 +0000 (10:53 -0700)

Merge branch 'pg/maint-apply-remove-unused-variable' into maint-1.7.11

* pg/maint-apply-remove-unused-variable:
apply: delete unused deflate_origlen from patch struct

Merge branch 'jc/test-prereq' into maintJunio C Hamano Tue, 11 Sep 2012 17:51:58 +0000 (10:51 -0700)

Merge branch 'jc/test-prereq' into maint

* jc/test-prereq:
t3910: use the UTF8_NFD_TO_NFC test prereq
test-lib: provide UTF8 behaviour as a prerequisite
t0050: use the SYMLINKS test prereq
t0050: use the CASE_INSENSITIVE_FS test prereq
test-lib: provide case insensitivity as a prerequisite
test: allow prerequisite to be evaluated lazily
test: rename $satisfied to $satisfied_prereq

Start preparing for 1.7.12.1Junio C Hamano Mon, 10 Sep 2012 22:39:15 +0000 (15:39 -0700)

Start preparing for 1.7.12.1

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

Merge branch 'bc/prune-info' into maintJunio C Hamano Mon, 10 Sep 2012 22:37:37 +0000 (15:37 -0700)

Merge branch 'bc/prune-info' into maint

"git prune" without "-v" used to warn about leftover temporary
files (which is an indication of an earlier aborted operation).

* bc/prune-info:
prune.c: only print informational message in show_only or verbose mode

Merge branch 'maint-1.7.11' into maintJunio C Hamano Mon, 10 Sep 2012 22:31:06 +0000 (15:31 -0700)

Merge branch 'maint-1.7.11' into maint

* maint-1.7.11:
Almost 1.7.11.6
gitweb: URL-decode $my_url/$my_uri when stripping PATH_INFO
rebase -i: use full onto sha1 in reflog
sh-setup: protect from exported IFS
receive-pack: do not leak output from auto-gc to standard output
t/t5400: demonstrate breakage caused by informational message from prune
setup: clarify error messages for file/revisions ambiguity
send-email: improve RFC2047 quote parsing
fsck: detect null sha1 in tree entries
do not write null sha1s to on-disk index
diff: do not use null sha1 as a sentinel value

Almost 1.7.11.6Junio C Hamano Mon, 10 Sep 2012 22:30:46 +0000 (15:30 -0700)

Almost 1.7.11.6

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

Merge branch 'mg/rebase-i-onto-reflog-in-full' into... Junio C Hamano Mon, 10 Sep 2012 22:26:03 +0000 (15:26 -0700)

Merge branch 'mg/rebase-i-onto-reflog-in-full' into maint-1.7.11

The reflog entries left by "git rebase" and "git rebase -i" were
inconsistent (the interactive one gave an abbreviated object name).

* mg/rebase-i-onto-reflog-in-full:
rebase -i: use full onto sha1 in reflog

Merge branch 'jc/maint-protect-sh-from-ifs' into maint... Junio C Hamano Mon, 10 Sep 2012 22:25:45 +0000 (15:25 -0700)

Merge branch 'jc/maint-protect-sh-from-ifs' into maint-1.7.11

When the user exports a non-default IFS without HT, scripts that
rely on being able to parse "ls-files -s | while read a b c..."
start to fail. Protect them from such a misconfiguration.

* jc/maint-protect-sh-from-ifs:
sh-setup: protect from exported IFS

Merge branch 'bc/receive-pack-stdout-protection' into... Junio C Hamano Mon, 10 Sep 2012 22:25:09 +0000 (15:25 -0700)

Merge branch 'bc/receive-pack-stdout-protection' into maint-1.7.11

When "git push" triggered the automatic gc on the receiving end, a
message from "git prune" that said it was removing cruft leaked to
the standard output, breaking the communication protocol.

* bc/receive-pack-stdout-protection:
receive-pack: do not leak output from auto-gc to standard output
t/t5400: demonstrate breakage caused by informational message from prune

Merge branch 'jk/maint-null-in-trees' into maint-1... Junio C Hamano Mon, 10 Sep 2012 22:24:53 +0000 (15:24 -0700)

Merge branch 'jk/maint-null-in-trees' into maint-1.7.11

"git diff" had a confusion between taking data from a path in the
working tree and taking data from an object that happens to have
name 0{40} recorded in a tree.

* jk/maint-null-in-trees:
fsck: detect null sha1 in tree entries
do not write null sha1s to on-disk index
diff: do not use null sha1 as a sentinel value

Merge branch 'tr/maint-send-email-2047' into maint... Junio C Hamano Mon, 10 Sep 2012 22:24:40 +0000 (15:24 -0700)

Merge branch 'tr/maint-send-email-2047' into maint-1.7.11

"git send-email" did not unquote encoded words that appear on the
header correctly, and lost "_" from strings.

* tr/maint-send-email-2047:
send-email: improve RFC2047 quote parsing

Merge branch 'mm/die-with-dashdash-help' into maint... Junio C Hamano Mon, 10 Sep 2012 22:24:21 +0000 (15:24 -0700)

Merge branch 'mm/die-with-dashdash-help' into maint-1.7.11

When the user gives an argument that can be taken as both a
revision name and a pathname without disambiguating with "--", we
used to give a help message "Use '--' to separate". The message
has been clarified to show where that '--' goes on the command
line.

* mm/die-with-dashdash-help:
setup: clarify error messages for file/revisions ambiguity

Merge branch 'js/gitweb-path-info-unquote' into maint... Junio C Hamano Mon, 10 Sep 2012 22:23:46 +0000 (15:23 -0700)

Merge branch 'js/gitweb-path-info-unquote' into maint-1.7.11

"gitweb" when used with PATH_INFO failed to notice directories with
SP (and other characters that need URL-style quoting) in them.

* js/gitweb-path-info-unquote:
gitweb: URL-decode $my_url/$my_uri when stripping PATH_INFO

http: prompt for credentials on failed POSTJeff King Mon, 27 Aug 2012 13:27:15 +0000 (09:27 -0400)

http: prompt for credentials on failed POST

All of the smart-http GET requests go through the http_get_*
functions, which will prompt for credentials and retry if we
see an HTTP 401.

POST requests, however, do not go through any central point.
Moreover, it is difficult to retry in the general case; we
cannot assume the request body fits in memory or is even
seekable, and we don't know how much of it was consumed
during the attempt.

Most of the time, this is not a big deal; for both fetching
and pushing, we make a GET request before doing any POSTs,
so typically we figure out the credentials during the first
request, then reuse them during the POST. However, some
servers may allow a client to get the list of refs from
receive-pack without authentication, and then require
authentication when the client actually tries to POST the
pack.

This is not ideal, as the client may do a non-trivial amount
of work to generate the pack (e.g., delta-compressing
objects). However, for a long time it has been the
recommended example configuration in git-http-backend(1) for
setting up a repository with anonymous fetch and
authenticated push. This setup has always been broken
without putting a username into the URL. Prior to commit
986bbc0, it did work with a username in the URL, because git
would prompt for credentials before making any requests at
all. However, post-986bbc0, it is totally broken. Since it
has been advertised in the manpage for some time, we should
make sure it works.

Unfortunately, it is not as easy as simply calling post_rpc
again when it fails, due to the input issue mentioned above.
However, we can still make this specific case work by
retrying in two specific instances:

1. If the request is large (bigger than LARGE_PACKET_MAX),
we will first send a probe request with a single flush
packet. Since this request is static, we can freely
retry it.

2. If the request is small and we are not using gzip, then
we have the whole thing in-core, and we can freely
retry.

That means we will not retry in some instances, including:

1. If we are using gzip. However, we only do so when
calling git-upload-pack, so it does not apply to
pushes.

2. If we have a large request, the probe succeeds, but
then the real POST wants authentication. This is an
extremely unlikely configuration and not worth worrying
about.

While it might be nice to cover those instances, doing so
would be significantly more complex for very little
real-world gain. In the long run, we will be much better off
when curl learns to internally handle authentication as a
callback, and we can cleanly handle all cases that way.

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

http: factor out http error code handlingJeff King Mon, 27 Aug 2012 13:26:04 +0000 (09:26 -0400)

http: factor out http error code handling

Most of our http requests go through the http_request()
interface, which does some nice post-processing on the
results. In particular, it handles prompting for missing
credentials as well as approving and rejecting valid or
invalid credentials. Unfortunately, it only handles GET
requests. Making it handle POSTs would be quite complex, so
let's pull result handling code into its own function so
that it can be reused from the POST code paths.

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

t: test http access to "half-auth" repositoriesJeff King Mon, 27 Aug 2012 13:25:53 +0000 (09:25 -0400)

t: test http access to "half-auth" repositories

Some sites set up http access to repositories such that
fetching is anonymous and unauthenticated, but pushing is
authenticated. While there are multiple ways to do this, the
technique advertised in the git-http-backend manpage is to
block access to locations matching "/git-receive-pack$".

Let's emulate that advice in our test setup, which makes it
clear that this advice does not actually work.

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

t: test basic smart-http authenticationJeff King Mon, 27 Aug 2012 13:25:36 +0000 (09:25 -0400)

t: test basic smart-http authentication

We do not currently test authentication over smart-http at
all. In theory, it should work exactly as it does for dumb
http (which we do test). It does indeed work for these
simple tests, but this patch lays the groundwork for more
complex tests in future patches.

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

t/lib-httpd: recognize */smart/* repos as smart-httpJeff King Mon, 27 Aug 2012 13:25:21 +0000 (09:25 -0400)

t/lib-httpd: recognize */smart/* repos as smart-http

We do not currently test authentication for smart-http repos
at all. Part of the infrastructure to do this is recognizing
that auth/smart is indeed a smart-http repo.

The current apache config recognizes only "^/smart/*" as
smart-http. Let's instead treat anything with /smart/ in the
URL as smart-http. This is obviously a stupid thing to do
for a real production site, but for our test suite we know
that our repositories will not have this magic string in the
name.

Note that we will route /foo/smart/bar.git directly to
git-http-backend/bar.git; in other words, everything before
the "/smart/" is irrelevant to finding the repo on disk (but
may impact apache config, for example by triggering auth
checks).

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

t/lib-httpd: only route auth/dumb to dumb reposJeff King Mon, 27 Aug 2012 13:24:42 +0000 (09:24 -0400)

t/lib-httpd: only route auth/dumb to dumb repos

Our test apache config points all of auth/ directly to the
on-disk repositories via an Alias directive. This works fine
because everything authenticated is currently in auth/dumb,
which is a subset. However, this would conflict with a
ScriptAlias for auth/smart (which will come in future
patches), so let's narrow the Alias.

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

t5550: factor out http auth setupJeff King Mon, 27 Aug 2012 13:24:31 +0000 (09:24 -0400)

t5550: factor out http auth setup

The t5550 script sets up a nice askpass helper for
simulating user input and checking what git prompted for.
Let's make it available to other http scripts by migrating
it to lib-httpd.

We can use this immediately in t5540 to make our tests more
robust (previously, we did not check at all that hitting the
password-protected repo actually involved a password).
Unfortunately, we end up failing the test because the
current code erroneously prompts twice (once for
git-remote-http, and then again when the former spawns
git-http-push).

More importantly, though, it will let us easily add
smart-http authentication tests in t5541 and t5551; we
currently do not test smart-http authentication at all.

As part of making it generic, let's always look for and
store auxiliary askpass files at the top-level trash
directory; this makes it compatible with t5540, which runs
some tests from sub-repositories. We can abstract away the
ugliness with a short helper function.

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

t5550: put auth-required repo in auth/dumbJeff King Mon, 27 Aug 2012 13:23:37 +0000 (09:23 -0400)

t5550: put auth-required repo in auth/dumb

In most of our tests, we put repos to be accessed by dumb
protocols in /dumb, and repos to be accessed by smart
protocols in /smart. In our test apache setup, the whole
/auth hierarchy requires authentication. However, we don't
bother to split it by smart and dumb here because we are not
currently testing smart-http authentication at all.

That will change in future patches, so let's be explicit
that we are interested in testing dumb access here. This
also happens to match what t5540 does for the push tests.

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

doc: "git checkout -b/-B/--orphan" always takes a branc... Junio C Hamano Sun, 26 Aug 2012 18:40:08 +0000 (11:40 -0700)

doc: "git checkout -b/-B/--orphan" always takes a branch name

While the synopsis section makes it clear that the new branch name
is the parameter to these flags, the option description did not.

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

apply: compute patch->def_name correctly under -p0Junio C Hamano Sat, 25 Aug 2012 05:48:55 +0000 (22:48 -0700)

apply: compute patch->def_name correctly under -p0

Back when "git apply" was written, we made sure that the user can
skip more than the default number of path components (i.e. 1) by
giving "-p<n>", but the logic for doing so was built around the
notion of "we skip N slashes and stop". This obviously does not
work well when running under -p0 where we do not want to skip any,
but still want to skip SP/HT that separates the pathnames of
preimage and postimage and want to reject absolute pathnames.

Stop using "stop_at_slash()", and instead introduce a new helper
"skip_tree_prefix()" with similar logic but works correctly even for
the -p0 case.

This is an ancient bug, but has been masked for a long time because
most of the patches are text and have other clues to tell us the
name of the preimage and the postimage.

Noticed by Colin McCabe.

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

Merge branch 'maint-1.7.11' into maintJunio C Hamano Fri, 24 Aug 2012 19:34:19 +0000 (12:34 -0700)

Merge branch 'maint-1.7.11' into maint

* maint-1.7.11:
Prepare for 1.7.11.6
Make the ciabot scripts completely self-configuring in the normal case.
Improved documentation for the ciabot scripts.
man: git pull -r is a short for --rebase
gitcli: describe abbreviation of long options
rev-list docs: clarify --topo-order description
Documentation/CodingGuidelines: spell out more shell guidelines
Documentation: do not mention .git/refs/* directories
tests: Introduce test_seq

Prepare for 1.7.11.6Junio C Hamano Fri, 24 Aug 2012 19:33:31 +0000 (12:33 -0700)

Prepare for 1.7.11.6

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

Merge branch 'mv/pull-r-for-rebase' into maint-1.7.11Junio C Hamano Fri, 24 Aug 2012 19:05:47 +0000 (12:05 -0700)

Merge branch 'mv/pull-r-for-rebase' into maint-1.7.11

A minor documentation update.

* mv/pull-r-for-rebase:
man: git pull -r is a short for --rebase

Merge branch 'jc/maint-abbrev-option-cli' into maint... Junio C Hamano Fri, 24 Aug 2012 19:05:44 +0000 (12:05 -0700)

Merge branch 'jc/maint-abbrev-option-cli' into maint-1.7.11

We did not document that many commands take unique prefix
abbreviations of long options (e.g. "--option" may be the only flag
that the command accepts that begin with "--opt", in which case you
can give "--opt") anywhere easy to find for new people.

* jc/maint-abbrev-option-cli:
gitcli: describe abbreviation of long options

Merge branch 'jc/maint-rev-list-topo-doc' into maint... Junio C Hamano Fri, 24 Aug 2012 19:05:40 +0000 (12:05 -0700)

Merge branch 'jc/maint-rev-list-topo-doc' into maint-1.7.11

It was unclear what "--topo-order" was really about in the
documentation. It is not just about "children before parent", but
also about "don't mix lineages".

* jc/maint-rev-list-topo-doc:
rev-list docs: clarify --topo-order description

Merge branch 'hv/coding-guidelines' into maint-1.7.11Junio C Hamano Fri, 24 Aug 2012 19:05:35 +0000 (12:05 -0700)

Merge branch 'hv/coding-guidelines' into maint-1.7.11

In earlier days, "imitate the style in the neibouring code" was
sufficient to keep the coherent style, but over time some parts of
the codebase have drifted enough to make it ineffective.

* hv/coding-guidelines:
Documentation/CodingGuidelines: spell out more shell guidelines

Merge branch 'jc/tag-doc' into maint-1.7.11Junio C Hamano Fri, 24 Aug 2012 19:05:30 +0000 (12:05 -0700)

Merge branch 'jc/tag-doc' into maint-1.7.11

Our documentation used to assume having files in .git/refs/*
directories was the only to have branches and tags, but that is not
true for quite some time.

* jc/tag-doc:
Documentation: do not mention .git/refs/* directories

Merge branch 'mk/test-seq' into maint-1.7.11Junio C Hamano Fri, 24 Aug 2012 19:05:24 +0000 (12:05 -0700)

Merge branch 'mk/test-seq' into maint-1.7.11

Add a compatibility/utility function to the test framework.

* mk/test-seq:
tests: Introduce test_seq

Merge branch 'lp/no-cmd-http-fetch' into maint-1.7.11Junio C Hamano Fri, 24 Aug 2012 19:05:19 +0000 (12:05 -0700)

Merge branch 'lp/no-cmd-http-fetch' into maint-1.7.11

* lp/no-cmd-http-fetch:
builtin.h: remove unused cmd_<foo> declarations

Merge branch 'bw/maint-1.7.9-solaris-getpass' into... Junio C Hamano Fri, 24 Aug 2012 19:05:11 +0000 (12:05 -0700)

Merge branch 'bw/maint-1.7.9-solaris-getpass' into maint-1.7.11

* bw/maint-1.7.9-solaris-getpass:
Enable HAVE_DEV_TTY for Solaris
terminal: seek when switching between reading and writing

Merge branch 'jk/maint-commit-check-committer-early... Junio C Hamano Fri, 24 Aug 2012 19:05:08 +0000 (12:05 -0700)

Merge branch 'jk/maint-commit-check-committer-early' into maint-1.7.11

* jk/maint-commit-check-committer-early:
commit: check committer identity more strictly

sha1_file.c: introduce get_max_fd_limit() helperJoachim Schmitz Fri, 24 Aug 2012 09:52:22 +0000 (11:52 +0200)

sha1_file.c: introduce get_max_fd_limit() helper

Not all platforms have getrlimit(), but there are other ways to see
the maximum number of files that a process can have open. If
getrlimit() is unavailable, fall back to sysconf(_SC_OPEN_MAX) if
available, and use OPEN_MAX from <limits.h>.

Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make 'git submodule update --force' always check out... Stefan Zager Wed, 25 Jul 2012 17:41:54 +0000 (10:41 -0700)

Make 'git submodule update --force' always check out submodules.

Currently, it will only do a checkout if the sha1 registered in the containing
repository doesn't match the HEAD of the submodule, regardless of whether the
submodule is dirty. As discussed on the mailing list, the '--force' flag is a
strong indicator that the state of the submodule is suspect, and should be reset
to HEAD.

Signed-off-by: Stefan Zager <szager@google.com>
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetool: style fixesJunio C Hamano Thu, 23 Aug 2012 05:33:15 +0000 (22:33 -0700)

mergetool: style fixes

This script is one of the sizeable ones that tempted people to copy
its "neibouring style" in their new code, but was littered with
styles incompatible with our style guide.

- use one tab, not four spaces, per indent level;

- long lines can be wrapped after '|', '&&', or '||' for
readability.

- structures like "if .. then .. else .. fi", "while .. do .. done"
are split into lines in such a way that does not require
unnecessary semicolon.

- case, esac and case-arms align at the same column.

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

Make the ciabot scripts completely self-configuring... Eric S. Raymond Thu, 23 Aug 2012 05:21:53 +0000 (01:21 -0400)

Make the ciabot scripts completely self-configuring in the normal case.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improved documentation for the ciabot scripts.Eric S. Raymond Thu, 23 Aug 2012 04:10:53 +0000 (00:10 -0400)

Improved documentation for the ciabot scripts.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

specifying ranges: we did not mean to make ".." an... Junio C Hamano Mon, 2 May 2011 20:39:16 +0000 (13:39 -0700)

specifying ranges: we did not mean to make ".." an empty set

Either end of revision range operator can be omitted to default to HEAD,
as in "origin.." (what did I do since I forked) or "..origin" (what did
they do since I forked). But the current parser interprets ".." as an
empty range "HEAD..HEAD", and worse yet, because ".." does exist on the
filesystem, we get this annoying output:

$ cd Documentation/howto
$ git log .. ;# give me recent commits that touch Documentation/ area.
fatal: ambiguous argument '..': both revision and filename
Use '--' to separate filenames from revisions

Surely we could say "git log ../" or even "git log -- .." to disambiguate,
but we shouldn't have to.

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

http.c: don't use curl_easy_strerror prior to curl... Joachim Schmitz Thu, 23 Aug 2012 07:33:55 +0000 (09:33 +0200)

http.c: don't use curl_easy_strerror prior to curl-7.12.0

Reverts be22d92 (http: avoid empty error messages for some curl
errors, 2011-09-05) on platforms with older versions of libcURL
where the function is not available.

Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3910: use the UTF8_NFD_TO_NFC test prereqMichael J Gruber Mon, 30 Jul 2012 09:57:18 +0000 (11:57 +0200)

t3910: use the UTF8_NFD_TO_NFC test prereq

Besides reusing the new test prerequisite, this fixes also the issue
that the current output is not TAP compliant and produces the output "no
reason given" [for skipping].

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

Merge branch 'maint-1.7.11' into maintJunio C Hamano Wed, 22 Aug 2012 18:27:30 +0000 (11:27 -0700)

Merge branch 'maint-1.7.11' into maint

* maint-1.7.11:
contrib/ciabot: Get ciabot configuration from git variables

contrib/ciabot: Get ciabot configuration from git variablesEric S. Raymond Wed, 22 Aug 2012 10:52:30 +0000 (06:52 -0400)

contrib/ciabot: Get ciabot configuration from git variables

These changes remove all need to modify the ciabot scripts for installation.
Instead, per-project configuration can be dome via variables in a [ciabot]
section of the config file.

Also, correct for the new server address.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

for-each-ref: Fix sort with multiple keysKacper Kornet Tue, 21 Aug 2012 07:47:26 +0000 (09:47 +0200)

for-each-ref: Fix sort with multiple keys

The linked list describing sort options was not correctly set up in
opt_parse_sort. In the result, contrary to the documentation, only the
last of multiple --sort options to git-for-each-ref was taken into
account. This commit fixes it.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6300: test sort with multiple keysKacper Kornet Tue, 21 Aug 2012 07:46:06 +0000 (09:46 +0200)

t6300: test sort with multiple keys

Documentation of git-for-each-ref says that --sort=<key> option can be
used multiple times, in which case the last key becomes the primary key.
However this functionality was never checked in test suite and is
currently broken. This commit adds appropriate test in preparation for fix.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

precompose-utf8: do not call checks for non-ascii ... Junio C Hamano Mon, 20 Aug 2012 18:12:58 +0000 (11:12 -0700)

precompose-utf8: do not call checks for non-ascii "utf8"

As suggested by Linus, this function is not checking UTF-8-ness of the
string; it only is seeing if it is pure US-ASCII.

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

Git 1.7.12 v1.7.12Junio C Hamano Mon, 20 Aug 2012 00:02:11 +0000 (17:02 -0700)

Git 1.7.12

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

git-config doc: unconfuse an exampleJunio C Hamano Sat, 18 Aug 2012 23:35:09 +0000 (16:35 -0700)

git-config doc: unconfuse an example

One fictitious command "proxy-command" is enclosed inside a double
quote pair, while another fictitious command "default-proxy" is not
in the example, but the quoting does not change anything in the pair
of examples. Remove the quotes to avoid unnecessary confusion.

Noticed by Michael Haggerty.

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

git-config.txt: fix exampleMichael Haggerty Sat, 18 Aug 2012 17:32:10 +0000 (19:32 +0200)

git-config.txt: fix example

The "--add" option is required to add a new value to a multivalued
configuration entry.

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

Merge branch 'jc/doc-git-updates' (early part)Junio C Hamano Fri, 17 Aug 2012 20:27:10 +0000 (13:27 -0700)

Merge branch 'jc/doc-git-updates' (early part)

* 'jc/doc-git-updates' (early part):
Documentation: update URL for formatted pages

Documentation: update the introductory sectionJunio C Hamano Fri, 17 Aug 2012 19:48:52 +0000 (12:48 -0700)

Documentation: update the introductory section

The second paragraph in the git(1) description section were meant to
guide people who are not ready to dive into this page away from here.
Referring migrating CVS users to another page before they get
acquainted with Git was somewhat out of place. Move the reference to
the "FURTHER DOCUMENTATION" section and push that section down.

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

Documentation: update URL for formatted pagesJunio C Hamano Fri, 17 Aug 2012 19:14:57 +0000 (12:14 -0700)

Documentation: update URL for formatted pages

The one at kernel.org has not been updated for quite a while and
can no longer be called "the latest".

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

stash: invoke rerere in case of conflictPhil Hord Tue, 10 Jul 2012 22:52:28 +0000 (18:52 -0400)

stash: invoke rerere in case of conflict

"stash apply" directly calls a backend merge function which does not
automatically invoke rerere. This confuses mergetool when leftover
rerere state is left behind from previous merges.

Invoke rerere explicitly when we encounter a conflict during stash
apply. This turns the test introduced by the previous commit to
succeed.

Signed-off-by: Phil Hord <hordp@cisco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test: git-stash conflict sets up rererePhil Hord Tue, 10 Jul 2012 22:52:27 +0000 (18:52 -0400)

test: git-stash conflict sets up rerere

Add a test to make sure that a conflicted "stash apply" invokes
rerere to record the conflicts and resolve the the files it can
(the current code doesn't, so the test is marked as failing).

Without correct state recorded for rerere, mergetool may be
confused, causing it to think no files have conflicts even though
they do. This condition is not verified by this test since a
subsequent commit will change the behavior to enable rerere for
stash conflicts.

Also, the next test expected us to finish up with a reset, which is
impossible to do if we fail (as we must) and it's an unreasonable
expectation anyway. Begin the next test with a reset of its own
instead.

Signed-off-by: Phil Hord <hordp@cisco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cleanup precompose_utf8Robin Rosenberg Fri, 17 Aug 2012 14:53:10 +0000 (16:53 +0200)

cleanup precompose_utf8

- Remove extraneous parentheses and braces;

- Remove redundant NUL-termination before strcpy();

- Check result of unlink when probing for decomposed file names;

- Adjust for the coding style by adding missing whitespaces;

- Move storage class "static" at the beginning of the decl.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

man: git pull -r is a short for --rebaseMiklos Vajna Thu, 16 Aug 2012 09:50:18 +0000 (11:50 +0200)

man: git pull -r is a short for --rebase

Letting the "--rebase" option squat on the short-and-sweet single
letter option "-r" was an unintended accident and was not even
documented, but the short option seems to be already used in the
wild. Let's document it so that other options that begin with "r"
would not be tempted to steal it.

Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitcli: describe abbreviation of long optionsJunio C Hamano Fri, 17 Aug 2012 06:16:22 +0000 (23:16 -0700)

gitcli: describe abbreviation of long options

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

Merge git://github.com/git-l10n/git-po to update Swedis... Junio C Hamano Fri, 17 Aug 2012 03:13:45 +0000 (20:13 -0700)

Merge git://github.com/git-l10n/git-po to update Swedish translation

* git://github.com/git-l10n/git-po:
l10n: Fixes to Swedish translation

l10n: Fixes to Swedish translationPeter Krefting Tue, 14 Aug 2012 08:58:14 +0000 (09:58 +0100)

l10n: Fixes to Swedish translation

Tersify texts overflowing an 80-character terminal.
Fix spelling mistakes.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

Git 1.7.12-rc3 v1.7.12-rc3Junio C Hamano Wed, 15 Aug 2012 20:46:16 +0000 (13:46 -0700)

Git 1.7.12-rc3

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

Sync with 1.7.11.5Junio C Hamano Wed, 15 Aug 2012 20:41:17 +0000 (13:41 -0700)

Sync with 1.7.11.5

Git 1.7.11.5 v1.7.11.5Junio C Hamano Wed, 15 Aug 2012 20:39:53 +0000 (13:39 -0700)

Git 1.7.11.5

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

Merge branch 'rj/maint-grep-remove-redundant-test'... Junio C Hamano Wed, 15 Aug 2012 20:37:20 +0000 (13:37 -0700)

Merge branch 'rj/maint-grep-remove-redundant-test' into maint

* rj/maint-grep-remove-redundant-test:
t7810-*.sh: Remove redundant test

Merge branch 'hv/link-alt-odb-entry' into maintJunio C Hamano Wed, 15 Aug 2012 20:36:47 +0000 (13:36 -0700)

Merge branch 'hv/link-alt-odb-entry' into maint

* hv/link-alt-odb-entry:
link_alt_odb_entry: fix read over array bounds reported by valgrind

rev-list docs: clarify --topo-order descriptionJunio C Hamano Wed, 15 Aug 2012 20:02:48 +0000 (13:02 -0700)

rev-list docs: clarify --topo-order description

It was unclear what "--topo-order" was really about in the
documentation. It is not just about "children before parent", but
also about "don't mix lineages".

Reword the description for both "--date-order" and "--topo-order",
and add an illustration to it.

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

gitweb: URL-decode $my_url/$my_uri when stripping PATH_INFOJay Soffian Thu, 9 Aug 2012 02:29:26 +0000 (22:29 -0400)

gitweb: URL-decode $my_url/$my_uri when stripping PATH_INFO

When gitweb is used as a DirectoryIndex, it attempts to strip
PATH_INFO on its own, as $cgi->url() fails to do so.

However, it fails to account for the fact that PATH_INFO has
already been URL-decoded by the web server, but the value
returned by $cgi->url() has not been. This causes the stripping
to fail whenever the URL contains encoded characters.

To see this in action, setup gitweb as a DirectoryIndex and
then use it on a repository with a directory containing a
space in the name. Navigate to tree view, examine the gitweb
generated html and you'll see a link such as:

<a href="/test.git/tree/HEAD:/directory with spaces">directory with spaces</a>

When clicked on, the browser will URL-encode this link, giving
a $cgi->url() of the form:

/test.git/tree/HEAD:/directory%20with%20spaces

While PATH_INFO is:

/test.git/tree/HEAD:/directory with spaces

Fix this by calling unescape() on both $my_url and $my_uri before
stripping PATH_INFO from them.

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

Documentation/CodingGuidelines: spell out more shell... Heiko Voigt Wed, 15 Aug 2012 17:06:01 +0000 (19:06 +0200)

Documentation/CodingGuidelines: spell out more shell guidelines

In earlier days, "imitate the style in the neibouring code" was
sufficient to keep the coherent style, but over time some parts of
the codebase have drifted enough to make it ineffective.

Spell some of the guidelines out.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Let submodule command exit with error status if path... Heiko Voigt Tue, 14 Aug 2012 20:35:27 +0000 (22:35 +0200)

Let submodule command exit with error status if path does not exist

Various subcommands of the "git submodule" command exited with 0
status even though the path given by the user did not exist.

The reason behind that was that they all pipe the output of
module_list into the while loop which then does the action on the
paths specified by the commandline. Since the exit code of the
command on the upstream side of the pipe is ignored by the shell,
the status code of "ls-files --error-unmatch" nor "module_list" was
not propagated.

In case ls-files returns with an error code, we write a special
string that is not possible in non error situations, and no other
output, so that the downstream can detect the error and die with an
error code.

The error message that there is an unmatched pathspec comes through
stderr directly from ls-files. So the user still gets a hint whats going
on.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch-pack: mention server version with verbose outputJeff King Tue, 14 Aug 2012 02:02:10 +0000 (22:02 -0400)

fetch-pack: mention server version with verbose output

Fetch-pack's verbose mode is more of a debugging mode (and
in fact takes two "-v" arguments to trigger via the
porcelain layer). Let's mention the server version as
another possible item of interest.

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

parse_feature_request: make it easier to see feature... Jeff King Tue, 14 Aug 2012 01:59:27 +0000 (21:59 -0400)

parse_feature_request: make it easier to see feature values

We already take care to parse key/value capabilities like
"foo=bar", but the code does not provide a good way of
actually finding out what is on the right-hand side of the
"=".

A server using "parse_feature_request" could accomplish this
with some extra parsing. You must skip past the "key"
portion manually, check for "=" versus NUL or space, and
then find the length by searching for the next space (or
NUL). But clients can't even do that, since the
"server_supports" interface does not even return the
pointer.

Instead, let's have our parser share more information by
providing a pointer to the value and its length. The
"parse_feature_value" function returns a pointer to the
feature's value portion, along with the length of the value.
If the feature is missing, NULL is returned. If it does not
have an "=", then a zero-length value is returned.

Similarly, "server_feature_value" behaves in the same way,
but always checks the static server_feature_list variable.

We can then implement "server_supports" in terms of
"server_feature_value". We cannot implement the original
"parse_feature_request" in terms of our new function,
because it returned a pointer to the beginning of the
feature. However, no callers actually cared about the value
of the returned pointer, so we can simplify it to a boolean
just as we do for "server_supports".

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