OSDN Git Service

git-core/git.git
10 years agoMerge branch 'jk/http-auth-redirects' into maint
Junio C Hamano [Fri, 8 Nov 2013 19:37:25 +0000 (11:37 -0800)]
Merge branch 'jk/http-auth-redirects' into maint

We did not handle cases where http transport gets redirected during
the authorization request (e.g. from http:// to https://).

* jk/http-auth-redirects:
  http.c: Spell the null pointer as NULL
  remote-curl: rewrite base url from info/refs redirects
  remote-curl: store url as a strbuf
  remote-curl: make refs_url a strbuf
  http: update base URLs when we see redirects
  http: provide effective url to callers
  http: hoist credential request out of handle_curl_result
  http: refactor options to http_get_*
  http_request: factor out curlinfo_strbuf
  http_get_file: style fixes

10 years agoStart preparing for 1.8.4.3
Junio C Hamano [Thu, 7 Nov 2013 22:39:47 +0000 (14:39 -0800)]
Start preparing for 1.8.4.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'sc/doc-howto-dumb-http' into maint
Junio C Hamano [Thu, 7 Nov 2013 22:37:39 +0000 (14:37 -0800)]
Merge branch 'sc/doc-howto-dumb-http' into maint

An ancient How-To on serving Git repositories on an HTTP server
lacked a warning that it has been mostly superseded with more
modern way.

* sc/doc-howto-dumb-http:
  doc/howto: warn about (dumb)http server document being too old

10 years agoMerge branch 'vd/doc-unpack-objects' into maint
Junio C Hamano [Thu, 7 Nov 2013 22:37:35 +0000 (14:37 -0800)]
Merge branch 'vd/doc-unpack-objects' into maint

The synopsis section of "git unpack-objects" documentation has been
clarified a bit.

* vd/doc-unpack-objects:
  Documentation: "pack-file" is not literal in unpack-objects
  Documentation: restore a space in unpack-objects usage

10 years agoMerge branch 'jk/subtree-install-fix' into maint
Junio C Hamano [Thu, 7 Nov 2013 22:37:17 +0000 (14:37 -0800)]
Merge branch 'jk/subtree-install-fix' into maint

We did not generate HTML version of documentation to "git subtree"
in contrib/.

* jk/subtree-install-fix:
  subtree: add makefile target for html docs

10 years agoMerge branch 'hn/log-graph-color-octopus' into maint
Junio C Hamano [Thu, 7 Nov 2013 22:37:11 +0000 (14:37 -0800)]
Merge branch 'hn/log-graph-color-octopus' into maint

Coloring around octopus merges in "log --graph" output was screwy.

* hn/log-graph-color-octopus:
  graph: fix coloring around octopus merges

10 years agoMerge branch 'mm/checkout-auto-track-fix' into maint
Junio C Hamano [Thu, 7 Nov 2013 22:36:59 +0000 (14:36 -0800)]
Merge branch 'mm/checkout-auto-track-fix' into maint

"git checkout topic", when there is not yet a local "topic" branch
but there is a unique remote-tracking branch for a remote "topic"
branch, pretended as if "git checkout -t -b topic remote/$r/topic"
(for that unique remote $r) was run. This hack however was not
implemented for "git checkout topic --".

* mm/checkout-auto-track-fix:
  checkout: proper error message on 'git checkout foo bar --'
  checkout: allow dwim for branch creation for "git checkout $branch --"

10 years agoMerge branch 'sg/prompt-svn-remote-fix' into maint
Junio C Hamano [Thu, 7 Nov 2013 22:36:45 +0000 (14:36 -0800)]
Merge branch 'sg/prompt-svn-remote-fix' into maint

Bash prompting code to deal with an SVN remote as an upstream
were coded in a way not supported by older Bash versions (3.x).

* sg/prompt-svn-remote-fix:
  bash prompt: don't use '+=' operator in show upstream code path

10 years agoMerge branch 'jk/split-broken-ident' into maint
Junio C Hamano [Thu, 7 Nov 2013 22:34:51 +0000 (14:34 -0800)]
Merge branch 'jk/split-broken-ident' into maint

The fall-back parsing of commit objects with broken author or
committer lines were less robust than ideal in picking up the
timestamps.

* jk/split-broken-ident:
  split_ident: parse timestamp from end of line

10 years agoMerge branch 'jc/revision-range-unpeel' into maint
Junio C Hamano [Thu, 7 Nov 2013 22:34:14 +0000 (14:34 -0800)]
Merge branch 'jc/revision-range-unpeel' into maint

"git rev-list --objects ^v1.0^ v1.0" gave v1.0 tag itself in the
output, but "git rev-list --objects v1.0^..v1.0" did not.

* jc/revision-range-unpeel:
  revision: do not peel tags used in range notation

10 years agogitignore.txt: fix documentation of "**" patterns
Karsten Blees [Thu, 7 Nov 2013 16:30:47 +0000 (17:30 +0100)]
gitignore.txt: fix documentation of "**" patterns

"**" means bold in ASCIIDOC, so we need to escape it.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoDocumentation: "pack-file" is not literal in unpack-objects
Vivien Didelot [Fri, 1 Nov 2013 15:42:43 +0000 (11:42 -0400)]
Documentation: "pack-file" is not literal in unpack-objects

Make it clear that "pack-file" is not to be spelled as is in the
unpack-objects usage.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoDocumentation: restore a space in unpack-objects usage
Vivien Didelot [Thu, 31 Oct 2013 21:41:11 +0000 (17:41 -0400)]
Documentation: restore a space in unpack-objects usage

The commit 87b7b84 removed a space in the unpack-objects usage, which
makes the synopsis a bit confusing. This patch simply restores it.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosubtree: add makefile target for html docs
Jeff King [Tue, 29 Oct 2013 16:30:37 +0000 (12:30 -0400)]
subtree: add makefile target for html docs

The Makefile currently builds the roff manpage, but not the
html form. As some people may prefer the latter, let's make
it an option to build that, too. We also wire it into "make
doc" so that it is built by default.

This patch does not build or install it as part of
"install-doc"; that would require extra infrastructure to
handle installing the html as we do in git's regular
Documentation/ tree. That can come later if somebody is
interested.

Tested-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot5570: Update for clone-progress-to-stderr branch
Brian Gernhardt [Mon, 21 Oct 2013 17:54:12 +0000 (13:54 -0400)]
t5570: Update for clone-progress-to-stderr branch

git clone now reports its progress to standard error, which throws off
t5570.  Using test_i18ngrep instead of test_cmp allows the test to be
more flexible by only looking for the expected error and ignoring any
other output from the program.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agodoc/howto: warn about (dumb)http server document being too old
Sitaram Chamarty [Sat, 21 Sep 2013 02:23:06 +0000 (07:53 +0530)]
doc/howto: warn about (dumb)http server document being too old

Describe when it is still applicable, and tell people where to go
for most normal cases.

Signed-off-by: Sitaram Chamarty <sitaram@atc.tcs.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoGit 1.8.4.2 v1.8.4.2
Junio C Hamano [Mon, 28 Oct 2013 17:21:29 +0000 (10:21 -0700)]
Git 1.8.4.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'jk/clone-progress-to-stderr' into maint
Junio C Hamano [Mon, 28 Oct 2013 17:19:24 +0000 (10:19 -0700)]
Merge branch 'jk/clone-progress-to-stderr' into maint

"git clone" gave some progress messages to the standard output, not to
the standard error, and did not allow suppressing them with the
"--no-progress" option.

* jk/clone-progress-to-stderr:
  clone: always set transport options
  clone: treat "checking connectivity" like other progress
  clone: send diagnostic messages to stderr

10 years agoMerge branch 'jk/format-patch-from' into maint
Junio C Hamano [Mon, 28 Oct 2013 17:18:43 +0000 (10:18 -0700)]
Merge branch 'jk/format-patch-from' into maint

"format-patch --from=<whom>" forgot to omit unnecessary in-body from
line, i.e. when <whom> is the same as the real author.

* jk/format-patch-from:
  format-patch: print in-body "From" only when needed

10 years agoMerge branch 'jk/shortlog-tolerate-broken-commit' into maint
Junio C Hamano [Mon, 28 Oct 2013 17:17:31 +0000 (10:17 -0700)]
Merge branch 'jk/shortlog-tolerate-broken-commit' into maint

"git shortlog" used to choke and die when there is a malformed commit
(e.g. missing authors); it now simply ignore such a commit and keeps
going.

* jk/shortlog-tolerate-broken-commit:
  shortlog: ignore commits with missing authors

10 years agoMerge branch 'jk/diff-algo' into maint
Junio C Hamano [Mon, 28 Oct 2013 17:16:11 +0000 (10:16 -0700)]
Merge branch 'jk/diff-algo' into maint

"git merge-recursive" did not parse its "--diff-algorithm=" command
line option correctly.

* jk/diff-algo:
  merge-recursive: fix parsing of "diff-algorithm" option

10 years agotest-lib: fix typo in comment
Torstein Hegge [Sun, 27 Oct 2013 09:56:33 +0000 (10:56 +0100)]
test-lib: fix typo in comment

Point test writers to the test_expect_* functions properly.

Signed-off-by: Torstein Hegge <hegge@resisty.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosha1_file: move comment about return value where it belongs
Christian Couder [Sat, 26 Oct 2013 22:34:30 +0000 (00:34 +0200)]
sha1_file: move comment about return value where it belongs

Commit 5b0864070 (sha1_object_info_extended: make type calculation
optional, Jul 12 2013) changed the return value of the
sha1_object_info_extended function to 0/-1 for success/error.

Previously this function returned the object type for success or
-1 for error. But unfortunately the above commit forgot to change
or move the comment above this function that says "returns enum
object_type or negative".

To fix this inconsistency, let's move the comment above the
sha1_object_info function where it is still true.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agohttp.c: Spell the null pointer as NULL
Ramsay Jones [Thu, 24 Oct 2013 20:17:19 +0000 (21:17 +0100)]
http.c: Spell the null pointer as NULL

Commit 1bbcc224 ("http: refactor options to http_get_*", 28-09-2013)
changed the type of final 'options' argument of the http_get_file()
function from an int to an 'struct http_get_options' pointer.
However, it neglected to update the (single) call site. Since this
call was passing '0' to that argument, it was (correctly) being
interpreted as a null pointer. Change to argument to NULL.

Noticed by sparse. ("Using plain integer as NULL pointer")

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoAlmost 1.8.4.2 ;-)
Junio C Hamano [Wed, 23 Oct 2013 20:34:39 +0000 (13:34 -0700)]
Almost 1.8.4.2 ;-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'jc/ls-files-killed-optim' into maint
Junio C Hamano [Wed, 23 Oct 2013 20:33:08 +0000 (13:33 -0700)]
Merge branch 'jc/ls-files-killed-optim' into maint

"git ls-files -k" needs to crawl only the part of the working tree
that may overlap the paths in the index to find killed files, but
shared code with the logic to find all the untracked files, which
made it unnecessarily inefficient.

* jc/ls-files-killed-optim:
  dir.c::test_one_path(): work around directory_exists_in_index_icase() breakage
  t3010: update to demonstrate "ls-files -k" optimization pitfalls
  ls-files -k: a directory only can be killed if the index has a non-directory
  dir.c: use the cache_* macro to access the current index

10 years agoMerge branch 'jh/checkout-auto-tracking' into maint
Junio C Hamano [Wed, 23 Oct 2013 20:32:50 +0000 (13:32 -0700)]
Merge branch 'jh/checkout-auto-tracking' into maint

"git branch --track" had a minor regression in v1.8.3.2 and later
that made it impossible to base your local work on anything but a
local branch of the upstream repository you are tracking from.

* jh/checkout-auto-tracking:
  t3200: fix failure on case-insensitive filesystems
  branch.c: Relax unnecessary requirement on upstream's remote ref name
  t3200: Add test demonstrating minor regression in 41c21f2
  Refer to branch.<name>.remote/merge when documenting --track
  t3200: Minor fix when preparing for tracking failure
  t2024: Fix &&-chaining and a couple of typos

10 years agoMerge branch 'nd/fetch-into-shallow' into maint
Junio C Hamano [Wed, 23 Oct 2013 20:32:17 +0000 (13:32 -0700)]
Merge branch 'nd/fetch-into-shallow' into maint

When there is no sufficient overlap between old and new history
during a "git fetch" into a shallow repository, objects that the
sending side knows the receiving end has were unnecessarily sent.

* nd/fetch-into-shallow:
  Add testcase for needless objects during a shallow fetch
  list-objects: mark more commits as edges in mark_edges_uninteresting
  list-objects: reduce one argument in mark_edges_uninteresting
  upload-pack: delegate rev walking in shallow fetch to pack-objects
  shallow: add setup_temporary_shallow()
  shallow: only add shallow graft points to new shallow file
  move setup_alternate_shallow and write_shallow_commits to shallow.c

10 years agocheckout: proper error message on 'git checkout foo bar --'
Matthieu Moy [Fri, 18 Oct 2013 09:25:58 +0000 (11:25 +0200)]
checkout: proper error message on 'git checkout foo bar --'

The previous code was detecting the presence of "--" by looking only at
argument 1. As a result, "git checkout foo bar --" was interpreted as an
ambiguous file/revision list, and errored out with:

error: pathspec 'foo' did not match any file(s) known to git.
error: pathspec 'bar' did not match any file(s) known to git.
error: pathspec '--' did not match any file(s) known to git.

This patch fixes it by walking through the argument list to find the
"--", and now complains about the number of references given.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agocheckout: allow dwim for branch creation for "git checkout $branch --"
Matthieu Moy [Fri, 18 Oct 2013 09:25:57 +0000 (11:25 +0200)]
checkout: allow dwim for branch creation for "git checkout $branch --"

The "--" notation disambiguates files and branches, but as a side-effect
of the previous implementation, also disabled the branch auto-creation
when $branch does not exist.

A possible scenario is then:

git checkout $branch
=> fails if $branch is both a ref and a file, and suggests --

git checkout $branch --
=> refuses to create the $branch

This patch allows the second form to create $branch, and since the -- is
provided, it does not look for file named $branch.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agograph: fix coloring around octopus merges
Hemmo Nieminen [Wed, 16 Oct 2013 08:28:50 +0000 (11:28 +0300)]
graph: fix coloring around octopus merges

When drawing the graph of an octopus merge, we draw a horizontal line
from parents 3 and above into the asterisk representing the commit. The
sections of this line should be colored to match the graph lines coming
in from above.

However, if the commit is not in the left-most column we do not take
into account the columns to the left of the commit when calculating
these colors. Fix this by adding the appropriate offset to the column
index used for calculating the color.

Signed-off-by: Hemmo Nieminen <hemmo.nieminen@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agogit-merge: document the -S option
Nicolas Vigier [Mon, 14 Oct 2013 23:41:05 +0000 (01:41 +0200)]
git-merge: document the -S option

The option to gpg sign a merge commit is available but was not
documented. Use wording from the git-commit(1) manpage.

Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoStart preparing for 1.8.4.2
Junio C Hamano [Thu, 17 Oct 2013 22:50:45 +0000 (15:50 -0700)]
Start preparing for 1.8.4.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'jk/upload-pack-keepalive' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:46:01 +0000 (15:46 -0700)]
Merge branch 'jk/upload-pack-keepalive' into maint

* jk/upload-pack-keepalive:
  upload-pack: bump keepalive default to 5 seconds
  upload-pack: send keepalive packets during pack computation

10 years agoMerge branch 'bc/http-backend-allow-405' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:46:00 +0000 (15:46 -0700)]
Merge branch 'bc/http-backend-allow-405' into maint

* bc/http-backend-allow-405:
  http-backend: provide Allow header for 405

10 years agoMerge branch 'jc/cvsserver-perm-bit-fix' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:45:57 +0000 (15:45 -0700)]
Merge branch 'jc/cvsserver-perm-bit-fix' into maint

* jc/cvsserver-perm-bit-fix:
  cvsserver: pick up the right mode bits

10 years agoMerge branch 'js/add-i-mingw' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:45:56 +0000 (15:45 -0700)]
Merge branch 'js/add-i-mingw' into maint

* js/add-i-mingw:
  add--interactive: fix external command invocation on Windows

10 years agoMerge branch 'nd/git-dir-pointing-at-gitfile' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:45:55 +0000 (15:45 -0700)]
Merge branch 'nd/git-dir-pointing-at-gitfile' into maint

* nd/git-dir-pointing-at-gitfile:
  Make setup_git_env() resolve .git file when $GIT_DIR is not specified

10 years agoMerge branch 'jk/has-sha1-file-retry-packed' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:45:54 +0000 (15:45 -0700)]
Merge branch 'jk/has-sha1-file-retry-packed' into maint

* jk/has-sha1-file-retry-packed:
  has_sha1_file: re-check pack directory before giving up

10 years agoMerge branch 'ap/commit-author-mailmap' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:45:51 +0000 (15:45 -0700)]
Merge branch 'ap/commit-author-mailmap' into maint

* ap/commit-author-mailmap:
  commit: search author pattern against mailmap

10 years agoMerge branch 'es/rebase-i-no-abbrev' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:45:50 +0000 (15:45 -0700)]
Merge branch 'es/rebase-i-no-abbrev' into maint

* es/rebase-i-no-abbrev:
  rebase -i: fix short SHA-1 collision
  t3404: rebase -i: demonstrate short SHA-1 collision
  t3404: make tests more self-contained

Conflicts:
t/t3404-rebase-interactive.sh

10 years agoMerge branch 'rt/rebase-p-no-merge-summary' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:45:45 +0000 (15:45 -0700)]
Merge branch 'rt/rebase-p-no-merge-summary' into maint

* rt/rebase-p-no-merge-summary:
  rebase --preserve-merges: ignore "merge.log" config

10 years agoMerge branch 'es/rebase-i-respect-core-commentchar' into maint
Junio C Hamano [Thu, 17 Oct 2013 22:45:24 +0000 (15:45 -0700)]
Merge branch 'es/rebase-i-respect-core-commentchar' into maint

* es/rebase-i-respect-core-commentchar:
  rebase -i: fix cases ignoring core.commentchar

10 years agot4254: modernize tests
SZEDER Gábor [Wed, 16 Oct 2013 12:27:16 +0000 (14:27 +0200)]
t4254: modernize tests

- Don't start tests with 'test $? = 0' to catch preparation done
  outside the test_expect_success block.

- Move writing the bogus patch and the expected output into the
  appropriate test_expect_success blocks.

- Use the test_must_fail helper instead of manually checking for
  non-zero exit code.

- Use the debug-friendly test_path_is_file helper instead of 'test -f'.

- No space after '>'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agorevision: do not peel tags used in range notation
Junio C Hamano [Thu, 19 Sep 2013 21:20:34 +0000 (14:20 -0700)]
revision: do not peel tags used in range notation

A range notation "A..B" means exactly the same thing as what "^A B"
means, i.e. the set of commits that are reachable from B but not
from A.  But the internal representation after the revision parser
parsed these two notations are subtly different.

 - "rev-list ^A B" leaves A and B in the revs->pending.objects[]
   array, with the former marked as UNINTERESTING and the revision
   traversal machinery propagates the mark to underlying commit
   objects A^0 and B^0.

 - "rev-list A..B" peels tags and leaves A^0 (marked as
   UNINTERESTING) and B^0 in revs->pending.objects[] array before
   the traversal machinery kicks in.

This difference usually does not matter, but starts to matter when
the --objects option is used.  For example, we see this:

    $ git rev-list --objects v1.8.4^1..v1.8.4 | grep $(git rev-parse v1.8.4)
    $ git rev-list --objects v1.8.4 ^v1.8.4^1 | grep $(git rev-parse v1.8.4)
    04f013dc38d7512eadb915eba22efc414f18b869 v1.8.4

With the former invocation, the revision traversal machinery never
hears about the tag v1.8.4 (it only sees the result of peeling it,
i.e. the commit v1.8.4^0), and the tag itself does not appear in the
output.  The latter does send the tag object itself to the output.

Make the range notation keep the unpeeled objects and feed them to
the traversal machinery to fix this inconsistency.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agogit-prune-packed.txt: fix reference to GIT_OBJECT_DIRECTORY
Steffen Prohaska [Mon, 23 Sep 2013 19:19:19 +0000 (21:19 +0200)]
git-prune-packed.txt: fix reference to GIT_OBJECT_DIRECTORY

git-prune-packed operates on GIT_OBJECT_DIRECTORY, not
GIT_OBJECT_DIR.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agobash prompt: don't use '+=' operator in show upstream code path
SZEDER Gábor [Tue, 15 Oct 2013 12:21:11 +0000 (14:21 +0200)]
bash prompt: don't use '+=' operator in show upstream code path

The '+=' operator is not supported by old Bash versions (3.0) we still
care about.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agosplit_ident: parse timestamp from end of line
Jeff King [Mon, 14 Oct 2013 22:45:00 +0000 (18:45 -0400)]
split_ident: parse timestamp from end of line

Split_ident currently parses left to right. Given this
input:

  Your Name <email@example.com> 123456789 -0500\n

We assume the name starts the line and runs until the first
"<".  That starts the email address, which runs until the
first ">".  Everything after that is assumed to be the
timestamp.

This works fine in the normal case, but is easily broken by
corrupted ident lines that contain an extra ">". Some
examples seen in the wild are:

  1. Name <email>-<> 123456789 -0500\n

  2. Name <email> <Name<email>> 123456789 -0500\n

  3. Name1 <email1>, Name2 <email2> 123456789 -0500\n

Currently each of these produces some email address (which
is not necessarily the one the user intended) and end up
with a NULL date (which is generally interpreted as the
epoch by "git log" and friends).

But in each case we could get the correct timestamp simply
by parsing from the right-hand side, looking backwards for
the final ">", and then reading the timestamp from there.

In general, it's a losing battle to try to automatically
guess what the user meant with their broken crud. But this
particular workaround is probably worth doing.  One, it's
dirt simple, and can't impact non-broken cases. Two, it
doesn't catch a single breakage we've seen, but rather a
large class of errors (i.e., any breakage inside the email
angle brackets may affect the email, but won't spill over
into the timestamp parsing). And three, the timestamp is
arguably more valuable to get right, because it can affect
correctness (e.g., in --until cutoffs).

This patch implements the right-to-left scheme described
above. We adjust the tests in t4212, which generate a commit
with such a broken ident, and now gets the timestamp right.
We also add a test that fsck continues to detect the
breakage.

For reference, here are pointers to the breakages seen (as
numbered above):

[1] http://article.gmane.org/gmane.comp.version-control.git/221441

[2] http://article.gmane.org/gmane.comp.version-control.git/222362

[3] http://perl5.git.perl.org/perl.git/commit/13b79730adea97e660de84bbe67f9d7cbe344302

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoremote-curl: rewrite base url from info/refs redirects
Jeff King [Sat, 28 Sep 2013 08:35:35 +0000 (04:35 -0400)]
remote-curl: rewrite base url from info/refs redirects

For efficiency and security reasons, an earlier commit in
this series taught http_get_* to re-write the base url based
on redirections we saw while making a specific request.

This commit wires that option into the info/refs request,
meaning that a redirect from

    http://example.com/foo.git/info/refs

to

    https://example.com/bar.git/info/refs

will behave as if "https://example.com/bar.git" had been
provided to git in the first place.

The tests bear some explanation. We introduce two new
hierearchies into the httpd test config:

  1. Requests to /smart-redir-limited will work only for the
     initial info/refs request, but not any subsequent
     requests. As a result, we can confirm whether the
     client is re-rooting its requests after the initial
     contact, since otherwise it will fail (it will ask for
     "repo.git/git-upload-pack", which is not redirected).

  2. Requests to smart-redir-auth will redirect, and require
     auth after the redirection. Since we are using the
     redirected base for further requests, we also update
     the credential struct, in order not to mislead the user
     (or credential helpers) about which credential is
     needed. We can therefore check the GIT_ASKPASS prompts
     to make sure we are prompting for the new location.
     Because we have neither multiple servers nor https
     support in our test setup, we can only redirect between
     paths, meaning we need to turn on
     credential.useHttpPath to see the difference.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agoremote-curl: store url as a strbuf
Jeff King [Sat, 28 Sep 2013 08:35:25 +0000 (04:35 -0400)]
remote-curl: store url as a strbuf

We use a strbuf to generate the string containing the remote
URL, but then detach it to a bare pointer. This makes it
harder to later manipulate the URL, as we have forgotten the
length (and the allocation semantics are not as clear).

Let's instead keep the strbuf around. As a bonus, this
eliminates a confusing double-use of the "buf" strbuf in
main(). Prior to this, it was used both for constructing the
url, and for reading commands from stdin.

The downside is that we have to update each call site to
refer to "url.buf" rather than just "url" when they want the
C string.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agoremote-curl: make refs_url a strbuf
Jeff King [Sat, 28 Sep 2013 08:35:10 +0000 (04:35 -0400)]
remote-curl: make refs_url a strbuf

In the discover_refs function, we use a strbuf named
"buffer" for multiple purposes. First we build the info/refs
URL in it, and then detach that to a bare pointer. Then, we
use the same strbuf to store the result of fetching the
refs.

Let's instead keep a separate refs_url strbuf. This is less
confusing, as the "buffer" strbuf is now used for only one
thing.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agohttp: update base URLs when we see redirects
Jeff King [Sat, 28 Sep 2013 08:34:05 +0000 (04:34 -0400)]
http: update base URLs when we see redirects

If a caller asks the http_get_* functions to go to a
particular URL and we end up elsewhere due to a redirect,
the effective_url field can tell us where we went.

It would be nice to remember this redirect and short-cut
further requests for two reasons:

  1. It's more efficient. Otherwise we spend an extra http
     round-trip to the server for each subsequent request,
     just to get redirected.

  2. If we end up with an http 401 and are going to ask for
     credentials, it is to feed them to the redirect target.
     If the redirect is an http->https upgrade, this means
     our credentials may be provided on the http leg, just
     to end up redirected to https. And if the redirect
     crosses server boundaries, then curl will drop the
     credentials entirely as it follows the redirect.

However, it, it is not enough to simply record the effective
URL we saw and use that for subsequent requests. We were
originally fed a "base" url like:

   http://example.com/foo.git

and we want to figure out what the new base is, even though
the URLs we see may be:

     original: http://example.com/foo.git/info/refs
    effective: http://example.com/bar.git/info/refs

Subsequent requests will not be for "info/refs", but for
other paths relative to the base. We must ask the caller to
pass in the original base, and we must pass the redirected
base back to the caller (so that it can generate more URLs
from it). Furthermore, we need to feed the new base to the
credential code, so that requests to credential helpers (or
to the user) match the URL we will be requesting.

This patch teaches http_request_reauth to do this munging.
Since it is the caller who cares about making more URLs, it
seems at first glance that callers could simply check
effective_url themselves and handle it. However, since we
need to update the credential struct before the second
re-auth request, we have to do it inside http_request_reauth.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agohttp: provide effective url to callers
Jeff King [Sat, 28 Sep 2013 08:32:02 +0000 (04:32 -0400)]
http: provide effective url to callers

When we ask curl to access a URL, it may follow one or more
redirects to reach the final location. We have no idea
this has happened, as curl takes care of the details and
simply returns the final content to us.

The final URL that we ended up with can be accessed via
CURLINFO_EFFECTIVE_URL. Let's make that optionally available
to callers of http_get_*, so that they can make further
decisions based on the redirection.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agohttp: hoist credential request out of handle_curl_result
Jeff King [Sat, 28 Sep 2013 08:31:45 +0000 (04:31 -0400)]
http: hoist credential request out of handle_curl_result

When we are handling a curl response code in http_request or
in the remote-curl RPC code, we use the handle_curl_result
helper to translate curl's response into an easy-to-use
code. When we see an HTTP 401, we do one of two things:

  1. If we already had a filled-in credential, we mark it as
     rejected, and then return HTTP_NOAUTH to indicate to
     the caller that we failed.

  2. If we didn't, then we ask for a new credential and tell
     the caller HTTP_REAUTH to indicate that they may want
     to try again.

Rejecting in the first case makes sense; it is the natural
result of the request we just made. However, prompting for
more credentials in the second step does not always make
sense. We do not know for sure that the caller is going to
make a second request, and nor are we sure that it will be
to the same URL. Logically, the prompt belongs not to the
request we just finished, but to the request we are (maybe)
about to make.

In practice, it is very hard to trigger any bad behavior.
Currently, if we make a second request, it will always be to
the same URL (even in the face of redirects, because curl
handles the redirects internally). And we almost always
retry on HTTP_REAUTH these days. The one exception is if we
are streaming a large RPC request to the server (e.g., a
pushed packfile), in which case we cannot restart. It's
extremely unlikely to see a 401 response at this stage,
though, as we would typically have seen it when we sent a
probe request, before streaming the data.

This patch drops the automatic prompt out of case 2, and
instead requires the caller to do it. This is a few extra
lines of code, and the bug it fixes is unlikely to come up
in practice. But it is conceptually cleaner, and paves the
way for better handling of credentials across redirects.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agoclone --branch: refuse to clone if upstream repo is empty
Ralf Thielow [Fri, 11 Oct 2013 16:49:02 +0000 (18:49 +0200)]
clone --branch: refuse to clone if upstream repo is empty

Since 920b691 (clone: refuse to clone if --branch
points to bogus ref) we refuse to clone with option
"-b" if the specified branch does not exist in the
(non-empty) upstream. If the upstream repository is empty,
the branch doesn't exist, either. So refuse the clone too.

Reported-by: Robert Mitwicki <robert.mitwicki@opensoftware.pl>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agohttp: refactor options to http_get_*
Jeff King [Sat, 28 Sep 2013 08:31:23 +0000 (04:31 -0400)]
http: refactor options to http_get_*

Over time, the http_get_strbuf function has grown several
optional parameters. We now have a bitfield with multiple
boolean options, as well as an optional strbuf for returning
the content-type of the response. And a future patch in this
series is going to add another strbuf option.

Treating these as separate arguments has a few downsides:

  1. Most call sites need to add extra NULLs and 0s for the
     options they aren't interested in.

  2. The http_get_* functions are actually wrappers around
     2 layers of low-level implementation functions. We have
     to pass these options through individually.

  3. The http_get_strbuf wrapper learned these options, but
     nobody bothered to do so for http_get_file, even though
     it is backed by the same function that does understand
     the options.

Let's consolidate the options into a single struct. For the
common case of the default options, we'll allow callers to
simply pass a NULL for the options struct.

The resulting code is often a few lines longer, but it ends
up being easier to read (and to change as we add new
options, since we do not need to update each call site).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agohttp_request: factor out curlinfo_strbuf
Jeff King [Sat, 28 Sep 2013 08:31:11 +0000 (04:31 -0400)]
http_request: factor out curlinfo_strbuf

When we retrieve the content-type of an http response, curl
gives us a pointer to internal storage, which we then copy
into a strbuf. Let's factor out the get-and-copy routine,
which can be used for getting other curl info.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agohttp_get_file: style fixes
Jeff King [Sat, 28 Sep 2013 08:31:00 +0000 (04:31 -0400)]
http_get_file: style fixes

Besides being ugly, the extra parentheses are idiomatic for
suppressing compiler warnings when we are assigning within a
conditional. We aren't doing that here, and they just
confuse the reader.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agoGit 1.8.4.1 v1.8.4.1
Jonathan Nieder [Thu, 26 Sep 2013 22:01:41 +0000 (15:01 -0700)]
Git 1.8.4.1

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agomerge-recursive: fix parsing of "diff-algorithm" option
John Keeping [Thu, 26 Sep 2013 20:02:48 +0000 (21:02 +0100)]
merge-recursive: fix parsing of "diff-algorithm" option

The "diff-algorithm" option to the recursive merge strategy takes the
name of the algorithm as an option, but it uses strcmp on the option
string to check if it starts with "diff-algorithm=", meaning that this
options cannot actually be used.

Fix this by switching to prefixcmp.  At the same time, clarify the
following line by using strlen instead of a hard-coded length, which
also makes it consistent with nearby code.

Reported-by: Luke Noel-Storr <luke.noel-storr@integrate.co.uk>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agoMerge branch 'mm/rebase-continue-freebsd-WB' into maint
Jonathan Nieder [Thu, 26 Sep 2013 19:41:14 +0000 (12:41 -0700)]
Merge branch 'mm/rebase-continue-freebsd-WB' into maint

* mm/rebase-continue-freebsd-WB:
  rebase: fix run_specific_rebase's use of "return" on FreeBSD

10 years agoMerge branch 'km/svn-1.8-serf-only' into maint
Jonathan Nieder [Thu, 26 Sep 2013 19:34:23 +0000 (12:34 -0700)]
Merge branch 'km/svn-1.8-serf-only' into maint

* km/svn-1.8-serf-only:
  Git.pm: revert _temp_cache use of temp_is_locked
  git-svn: allow git-svn fetching to work using serf
  Git.pm: add new temp_is_locked function

10 years agoMerge branch 'js/xread-in-full' into maint
Jonathan Nieder [Thu, 26 Sep 2013 19:30:44 +0000 (12:30 -0700)]
Merge branch 'js/xread-in-full' into maint

* js/xread-in-full:
  stream_to_pack: xread does not guarantee to read all requested bytes

10 years agoMerge branch 'bc/send-email-ssl-die-message-fix' into maint
Jonathan Nieder [Thu, 26 Sep 2013 19:27:29 +0000 (12:27 -0700)]
Merge branch 'bc/send-email-ssl-die-message-fix' into maint

* bc/send-email-ssl-die-message-fix:
  send-email: don't call methods on undefined values

10 years agogit-remote-mediawiki: bugfix for pages w/ >500 revisions
Benoit Person [Tue, 24 Sep 2013 19:32:30 +0000 (21:32 +0200)]
git-remote-mediawiki: bugfix for pages w/ >500 revisions

Mediawiki introduces a new API for queries w/ more than 500 results in
version 1.21. That change triggered an infinite loop while cloning a
mediawiki with such a page.

The latest API renamed and moved the "continuing" information in the
response, necessary to build the next query. The code failed to retrieve
that information but still detected that it was in a "continuing
query". As a result, it launched the same query over and over again.

If a "continuing" information is detected in the response (old or new),
the next query is updated accordingly. If not, we quit assuming it's not
a continuing query.

Reported-by: Benjamin Cathey
Signed-off-by: Benoit Person <benoit.person@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
10 years agoformat-patch: print in-body "From" only when needed
Jeff King [Fri, 20 Sep 2013 10:16:28 +0000 (06:16 -0400)]
format-patch: print in-body "From" only when needed

Commit a908047 taught format-patch the "--from" option,
which places the author ident into an in-body from header,
and uses the committer ident in the rfc822 from header.  The
documentation claims that it will omit the in-body header
when it is the same as the rfc822 header, but the code never
implemented that behavior.

This patch completes the feature by comparing the two idents
and doing nothing when they are the same (this is the same
as simply omitting the in-body header, as the two are by
definition indistinguishable in this case). This makes it
reasonable to turn on "--from" all the time (if it matches
your particular workflow), rather than only using it when
exporting other people's patches.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoshortlog: ignore commits with missing authors
Jeff King [Wed, 18 Sep 2013 21:14:00 +0000 (17:14 -0400)]
shortlog: ignore commits with missing authors

Most of git's traversals are robust against minor breakages
in commit data. For example, "git log" will still output an
entry for a commit that has a broken encoding or missing
author, and will not abort the whole operation.

Shortlog, on the other hand, will die as soon as it sees a
commit without an author, meaning that a repository with
a broken commit cannot get any shortlog output at all.

Let's downgrade this fatal error to a warning, and continue
the operation.

We simply ignore the commit and do not count it in the total
(since we do not have any author under which to file it).
Alternatively, we could output some kind of "<empty>" record
to collect these bogus commits. It is probably not worth it,
though; we have already warned to stderr, so the user is
aware that such bogosities exist, and any placeholder we
came up with would either be syntactically invalid, or would
potentially conflict with real data.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoclone: always set transport options
Jeff King [Wed, 18 Sep 2013 20:35:13 +0000 (16:35 -0400)]
clone: always set transport options

A clone will always create a transport struct, whether we
are cloning locally or using an actual protocol. In the
local case, we only use the transport to get the list of
refs, and then transfer the objects out-of-band.

However, there are many options that we do not bother
setting up in the local case. For the most part, these are
noops, because they only affect the object-fetching stage
(e.g., the --depth option).  However, some options do have a
visible impact. For example, giving the path to upload-pack
via "-u" does not currently work for a local clone, even
though we need upload-pack to get the ref list.

We can just drop the conditional entirely and set these
options for both local and non-local clones. Rather than
keep track of which options impact the object versus the ref
fetching stage, we can simply let the noops be noops (and
the cost of setting the options in the first place is not
high).

The one exception is that we also check that the transport
provides both a "get_refs_list" and a "fetch" method. We
will now be checking the former for both cases (which is
good, since a transport that cannot fetch refs would not
work for a local clone), and we tweak the conditional to
check for a "fetch" only when we are non-local.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoclone: treat "checking connectivity" like other progress
Jeff King [Wed, 18 Sep 2013 20:06:50 +0000 (16:06 -0400)]
clone: treat "checking connectivity" like other progress

When stderr does not point to a tty, we typically suppress
"we are now in this phase" progress reporting (e.g., we ask
the server not to send us "counting objects" and the like).

The new "checking connectivity" message is in the same vein,
and should be suppressed. Since clone relies on the
transport code to make the decision, we can simply sneak a
peek at the "progress" field of the transport struct. That
properly takes into account both the verbosity and progress
options we were given, as well as the result of isatty().

Note that we do not set up that progress flag for a local
clone, as we do not fetch using the transport at all. That's
acceptable here, though, because we also do not perform a
connectivity check in that case.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoclone: send diagnostic messages to stderr
Jeff King [Wed, 18 Sep 2013 20:05:13 +0000 (16:05 -0400)]
clone: send diagnostic messages to stderr

Putting messages like "Cloning into.." and "done" on stdout
is un-Unix and uselessly clutters the stdout channel. Send
them to stderr.

We have to tweak two tests to accommodate this:

  1. t5601 checks for doubled output due to forking, and
     doesn't actually care where the output goes; adjust it
     to check stderr.

  2. t5702 is trying to test whether progress output was
     sent to stderr, but naively does so by checking
     whether stderr produced any output. Instead, have it
     look for "%", a token found in progress output but not
     elsewhere (and which lets us avoid hard-coding the
     progress text in the test).

This should not regress any scripts that try to parse the
current output, as the output is already internationalized
and therefore unstable.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoStart preparing for 1.8.4.1
Junio C Hamano [Wed, 18 Sep 2013 19:08:09 +0000 (12:08 -0700)]
Start preparing for 1.8.4.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'bc/completion-for-bash-3.0' into maint
Junio C Hamano [Wed, 18 Sep 2013 19:00:11 +0000 (12:00 -0700)]
Merge branch 'bc/completion-for-bash-3.0' into maint

Some people still use rather old versions of bash, which cannot grok
some constructs like 'printf -v varname' the prompt and completion
code started to use recently.

* bc/completion-for-bash-3.0:
  contrib/git-prompt.sh: handle missing 'printf -v' more gracefully
  t9902-completion.sh: old Bash still does not support array+=('') notation
  git-completion.bash: use correct Bash/Zsh array length syntax

10 years agoMerge branch 'mm/no-shell-escape-in-die-message' into maint
Junio C Hamano [Wed, 18 Sep 2013 18:59:50 +0000 (11:59 -0700)]
Merge branch 'mm/no-shell-escape-in-die-message' into maint

Fixes a minor bug in "git rebase -i" (there could be others, as the
root cause is pretty generic) where the code feeds a random, data
dependeant string to 'echo' and expects it to come out literally.

* mm/no-shell-escape-in-die-message:
  die_with_status: use "printf '%s\n'", not "echo"

10 years agoMerge branch 'jl/some-submodule-config-are-not-boolean' into maint
Junio C Hamano [Wed, 18 Sep 2013 18:59:35 +0000 (11:59 -0700)]
Merge branch 'jl/some-submodule-config-are-not-boolean' into maint

* jl/some-submodule-config-are-not-boolean:
  avoid segfault on submodule.*.path set to an empty "true"

10 years agoMerge branch 'tr/log-full-diff-keep-true-parents' into maint
Junio C Hamano [Wed, 18 Sep 2013 18:59:05 +0000 (11:59 -0700)]
Merge branch 'tr/log-full-diff-keep-true-parents' into maint

Output from "git log --full-diff -- <pathspec>" looked strange,
because comparison was done with the previous ancestor that touched
the specified <pathspec>, causing the patches for paths outside the
pathspec to show more than the single commit has changed.

* tr/log-full-diff-keep-true-parents:
  log: use true parents for diff when walking reflogs
  log: use true parents for diff even when rewriting

10 years agoMerge branch 'jc/transport-do-not-use-connect-twice-in-fetch' into maint
Junio C Hamano [Wed, 18 Sep 2013 18:58:18 +0000 (11:58 -0700)]
Merge branch 'jc/transport-do-not-use-connect-twice-in-fetch' into maint

The auto-tag-following code in "git fetch" tries to reuse the same
transport twice when the serving end does not cooperate and does
not give tags that point to commits that are asked for as part of
the primary transfer.  Unfortunately, Git-aware transport helper
interface is not designed to be used more than once, hence this
does not work over smart-http transfer.

* jc/transport-do-not-use-connect-twice-in-fetch:
  builtin/fetch.c: Fix a sparse warning
  fetch: work around "transport-take-over" hack
  fetch: refactor code that fetches leftover tags
  fetch: refactor code that prepares a transport
  fetch: rename file-scope global "transport" to "gtransport"
  t5802: add test for connect helper

10 years agoMerge branch 'sp/clip-read-write-to-8mb' into maint
Junio C Hamano [Wed, 18 Sep 2013 18:57:58 +0000 (11:57 -0700)]
Merge branch 'sp/clip-read-write-to-8mb' into maint

Send a large request to read(2)/write(2) as a smaller but still
reasonably large chunks, which would improve the latency when the
operation needs to be killed and incidentally works around broken
64-bit systems that cannot take a 2GB write or read in one go.

* sp/clip-read-write-to-8mb:
  Revert "compat/clipped-write.c: large write(2) fails on Mac OS X/XNU"
  xread, xwrite: limit size of IO to 8MB

10 years agoMerge branch 'jk/mailmap-incomplete-line' into maint
Junio C Hamano [Wed, 18 Sep 2013 18:57:32 +0000 (11:57 -0700)]
Merge branch 'jk/mailmap-incomplete-line' into maint

* jk/mailmap-incomplete-line:
  mailmap: handle mailmap blobs without trailing newlines

10 years agot3200: fix failure on case-insensitive filesystems
Eric Sunshine [Sat, 14 Sep 2013 07:36:24 +0000 (03:36 -0400)]
t3200: fix failure on case-insensitive filesystems

62d94a3a (t3200: Add test demonstrating minor regression in 41c21f2;
2013-09-08) introduced a test which creates a directory named 'a',
however, on case-insensitive filesystems, this action fails with a
"fatal: cannot mkdir a: File exists" error due to a file named 'A' left
over from earlier tests. Resolve this problem.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot7406-submodule-update: add missing &&
Tay Ray Chuan [Sun, 15 Sep 2013 17:38:21 +0000 (01:38 +0800)]
t7406-submodule-update: add missing &&

322bb6e (2011 Aug 11) introduced a new subshell at the end of a test
case but omitted a '&&' to join the two; fix this.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agohttp-backend: provide Allow header for 405
Brian M. Carlson [Thu, 12 Sep 2013 00:30:01 +0000 (00:30 +0000)]
http-backend: provide Allow header for 405

The HTTP 1.1 standard requires an Allow header for 405 Method Not Allowed:

  The response MUST include an Allow header containing a list of valid methods
  for the requested resource.

So provide such a header when we return a 405 to the user agent.

Signed-off-by: Brian M. Carlson <sandals@crustytoothpaste.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge branch 'maint' of git://github.com/git-l10n/git-po into maint
Junio C Hamano [Thu, 12 Sep 2013 04:12:02 +0000 (21:12 -0700)]
Merge branch 'maint' of git://github.com/git-l10n/git-po into maint

* 'maint' of git://github.com/git-l10n/git-po:
  l10n: de.po: use "das Tag" instead of "der Tag"

10 years agocvsserver: pick up the right mode bits
Junio C Hamano [Tue, 10 Sep 2013 22:33:06 +0000 (15:33 -0700)]
cvsserver: pick up the right mode bits

When determining the file mode from either ls-tree or diff-tree
output, we used to grab these octal mode string (typically 100644 or
100755) and then did

$git_perms .= "r" if ( $mode & 4 );
$git_perms .= "w" if ( $mode & 2 );
$git_perms .= "x" if ( $mode & 1 );

which was already wrong, as (100644 & 4) is very different from
oct("100644") & 4.  An earlier refactoring 2c3af7e7 (cvsserver:
factor out git-log parsing logic, 2012-10-13) further changed it to
pick the third octal digit (10*0*644 or 10*0*755) from the left and
then do the above conversion, which does not make sense, either.

Let's use the third digit from the last of the octal mode string to
make sure we get the executable and read bits right.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tested-by: Michael Cronenworth <mike@cchtml.com>
10 years agosend-email: don't call methods on undefined values
Brian M. Carlson [Sun, 8 Sep 2013 20:54:34 +0000 (20:54 +0000)]
send-email: don't call methods on undefined values

If SSL verification is enabled in git send-email, we could attempt to call a
method on an undefined value if the verification failed, since $smtp would end
up being undef.  Look up the error string in a way that will produce a helpful
error message and not cause further errors.

Signed-off-by: Brian M. Carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoupload-pack: bump keepalive default to 5 seconds
Jeff King [Sun, 8 Sep 2013 09:02:06 +0000 (05:02 -0400)]
upload-pack: bump keepalive default to 5 seconds

There is no reason not to turn on keepalives by default.
They take very little bandwidth, and significantly less than
the progress reporting they are replacing. And in the case
that progress reporting is on, we should never need to send
a keepalive anyway, as we will constantly be showing
progress and resetting the keepalive timer.

We do not necessarily know what the client's idea of a
reasonable timeout is, so let's keep this on the low side of
5 seconds. That is high enough that we will always prefer
our normal 1-second progress reports to sending a keepalive
packet, but low enough that no sane client should consider
the connection hung.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoupload-pack: send keepalive packets during pack computation
Jeff King [Sun, 8 Sep 2013 09:01:31 +0000 (05:01 -0400)]
upload-pack: send keepalive packets during pack computation

When upload-pack has started pack-objects, there may be a quiet
period while pack-objects prepares the pack (i.e., counting objects
and delta compression). Normally we would see (and send to the
client) progress information, but if "--quiet" is in effect,
pack-objects will produce nothing at all until the pack data is
ready. On a large repository, this can take tens of seconds (or even
minutes if the system is loaded or the repository is badly packed).
Clients or intermediate proxies can sometimes give up in this
situation, assuming that the server or connection has hung.

This patch introduces a "keepalive" option; if upload-pack sees no
data from pack-objects for a certain number of seconds, it will send
an empty sideband data packet to let the other side know that we are
still working on it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agobranch.c: Relax unnecessary requirement on upstream's remote ref name
Per Cederqvist [Sun, 8 Sep 2013 20:58:15 +0000 (22:58 +0200)]
branch.c: Relax unnecessary requirement on upstream's remote ref name

When creating an upstream relationship, we use the configured remotes and
their refspecs to determine the upstream configuration settings
branch.<name>.remote and branch.<name>.merge. However, if the matching
refspec does not have refs/heads/<something> on the remote side, we end
up rejecting the match, and failing the upstream configuration.

It could be argued that when we set up an branch's upstream, we want that
upstream to also be a proper branch in the remote repo. Although this is
typically the common case, there are cases (as demonstrated by the previous
patch in this series) where this requirement prevents a useful upstream
relationship from being formed. Furthermore:

 - We have fundamentally no say in how the remote repo have organized its
   branches. The remote repo may put branches (or branch-like constructs
   that are insteresting for downstreams to track) outside refs/heads/*.

 - The user may intentionally want to track a non-branch from a remote
   repo, by using a branch and configured upstream in the local repo.

Relaxing the checking to only require a matching remote/refspec allows the
testcase introduced in the previous patch to succeed, and has no negative
effect on the rest of the test suite.

This patch fixes a behavior (arguably a regression) first introduced in
41c21f2 (branch.c: Validate tracking branches with refspecs instead of
refs/remotes/*) on 2013-04-21 (released in >= v1.8.3.2).

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot3200: Add test demonstrating minor regression in 41c21f2
Johan Herland [Sun, 8 Sep 2013 20:58:14 +0000 (22:58 +0200)]
t3200: Add test demonstrating minor regression in 41c21f2

In 41c21f2 (branch.c: Validate tracking branches with refspecs instead of
refs/remotes/*), we changed the rules for what is considered a valid tracking
branch (a.k.a. upstream branch). We now use the configured remotes and their
refspecs to determine whether a proposed tracking branch is in fact within
the domain of a remote, and we then use that information to deduce the
upstream configuration (branch.<name>.remote and branch.<name>.merge).

However, with that change, we also check that - in addition to a matching
refspec - the result of mapping the tracking branch through that refspec
(i.e. the corresponding ref name in the remote repo) happens to start with
"refs/heads/". In other words, we require that a tracking branch refers to
a _branch_ in the remote repo.

Now, consider that you are e.g. setting up an automated building/testing
infrastructure for a group of similar "source" repositories. The build/test
infrastructure consists of a central scheduler, and a number of build/test
"slave" machines that perform the actual build/test work. The scheduler
monitors the group of similar repos for changes (e.g. with a periodic
"git fetch"), and triggers builds/tests to be run on one or more slaves.
Graphically the changes flow between the repos like this:

  Source #1 -------v          ----> Slave #1
                             /
  Source #2 -----> Scheduler -----> Slave #2
                             \
  Source #3 -------^          ----> Slave #3

        ...                           ...

The scheduler maintains a single Git repo with each of the source repos set
up as distinct remotes. The slaves also need access to all the changes from
all of the source repos, so they pull from the scheduler repo, but using the
following custom refspec:

  remote.origin.fetch = "+refs/remotes/*:refs/remotes/*"

This makes all of the scheduler's remote-tracking branches automatically
available as identical remote-tracking branches in each of the slaves.

Now, consider what happens if a slave tries to create a local branch with
one of the remote-tracking branches as upstream:

  git branch local_branch --track refs/remotes/source-1/some_branch

Git now looks at the configured remotes (in this case there is only "origin",
pointing to the scheduler's repo) and sees refs/remotes/source-1/some_branch
matching origin's refspec. Mapping through that refspec we find that the
corresponding remote ref name is "refs/remotes/source-1/some_branch".
However, since this remote ref name does not start with "refs/heads/", we
discard it as a suitable upstream, and the whole command fails.

This patch adds a testcase demonstrating this failure by creating two
source repos ("a" and "b") that are forwarded through a scheduler ("c")
to a slave repo ("d"), that then tries create a local branch with an
upstream. See the next patch in this series for the exciting conclusion
to this story...

Reported-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoRefer to branch.<name>.remote/merge when documenting --track
Johan Herland [Sun, 8 Sep 2013 20:58:13 +0000 (22:58 +0200)]
Refer to branch.<name>.remote/merge when documenting --track

Make it easier for readers to find the actual config variables that
implement the "upstream" relationship.

Suggested-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot3200: Minor fix when preparing for tracking failure
Johan Herland [Sun, 8 Sep 2013 20:58:12 +0000 (22:58 +0200)]
t3200: Minor fix when preparing for tracking failure

We're testing that trying to --track a ref that is not covered by any remote
refspec should fail. For that, we want to have refs/remotes/local/master
present, but we also want the remote.local.fetch refspec to NOT match
refs/remotes/local/master (so that the tracking setup will fail, as intended).
However, when doing "git fetch local" to ensure the existence of
refs/remotes/local/master, we must not already have changed remote.local.fetch
so as to cause refs/remotes/local/master not to be fetched. Therefore, set
remote.local.fetch to refs/heads/*:refs/remotes/local/* BEFORE we fetch, and
then reset it to refs/heads/s:refs/remotes/local/s AFTER we have fetched
(but before we test --track).

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot2024: Fix &&-chaining and a couple of typos
Johan Herland [Sun, 8 Sep 2013 20:58:11 +0000 (22:58 +0200)]
t2024: Fix &&-chaining and a couple of typos

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agorebase: fix run_specific_rebase's use of "return" on FreeBSD
Matthieu Moy [Mon, 9 Sep 2013 08:53:15 +0000 (10:53 +0200)]
rebase: fix run_specific_rebase's use of "return" on FreeBSD

Since a1549e10, git-rebase--am.sh uses the shell's "return" statement, to
mean "return from the current file inclusion", which is POSIXly correct,
but badly interpreted on FreeBSD, which returns from the current
function, hence skips the finish_rebase statement that follows the file
inclusion.

Make the use of "return" portable by using the file inclusion as the last
statement of a function.

Reported-by: Christoph Mallon <christoph.mallon@gmx.de>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agol10n: de.po: use "das Tag" instead of "der Tag"
Ralf Thielow [Sun, 8 Sep 2013 14:28:36 +0000 (16:28 +0200)]
l10n: de.po: use "das Tag" instead of "der Tag"

Use "das Tag" to avoid confusion with the German word "Tag" (day).

Reported-by: Dirk Heinrichs <dirk.heinrichs@altum.de>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
10 years agoMerge branch 'nd/fetch-pack-shallow-fix' into maint
Junio C Hamano [Thu, 5 Sep 2013 21:40:58 +0000 (14:40 -0700)]
Merge branch 'nd/fetch-pack-shallow-fix' into maint

The recent "short-cut clone connectivity check" topic broke a shallow
repository when a fetch operation tries to auto-follow tags.

* nd/fetch-pack-shallow-fix:
  fetch-pack: do not remove .git/shallow file when --depth is not specified

10 years agoMerge branch 'hv/config-from-blob' into maint
Junio C Hamano [Thu, 5 Sep 2013 21:40:18 +0000 (14:40 -0700)]
Merge branch 'hv/config-from-blob' into maint

Compilation fix on platforms with fgetc() and friends defined as
macros.

* hv/config-from-blob:
  config: do not use C function names as struct members

10 years agoMerge branch 'maint-1.8.3' into maint
Junio C Hamano [Thu, 5 Sep 2013 21:24:59 +0000 (14:24 -0700)]
Merge branch 'maint-1.8.3' into maint

* maint-1.8.3:
  Documentation/git-merge.txt: fix formatting of example block

10 years agoMerge branch 'maint-1.8.2' into maint-1.8.3
Junio C Hamano [Thu, 5 Sep 2013 21:24:52 +0000 (14:24 -0700)]
Merge branch 'maint-1.8.2' into maint-1.8.3

* maint-1.8.2:
  Documentation/git-merge.txt: fix formatting of example block

10 years agoDocumentation/git-merge.txt: fix formatting of example block
Andreas Schwab [Thu, 5 Sep 2013 15:12:45 +0000 (17:12 +0200)]
Documentation/git-merge.txt: fix formatting of example block

You need at least four dashes in a line to have it recognized as listing
block delimiter by asciidoc.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoadd--interactive: fix external command invocation on Windows
Johannes Sixt [Wed, 4 Sep 2013 07:24:47 +0000 (09:24 +0200)]
add--interactive: fix external command invocation on Windows

Back in 21e9757e (Hack git-add--interactive to make it work with
ActiveState Perl, 2007-08-01), the invocation of external commands was
changed to use qx{} on Windows. The rationale was that the command
interpreter on Windows is not a POSIX shell, but rather Windows's CMD.
That patch was wrong to include 'msys' in the check whether to use qx{}
or not: 'msys' identifies MSYS perl as shipped with Git for Windows,
which does not need the special treatment; qx{} should be used only with
ActiveState perl, which is identified by 'MSWin32'.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoMerge git://github.com/git-l10n/git-po into maint
Junio C Hamano [Tue, 3 Sep 2013 20:58:03 +0000 (13:58 -0700)]
Merge git://github.com/git-l10n/git-po into maint

* git://github.com/git-l10n/git-po:
  l10n: fr.po: hotfix for commit 6b388fc