Commit graph

42087 commits

Author SHA1 Message Date
Junio C Hamano 65ba75ba7d Merge branch 'bc/http-empty-auth'
Some authentication methods do not need username or password, but
libcurl needs some hint that it needs to perform authentication.
Supplying an empty username and password string is a valid way to
do so, but you can set the http.[<url>.]emptyAuth configuration
variable to achieve the same, if you find it cleaner.

* bc/http-empty-auth:
  http: add option to try authentication without username
2016-02-24 13:25:57 -08:00
Junio C Hamano 97c49af6a7 Merge branch 'sp/remote-curl-ssl-strerror'
Help those who debug http(s) part of the system.

* sp/remote-curl-ssl-strerror:
  remote-curl: include curl_errorstr on SSL setup failures
2016-02-24 13:25:56 -08:00
Junio C Hamano 9831e92bfa Merge branch 'jk/lose-name-path'
The "name_path" API was an attempt to reduce the need to construct
the full path out of a series of path components while walking a
tree hierarchy, but over time made less efficient because the path
needs to be flattened, e.g. to be compared with another path that
is already flat.  The API has been removed and its users have been
rewritten to simplify the overall code complexity.

* jk/lose-name-path:
  list-objects: pass full pathname to callbacks
  list-objects: drop name_path entirely
  list-objects: convert name_path to a strbuf
  show_object_with_name: simplify by using path_name()
  http-push: stop using name_path
2016-02-24 13:25:55 -08:00
Junio C Hamano e84d5e9fa1 Merge branch 'ew/force-ipv4'
"git fetch" and friends that make network connections can now be
told to only use ipv4 (or ipv6).

* ew/force-ipv4:
  connect & http: support -4 and -6 switches for remote operations
2016-02-24 13:25:54 -08:00
Junio C Hamano 8020803f50 Merge branch 'nd/git-common-dir-fix'
"git rev-parse --git-common-dir" used in the worktree feature
misbehaved when run from a subdirectory.

* nd/git-common-dir-fix:
  rev-parse: take prefix into account in --git-common-dir
2016-02-24 13:25:53 -08:00
Junio C Hamano e6a6a768ca Merge branch 'nd/dwim-wildcards-as-pathspecs'
"git show 'HEAD:Foo[BAR]Baz'" did not interpret the argument as a
rev, i.e. the object named by the the pathname with wildcard
characters in a tree object.

* nd/dwim-wildcards-as-pathspecs:
  get_sha1: don't die() on bogus search strings
  check_filename: tighten dwim-wildcard ambiguity
  checkout: reorder check_filename conditional
2016-02-24 13:25:52 -08:00
Eric Wong 7c0da37d7b tests: remove no-op full-svn-test target
git-svn has not supported GIT_SVN_NO_OPTIMIZE_COMMITS for
the "set-tree" sub-command in 9 years since commit 490f49ea58
("git-svn: remove optimized commit stuff for set-tree").

So remove this target and TSVN variable to avoid confusion.

ref: http://mid.gmane.org/56C9B7B7.7030406@f2.dion.ne.jp

Helped-by: Kazutoshi Satoda <k_satoda@f2.dion.ne.jp>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-23 12:55:03 -08:00
Junio C Hamano 70bd996071 Git 2.7.2
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWy3nfAAoJELC16IaWr+bLaA0QAMkWQiqb1ptDO8/dBxoibYSy
 jxYE9vLDjgd+fuX7NkB6ezGv0WtZ2DJI2klXvPf/uZe2f5orFOEQ0TlHJxeJFFJ0
 tR8mwCQcYIR0SuK/RxvEUNrs3iC3F6bs3iP9DPesginIyzL3DMpJCHNifkbF4uXG
 veapEUiQbW09+Ye3/k24meK6hLHCFVfH8sEQail6hGDAP0hMbv28FMn6RlzgTzvj
 83yn3Negy7p76ILQhC/PZDxTSMFt++2ppUnK7f6hERFXIQq9GXoV2vx7vW2aF1Yq
 MxuvMKNON6B8wBRYP0e8FXxdUlJDtlLyWo/dhOQCq2fyPyGAa39Y3xHRziLpGPgW
 ad5FBDuphQkujFDkJghvo7LR0WfYLiJiFIztlb6WBvQj38GP323JbGExzkVXjUal
 n9on42puk8Zzf0MnaKBtEMPb69rAfX7yFIbt2q4z/c7U7obwtmZHiXc8H2GJnUyj
 IWT5estJQrpQ+HglNO+yrfuFgUm2L4TciN9Gq9pD4TSKvmDFHSevVefX5Qz+2eeV
 nSltULr94l1PqWkQJ1Szg9JUC8eembLxdpFtiS+o5RWWHrbBBbXXuG/jbRFw8d7H
 Gy1cP3/YkJlMw0v4zcN/W1SfLPAk2MOsYJCkdVRoXSWctLISq8WQ7Fp+W5vMcsR+
 t0hA5/uTsOH2bEsaXWTE
 =DkAI
 -----END PGP SIGNATURE-----

Sync with 2.7.2
2016-02-22 13:16:12 -08:00
Junio C Hamano 4091558cfe Merge branch 'js/git-remote-add-url-insteadof-test'
* js/git-remote-add-url-insteadof-test:
  t5505: 'remote add x y' should work when url.y.insteadOf = x
2016-02-22 13:15:01 -08:00
Junio C Hamano 895f20de9e Merge branch 'jk/config-include'
* jk/config-include:
  git-config: better document default behavior for `--include`
2016-02-22 13:14:48 -08:00
Junio C Hamano d7145ef275 Merge branch 'ew/connect-verbose'
* ew/connect-verbose:
  t5570: add tests for "git {clone,fetch,pull} -v"
2016-02-22 13:14:33 -08:00
Junio C Hamano 326e5bc91e Git 2.7.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-22 13:12:56 -08:00
Junio C Hamano 2bbea5c8f2 Merge branch 'nd/ita-cleanup' into maint
Paths that have been told the index about with "add -N" are not
quite yet in the index, but a few commands behaved as if they
already are in a harmful way.

* nd/ita-cleanup:
  grep: make it clear i-t-a entries are ignored
  add and use a convenience macro ce_intent_to_add()
  blame: remove obsolete comment
2016-02-22 13:10:21 -08:00
Junio C Hamano 47847c756b Merge branch 'pw/completion-stash' into maint
* pw/completion-stash:
  completion: fix mis-indentation in _git_stash()
2016-02-22 13:10:20 -08:00
Junio C Hamano 924459c516 Merge branch 'mm/clean-doc-fix' into maint
The documentation for "git clean" has been corrected; it mentioned
that .git/modules/* are removed by giving two "-f", which has never
been the case.

* mm/clean-doc-fix:
  Documentation/git-clean.txt: don't mention deletion of .git/modules/*
2016-02-22 13:10:20 -08:00
Junio C Hamano 2263a05907 Merge branch 'dw/mergetool-vim-window-shuffle' into maint
The vimdiff backend for "git mergetool" has been tweaked to arrange
and number buffers in the order that would match the expectation of
majority of people who read left to right, then top down and assign
buffers 1 2 3 4 "mentally" to local base remote merge windows based
on that order.

* dw/mergetool-vim-window-shuffle:
  mergetool: reorder vim/gvim buffers in three-way diffs
2016-02-22 13:10:20 -08:00
Junio C Hamano fa7b63d2f1 Merge branch 'ah/stripspace-optstring' into maint
* ah/stripspace-optstring:
  stripspace: call U+0020 a "space" instead of a "blank"
2016-02-22 13:10:19 -08:00
Junio C Hamano d4bd6781de Merge branch 'ks/svn-pathnameencoding-4' of git://git.bogomips.org/git-svn
* 'ks/svn-pathnameencoding-4' of git://git.bogomips.org/git-svn:
  git-svn: apply "svn.pathnameencoding" before URL encoding
  git-svn: enable "svn.pathnameencoding" on dcommit
  git-svn: hoist out utf8 prep from t9129 to lib-git-svn
2016-02-22 10:29:46 -08:00
Junio C Hamano 8716bdca26 Merge branch 'pw/completion-stash'
* pw/completion-stash:
  completion: fix mis-indentation in _git_stash()
2016-02-22 10:27:24 -08:00
SZEDER Gábor 59305aeeba completion: fix mis-indentation in _git_stash()
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-22 10:26:04 -08:00
Kazutoshi Satoda 1b42f45255 git-svn: apply "svn.pathnameencoding" before URL encoding
The conversion from "svn.pathnameencoding" to UTF-8 should be applied
first, and then URL encoding should be applied on the resulting UTF-8
path. The reversed order of these transforms (used before this fix)
makes non-UTF-8 URL which causes error from Subversion such as
"Filesystem has no item: '...' path not found" when sending a rename (or
a copy) from non-ASCII path.

[ew: t9115 test case added (requires SVN_HTTPD_PORT set to test),
 squash LC_ALL=$a_utf8_locale export from Kazutoshi for Cygwin]

Signed-off-by: Kazutoshi SATODA <k_satoda@f2.dion.ne.jp>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2016-02-22 02:29:36 +00:00
Kazutoshi Satoda 40f47448a9 git-svn: enable "svn.pathnameencoding" on dcommit
Without the initialization of $self->{pathnameencoding}, conversion in
repo_path() is always skipped as $self->{pathnameencoding} is undefined
even if "svn.pathnameencoding" is configured.

The lack of conversion results in mysterious failure of dcommit (e.g.
"Malformed XML") which happen only when a commit involves a change on
non-ASCII path.

[ew: add test case to t9115,
 squash LC_ALL=$a_utf8_locale export from Kazutoshi for Cygwin]

Signed-off-by: Kazutoshi SATODA <k_satoda@f2.dion.ne.jp>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2016-02-22 02:28:34 +00:00
Eric Wong 3df0d26ca6 git-svn: hoist out utf8 prep from t9129 to lib-git-svn
We will be reusing this in t9115.

Suggested-by: Kazutoshi Satoda <k_satoda@f2.dion.ne.jp>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2016-02-22 02:21:19 +00:00
Junio C Hamano 0233b800c8 Merge branch 'maint'
* maint:
  Start preparing for 2.7.2
  git-cvsserver.perl: fix typo
2016-02-17 10:14:39 -08:00
Junio C Hamano 6343832797 Seventh batch for the 2.8 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-17 10:13:57 -08:00
Junio C Hamano 82c17b7a9a Merge branch 'dw/mergetool-vim-window-shuffle'
The vimdiff backend for "git mergetool" has been tweaked to arrange
and number buffers in the order that would match the expectation of
majority of people who read left to right, then top down and assign
buffers 1 2 3 4 "mentally" to local base remote merge windows based
on that order.

* dw/mergetool-vim-window-shuffle:
  mergetool: reorder vim/gvim buffers in three-way diffs
2016-02-17 10:13:34 -08:00
Junio C Hamano d6a5088f67 Merge branch 'ah/stripspace-optstring'
* ah/stripspace-optstring:
  stripspace: call U+0020 a "space" instead of a "blank"
2016-02-17 10:13:34 -08:00
Junio C Hamano 8c7124c9ac Merge branch 'mm/clean-doc-fix'
The documentation for "git clean" has been corrected; it mentioned
that .git/modules/* are removed by giving two "-f", which has never
been the case.

* mm/clean-doc-fix:
  Documentation/git-clean.txt: don't mention deletion of .git/modules/*
2016-02-17 10:13:33 -08:00
Junio C Hamano b1a90b68cf Merge branch 'jk/rerere-xsnprintf'
Some calls to strcpy(3) triggers a false warning from static
analysers that are less intelligent than humans, and reducing the
number of these false hits helps us notice real issues.  A few
calls to strcpy(3) in "git rerere" that are already safe has been
rewritten to avoid false wanings.

* jk/rerere-xsnprintf:
  rerere: replace strcpy with xsnprintf
2016-02-17 10:13:33 -08:00
Junio C Hamano 790dd332c6 Merge branch 'jk/test-path-utils-xsnprintf'
Some calls to strcpy(3) triggers a false warning from static
analysers that are less intelligent than humans, and reducing the
number of these false hits helps us notice real issues.  A few
calls to strcpy(3) in test-path-utils that are already safe has
been rewritten to avoid false wanings.

* jk/test-path-utils-xsnprintf:
  test-path-utils: use xsnprintf in favor of strcpy
2016-02-17 10:13:32 -08:00
Junio C Hamano c37f9a1bc3 Merge branch 'da/user-useconfigonly'
The "user.useConfigOnly" configuration variable can be used to
force the user to always set user.email & user.name configuration
variables, serving as a reminder for those who work on multiple
projects and do not want to put these in their $HOME/.gitconfig.

* da/user-useconfigonly:
  ident: add user.useConfigOnly boolean for when ident shouldn't be guessed
  fmt_ident: refactor strictness checks
2016-02-17 10:13:31 -08:00
Junio C Hamano dbda66b0e2 Merge branch 'nd/clear-gitenv-upon-use-of-alias'
The automatic typo correction applied to an alias was broken
with a recent change already in 'master'.

* nd/clear-gitenv-upon-use-of-alias:
  restore_env(): free the saved environment variable once we are done
  git: simplify environment save/restore logic
  git: protect against unbalanced calls to {save,restore}_env()
  git: remove an early return from save_env_before_alias()
2016-02-17 10:13:31 -08:00
Junio C Hamano f60ccdd98c Merge branch 'mg/mingw-test-fix'
An earlier adjustment of test mistakenly used write_script
to prepare a file whose exact content matters for the test;
reverting that part fixes the breakage for those who use
SHELL_PATH that is different from /bin/sh.

* mg/mingw-test-fix:
  t9100: fix breakage when SHELL_PATH is not /bin/sh
2016-02-17 10:13:29 -08:00
Junio C Hamano 4b589e5b28 Merge branch 'js/mingw-tests'
Test scripts have been updated to remove assumptions that are not
portable between Git for POSIX and Git for Windows, or to skip ones
with expectations that are not satisfiable on Git for Windows.

* js/mingw-tests: (21 commits)
  gitignore: ignore generated test-fake-ssh executable
  mingw: do not bother to test funny file names
  mingw: skip a test in t9130 that cannot pass on Windows
  mingw: handle the missing POSIXPERM prereq in t9124
  mingw: avoid illegal filename in t9118
  mingw: mark t9100's test cases with appropriate prereqs
  t0008: avoid absolute path
  mingw: work around pwd issues in the tests
  mingw: fix t9700's assumption about directory separators
  mingw: skip test in t1508 that fails due to path conversion
  tests: turn off git-daemon tests if FIFOs are not available
  mingw: disable mkfifo-based tests
  mingw: accomodate t0060-path-utils for MSYS2
  mingw: fix t5601-clone.sh
  mingw: let lstat() fail with errno == ENOTDIR when appropriate
  mingw: try to delete target directory before renaming
  mingw: prepare the TMPDIR environment variable for shell scripts
  mingw: factor out Windows specific environment setup
  Git.pm: stop assuming that absolute paths start with a slash
  mingw: do not trust MSYS2's MinGW gettext.sh
  ...
2016-02-17 10:13:29 -08:00
Junio C Hamano 9f03176ef6 Merge branch 'jk/drop-rsync-transport'
It turns out "git clone" over rsync transport has been broken when
the source repository has packed references for a long time, and
nobody noticed nor complained about it.

* jk/drop-rsync-transport:
  transport: drop support for git-over-rsync
2016-02-17 10:13:28 -08:00
Junio C Hamano 8a71d90b7e Start preparing for 2.7.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-17 10:05:44 -08:00
Junio C Hamano 7516977b4a Merge branch 'js/test-lib-windows-emulated-yes' into maint
The emulated "yes" command used in our test scripts has been
tweaked not to spend too much time generating unnecessary output
that is not used, to help those who test on Windows where it would
not stop until it fills the pipe buffer due to lack of SIGPIPE.

* js/test-lib-windows-emulated-yes:
  test-lib: limit the output of the yes utility
2016-02-17 10:03:41 -08:00
Junio C Hamano 0eefe108ec Merge branch 'aw/push-force-with-lease-reporting' into maint
"git push --force-with-lease" has been taught to report if the push
needed to force (or fast-forwarded).

* aw/push-force-with-lease-reporting:
  push: fix ref status reporting for --force-with-lease
2016-02-17 10:03:40 -08:00
Junio C Hamano 88221d92cb Merge branch 'nd/do-not-move-worktree-manually' into maint
"git worktree" had a broken code that attempted to auto-fix
possible inconsistency that results from end-users moving a
worktree to different places without telling Git (the original
repository needs to maintain backpointers to its worktrees, but
"mv" run by end-users who are not familiar with that fact will
obviously not adjust them), which actually made things worse
when triggered.

* nd/do-not-move-worktree-manually:
  worktree: stop supporting moving worktrees manually
  worktree.c: fix indentation
2016-02-17 10:03:40 -08:00
Junio C Hamano ab2c107eab Merge branch 'js/xmerge-marker-eol' into maint
The low-level merge machinery has been taught to use CRLF line
termination when inserting conflict markers to merged contents that
are themselves CRLF line-terminated.

* js/xmerge-marker-eol:
  merge-file: ensure that conflict sections match eol style
  merge-file: let conflict markers match end-of-line style of the context
2016-02-17 10:03:39 -08:00
GyuYong Jung 527d4a638e git-cvsserver.perl: fix typo
Signed-off-by: GyuYong Jung <obliviscence@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-17 10:00:53 -08:00
Johannes Schindelin d8ff76cf17 t5505: 'remote add x y' should work when url.y.insteadOf = x
This is the test missing from fb86e32 (git remote: allow adding
remotes agreeing with url.<...>.insteadOf, 2014-12-23): we should
allow adding a remote with the URL when it agrees with the
url.<...>.insteadOf setting.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-17 09:52:56 -08:00
brian m. carlson 121061f67f http: add option to try authentication without username
Performing GSS-Negotiate authentication using Kerberos does not require
specifying a username or password, since that information is already
included in the ticket itself.  However, libcurl refuses to perform
authentication if it has not been provided with a username and password.
Add an option, http.emptyAuth, that provides libcurl with an empty
username and password to make it attempt authentication anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-15 14:13:37 -08:00
Shawn Pearce 00540458a8 remote-curl: include curl_errorstr on SSL setup failures
For curl error 35 (CURLE_SSL_CONNECT_ERROR) users need the
additional text stored in CURLOPT_ERRORBUFFER to debug why
the connection did not start. This is curl_errorstr inside
of http.c, so include that in the message if it is non-empty.

Sometimes HTTP response codes aren't yet available, such as
when the SSL setup fails. Don't include HTTP 0 in the message.

Signed-off-by: Shawn Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-15 13:21:43 -08:00
Eric Wong 25bb90b103 t5570: add tests for "git {clone,fetch,pull} -v"
Now that git_connect is more information about connectivity
progress after: ("pass transport verbosity down to git_connect")
we should ensure it remains so for future users who need to
to diagnose networking problems.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-15 13:19:33 -08:00
Jeff King 753a2cda11 git-config: better document default behavior for --include
As described in the commit message of 9b25a0b (config: add
include directive, 2012-02-06), the `--include` option is
only on by default in some cases. But our documentation
described it as just "defaults to on", which doesn't tell
the whole story.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-13 12:51:31 -08:00
Nguyễn Thái Ngọc Duy 17f1365dbc rev-parse: take prefix into account in --git-common-dir
Most of the time, get_git_common_dir() returns an absolute path so
prefix is irrelevant. If it returns a relative path (e.g. from the
main worktree) then prefixing is required.

Noticed-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-12 16:01:47 -08:00
Jeff King de1e67d070 list-objects: pass full pathname to callbacks
When we find a blob at "a/b/c", we currently pass this to
our show_object_fn callbacks as two components: "a/b/" and
"c". Callbacks which want the full value then call
path_name(), which concatenates the two. But this is an
inefficient interface; the path is a strbuf, and we could
simply append "c" to it temporarily, then roll back the
length, without creating a new copy.

So we could improve this by teaching the callsites of
path_name() this trick (and there are only 3). But we can
also notice that no callback actually cares about the
broken-down representation, and simply pass each callback
the full path "a/b/c" as a string. The callback code becomes
even simpler, then, as we do not have to worry about freeing
an allocated buffer, nor rolling back our modification to
the strbuf.

This is theoretically less efficient, as some callbacks
would not bother to format the final path component. But in
practice this is not measurable. Since we use the same
strbuf over and over, our work to grow it is amortized, and
we really only pay to memcpy a few bytes.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-12 12:51:17 -08:00
Jeff King bd64516aca list-objects: drop name_path entirely
In the previous commit, we left name_path as a thin wrapper
around a strbuf. This patch drops it entirely. As a result,
every show_object_fn callback needs to be adjusted. However,
none of their code needs to be changed at all, because the
only use was to pass it to path_name(), which now handles
the bare strbuf.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-12 12:51:15 -08:00
Jeff King 13528ab37c list-objects: convert name_path to a strbuf
The "struct name_path" data is examined in only two places:
we generate it in process_tree(), and we convert it to a
single string in path_name(). Everyone else just passes it
through to those functions.

We can further note that process_tree() already keeps a
single strbuf with the leading tree path, for use with
tree_entry_interesting().

Instead of building a separate name_path linked list, let's
just use the one we already build in "base". This reduces
the amount of code (especially tricky code in path_name()
which did not check for integer overflows caused by deep
or large pathnames).

It is also more efficient in some instances.  Any time we
were using tree_entry_interesting, we were building up the
strbuf anyway, so this is an immediate and obvious win
there. In cases where we were not, we trade off storing
"pathname/" in a strbuf on the heap for each level of the
path, instead of two pointers and an int on the stack (with
one pointer into the tree object). On a 64-bit system, the
latter is 20 bytes; so if path components are less than that
on average, this has lower peak memory usage.  In practice
it probably doesn't matter either way; we are already
holding in memory all of the tree objects leading up to each
pathname, and for normal-depth pathnames, we are only
talking about hundreds of bytes.

This patch leaves "struct name_path" as a thin wrapper
around the strbuf, to avoid disrupting callbacks. We should
fix them, but leaving it out makes this diff easier to view.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-02-12 12:51:10 -08:00