git
8 years agoMerge branch 'hv/submodule-config'
Junio C Hamano [Mon, 31 Aug 2015 22:38:52 +0000 (15:38 -0700)] 
Merge branch 'hv/submodule-config'

The gitmodules API accessed from the C code learned to cache stuff
lazily.

* hv/submodule-config:
  submodule: allow erroneous values for the fetchRecurseSubmodules option
  submodule: use new config API for worktree configurations
  submodule: extract functions for config set and lookup
  submodule: implement a config API for lookup of .gitmodules values

8 years agoMerge branch 'sg/config-name-only'
Junio C Hamano [Mon, 31 Aug 2015 22:38:50 +0000 (15:38 -0700)] 
Merge branch 'sg/config-name-only'

"git config --list" output was hard to parse when values consist of
multiple lines.  "--name-only" option is added to help this.

* sg/config-name-only:
  get_urlmatch: avoid useless strbuf write
  format_config: simplify buffer handling
  format_config: don't init strbuf
  config: restructure format_config() for better control flow
  completion: list variable names reliably with 'git config --name-only'
  config: add '--name-only' option to list only variable names

8 years agoSync with 2.5.1
Junio C Hamano [Fri, 28 Aug 2015 19:32:45 +0000 (12:32 -0700)] 
Sync with 2.5.1

8 years agoSeventh batch for 2.6
Junio C Hamano [Fri, 28 Aug 2015 19:27:39 +0000 (12:27 -0700)] 
Seventh batch for 2.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'cc/trailers-corner-case-fix'
Junio C Hamano [Fri, 28 Aug 2015 19:32:17 +0000 (12:32 -0700)] 
Merge branch 'cc/trailers-corner-case-fix'

"interpret-trailers" helper mistook a single-liner log message that
has a colon as the end of existing trailer.

* cc/trailers-corner-case-fix:
  trailer: retitle a test and correct an in-comment message
  trailer: ignore first line of message

8 years agoMerge branch 'dt/untracked-subdir'
Junio C Hamano [Fri, 28 Aug 2015 19:32:14 +0000 (12:32 -0700)] 
Merge branch 'dt/untracked-subdir'

The experimental untracked-cache feature were buggy when paths with
a few levels of subdirectories are involved.

* dt/untracked-subdir:
  untracked cache: fix entry invalidation
  untracked-cache: fix subdirectory handling

8 years agoGit 2.5.1 v2.5.1
Junio C Hamano [Fri, 28 Aug 2015 18:19:57 +0000 (11:19 -0700)] 
Git 2.5.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMingw: verify both ends of the pipe () call
Jose F. Morales [Fri, 28 Aug 2015 09:43:37 +0000 (09:43 +0000)] 
Mingw: verify both ends of the pipe () call

The code to open and test the second end of the pipe clearly imitates
the code for the first end. A little too closely, though... Let's fix
the obvious copy-edit bug.

Signed-off-by: Jose F. Morales <jfmcjf@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSixth batch for 2.6
Junio C Hamano [Wed, 26 Aug 2015 22:47:48 +0000 (15:47 -0700)] 
Sixth batch for 2.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'sg/help-group'
Junio C Hamano [Wed, 26 Aug 2015 22:45:39 +0000 (15:45 -0700)] 
Merge branch 'sg/help-group'

We rewrote one of the build scripts in Perl but this reimplements
in Bourne shell.

* sg/help-group:
  generate-cmdlist: re-implement as shell script

8 years agoMerge branch 'sg/wt-status-header-inclusion'
Junio C Hamano [Wed, 26 Aug 2015 22:45:38 +0000 (15:45 -0700)] 
Merge branch 'sg/wt-status-header-inclusion'

* sg/wt-status-header-inclusion:
  wt-status: move #include "pathspec.h" to the header

8 years agoMerge branch 'as/docfix-reflog-expire-unreachable'
Junio C Hamano [Wed, 26 Aug 2015 22:45:37 +0000 (15:45 -0700)] 
Merge branch 'as/docfix-reflog-expire-unreachable'

* as/docfix-reflog-expire-unreachable:
  Documentation/config: fix inconsistent label on gc.*.reflogExpireUnreachable

8 years agoMerge branch 'sg/t3020-typofix'
Junio C Hamano [Wed, 26 Aug 2015 22:45:35 +0000 (15:45 -0700)] 
Merge branch 'sg/t3020-typofix'

* sg/t3020-typofix:
  t3020: fix typo in test description

8 years agoMerge branch 'jc/calloc-pathspec'
Junio C Hamano [Wed, 26 Aug 2015 22:45:33 +0000 (15:45 -0700)] 
Merge branch 'jc/calloc-pathspec'

* jc/calloc-pathspec:
  ps_matched: xcalloc() takes nmemb and then element size

8 years agoMerge branch 'dt/untracked-sparse'
Junio C Hamano [Wed, 26 Aug 2015 22:45:33 +0000 (15:45 -0700)] 
Merge branch 'dt/untracked-sparse'

Test update.

* dt/untracked-sparse:
  t7063: use --force-untracked-cache to speed up a bit

8 years agoMerge branch 'pt/am-builtin'
Junio C Hamano [Wed, 26 Aug 2015 22:45:33 +0000 (15:45 -0700)] 
Merge branch 'pt/am-builtin'

Rewrite "am" in "C".

* pt/am-builtin:
  i18n: am: fix typo in description of -b option

8 years agoMerge branch 'pt/am-builtin-abort-fix'
Junio C Hamano [Wed, 26 Aug 2015 22:45:32 +0000 (15:45 -0700)] 
Merge branch 'pt/am-builtin-abort-fix'

"git am" that was recently reimplemented in C had a performance
regression in "git am --abort" that goes back to the version before
an attempted (and failed) patch application.

* pt/am-builtin-abort-fix:
  am --skip/--abort: merge HEAD/ORIG_HEAD tree into index

8 years agoMerge branch 'po/po-readme'
Junio C Hamano [Wed, 26 Aug 2015 22:45:32 +0000 (15:45 -0700)] 
Merge branch 'po/po-readme'

* po/po-readme:
  po/README: Update directions for l10n contributors

8 years agoMerge branch 'jv/send-email-selective-smtp-auth'
Junio C Hamano [Wed, 26 Aug 2015 22:45:31 +0000 (15:45 -0700)] 
Merge branch 'jv/send-email-selective-smtp-auth'

"git send-email" learned a new option --smtp-auth to limit the SMTP
AUTH mechanisms to be used to a subset of what the system library
supports.

* jv/send-email-selective-smtp-auth:
  send-email: provide whitelist of SMTP AUTH mechanisms

8 years agoMerge branch 'ep/http-configure-ssl-version'
Junio C Hamano [Wed, 26 Aug 2015 22:45:31 +0000 (15:45 -0700)] 
Merge branch 'ep/http-configure-ssl-version'

A new configuration variable http.sslVersion can be used to specify
what specific version of SSL/TLS to use to make a connection.

* ep/http-configure-ssl-version:
  http: add support for specifying the SSL version

8 years agoMerge branch 'ss/fix-config-fd-leak'
Junio C Hamano [Wed, 26 Aug 2015 22:45:30 +0000 (15:45 -0700)] 
Merge branch 'ss/fix-config-fd-leak'

* ss/fix-config-fd-leak:
  config: close config file handle in case of error

8 years agoi18n: am: fix typo in description of -b option
Jiang Xin [Wed, 26 Aug 2015 15:51:19 +0000 (23:51 +0800)] 
i18n: am: fix typo in description of -b option

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotrailer: retitle a test and correct an in-comment message
Christian Couder [Wed, 26 Aug 2015 02:51:00 +0000 (04:51 +0200)] 
trailer: retitle a test and correct an in-comment message

Signed-off-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSync with maint
Junio C Hamano [Tue, 25 Aug 2015 23:09:30 +0000 (16:09 -0700)] 
Sync with maint

* maint:
  pull: pass upload_pack only when it was given

8 years agoMerge branch 'jk/guess-repo-name-regression-fix' into maint
Junio C Hamano [Tue, 25 Aug 2015 23:09:17 +0000 (16:09 -0700)] 
Merge branch 'jk/guess-repo-name-regression-fix' into maint

"git clone $URL" in recent releases of Git contains a regression in
the code that invents a new repository name incorrectly based on
the $URL.  This has been corrected.

* jk/guess-repo-name-regression-fix:
  clone: use computed length in guess_dir_name
  clone: add tests for output directory

8 years agoMerge branch 'jk/test-with-x' into maint
Junio C Hamano [Tue, 25 Aug 2015 23:09:16 +0000 (16:09 -0700)] 
Merge branch 'jk/test-with-x' into maint

Running tests with the "-x" option to make them verbose had some
unpleasant interactions with other features of the test suite.

* jk/test-with-x:
  test-lib: disable trace when test is not verbose
  test-lib: turn off "-x" tracing during chain-lint check

8 years agoMerge branch 'sb/check-return-from-read-ref' into maint
Junio C Hamano [Tue, 25 Aug 2015 23:09:16 +0000 (16:09 -0700)] 
Merge branch 'sb/check-return-from-read-ref' into maint

* sb/check-return-from-read-ref:
  transport-helper: die on errors reading refs.

8 years agoMerge branch 'mm/pull-upload-pack' into maint
Junio C Hamano [Tue, 25 Aug 2015 23:09:15 +0000 (16:09 -0700)] 
Merge branch 'mm/pull-upload-pack' into maint

"git pull" in recent releases of Git has a regression in the code
that allows custom path to the --upload-pack=<program>.  This has
been corrected.

Note that this is irrelevant for 'master' with "git pull" rewritten
in C.

* mm/pull-upload-pack:
  pull: pass upload_pack only when it was given
  pull.sh: quote $upload_pack when passing it to git-fetch

8 years agopull: pass upload_pack only when it was given
Junio C Hamano [Tue, 25 Aug 2015 23:06:53 +0000 (16:06 -0700)] 
pull: pass upload_pack only when it was given

The upload_pack shell variable is initialized to an empty string, so
conditional expansion with ${upload_pack+"$upload_pack"} would not
work very well.  You need a colon there.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoFifth batch for 2.6
Junio C Hamano [Tue, 25 Aug 2015 22:00:15 +0000 (15:00 -0700)] 
Fifth batch for 2.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'cb/open-noatime-clear-errno'
Junio C Hamano [Tue, 25 Aug 2015 21:57:10 +0000 (14:57 -0700)] 
Merge branch 'cb/open-noatime-clear-errno'

When trying to see that an object does not exist, a state errno
leaked from our "first try to open a packfile with O_NOATIME and
then if it fails retry without it" logic on a system that refuses
O_NOATIME.  This confused us and caused us to die, saying that the
packfile is unreadable, when we should have just reported that the
object does not exist in that packfile to the caller.

* cb/open-noatime-clear-errno:
  git_open_noatime: return with errno=0 on success

8 years agoMerge branch 'mh/tempfile'
Junio C Hamano [Tue, 25 Aug 2015 21:57:09 +0000 (14:57 -0700)] 
Merge branch 'mh/tempfile'

The "lockfile" API has been rebuilt on top of a new "tempfile" API.

* mh/tempfile:
  credential-cache--daemon: use tempfile module
  credential-cache--daemon: delete socket from main()
  gc: use tempfile module to handle gc.pid file
  lock_repo_for_gc(): compute the path to "gc.pid" only once
  diff: use tempfile module
  setup_temporary_shallow(): use tempfile module
  write_shared_index(): use tempfile module
  register_tempfile(): new function to handle an existing temporary file
  tempfile: add several functions for creating temporary files
  prepare_tempfile_object(): new function, extracted from create_tempfile()
  tempfile: a new module for handling temporary files
  commit_lock_file(): use get_locked_file_path()
  lockfile: add accessor get_lock_file_path()
  lockfile: add accessors get_lock_file_fd() and get_lock_file_fp()
  create_bundle(): duplicate file descriptor to avoid closing it twice
  lockfile: move documentation to lockfile.h and lockfile.c

8 years agoMerge branch 'pt/am-builtin-options'
Junio C Hamano [Tue, 25 Aug 2015 21:57:08 +0000 (14:57 -0700)] 
Merge branch 'pt/am-builtin-options'

After "git am --opt1" stops, running "git am --opt2" pays attention
to "--opt2" only for the patch that caused the original invocation
to stop.

* pt/am-builtin-options:
  am: let --signoff override --no-signoff
  am: let command-line options override saved options
  test_terminal: redirect child process' stdin to a pty

8 years agoMerge branch 'dt/refs-pseudo'
Junio C Hamano [Tue, 25 Aug 2015 21:57:08 +0000 (14:57 -0700)] 
Merge branch 'dt/refs-pseudo'

To prepare for allowing a different "ref" backend to be plugged in
to the system, update_ref()/delete_ref() have been taught about
ref-like things like MERGE_HEAD that are per-worktree (they will
always be written to the filesystem inside $GIT_DIR).

* dt/refs-pseudo:
  pseudoref: check return values from read_ref()
  sequencer: replace write_cherry_pick_head with update_ref
  bisect: use update_ref
  pseudorefs: create and use pseudoref update and delete functions
  refs: add ref_type function
  refs: introduce pseudoref and per-worktree ref concepts

8 years agoMerge branch 'dt/notes-multiple'
Junio C Hamano [Tue, 25 Aug 2015 21:57:08 +0000 (14:57 -0700)] 
Merge branch 'dt/notes-multiple'

When linked worktree is used, simultaneous "notes merge" instances
for the same ref in refs/notes/* are prevented from stomping on
each other.

* dt/notes-multiple:
  notes: handle multiple worktrees
  worktrees: add find_shared_symref

8 years agoMerge branch 'nd/dwim-wildcards-as-pathspecs'
Junio C Hamano [Tue, 25 Aug 2015 21:57:07 +0000 (14:57 -0700)] 
Merge branch 'nd/dwim-wildcards-as-pathspecs'

Test updates for Windows.

* nd/dwim-wildcards-as-pathspecs:
  t2019: skip test requiring '*' in a file name non Windows

8 years agoMerge branch 'jk/long-error-messages'
Junio C Hamano [Tue, 25 Aug 2015 21:57:06 +0000 (14:57 -0700)] 
Merge branch 'jk/long-error-messages'

The codepath to produce error messages had a hard-coded limit to
the size of the message, primarily to avoid memory allocation while
calling die().

* jk/long-error-messages:
  vreportf: avoid intermediate buffer
  vreportf: report to arbitrary filehandles

8 years agoMerge branch 'ee/clean-remove-dirs'
Junio C Hamano [Tue, 25 Aug 2015 21:57:06 +0000 (14:57 -0700)] 
Merge branch 'ee/clean-remove-dirs'

Test updates for Windows.

* ee/clean-remove-dirs:
  t7300-clean: require POSIXPERM for chmod 0 test

8 years agoMerge branch 'jh/strbuf-read-use-read-in-full'
Junio C Hamano [Tue, 25 Aug 2015 21:57:05 +0000 (14:57 -0700)] 
Merge branch 'jh/strbuf-read-use-read-in-full'

strbuf_read() used to have one extra iteration (and an unnecessary
strbuf_grow() of 8kB), which was eliminated.

* jh/strbuf-read-use-read-in-full:
  strbuf_read(): skip unnecessary strbuf_grow() at eof

8 years agogenerate-cmdlist: re-implement as shell script
Eric Sunshine [Sun, 23 Aug 2015 21:31:09 +0000 (17:31 -0400)] 
generate-cmdlist: re-implement as shell script

527ec39 (generate-cmdlist: parse common group commands, 2015-05-21)
replaced generate-cmdlist.sh with a more functional Perl version,
generate-cmdlist.perl. The Perl version gleans named tags from a new
"common groups" section in command-list.txt and recognizes those
tags in "command list" section entries in place of the old 'common'
tag. This allows git-help to, not only recognize, but also group
common commands.

Although the tests require Perl, 527ec39 creates an unconditional
dependence upon Perl in the build system itself, which can not be
overridden with NO_PERL. Such a dependency may be undesirable; for
instance, the 'git-lite' package in the FreeBSD ports tree is
intended as a minimal Git installation (which may, for example, be
useful on servers needing only local clone and update capability),
which, historically, has not depended upon Perl[1].

Therefore, revive generate-cmdlist.sh and extend it to recognize
"common groups" and its named tags. Retire generate-cmdlist.perl.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/275905/focus=276132

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agowt-status: move #include "pathspec.h" to the header
SZEDER Gábor [Thu, 20 Aug 2015 14:06:27 +0000 (16:06 +0200)] 
wt-status: move #include "pathspec.h" to the header

The declaration of 'struct wt_status' requires the declararion of 'struct
pathspec'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agotrailer: ignore first line of message
Christian Couder [Thu, 20 Aug 2015 21:59:15 +0000 (23:59 +0200)] 
trailer: ignore first line of message

When looking for the start of the trailers in the message
we are passed, we should ignore the first line of the message.

The reason is that if we are passed a patch or commit message
then the first line should be the patch title.
If we are passed only trailers we can expect that they start
with an empty line that can be ignored too.

This way we can properly process commit messages that have
only one line with something that looks like a trailer, for
example like "area of code: change we made".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoDocumentation/config: fix inconsistent label on gc.*.reflogExpireUnreachable
Andreas Schwab [Fri, 21 Aug 2015 15:06:18 +0000 (17:06 +0200)] 
Documentation/config: fix inconsistent label on gc.*.reflogExpireUnreachable

Change <ref> to <pattern> in the description of
gc.*.reflogExpireUnreachable, since that is what the text refers to.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoget_urlmatch: avoid useless strbuf write
Jeff King [Thu, 20 Aug 2015 14:49:45 +0000 (10:49 -0400)] 
get_urlmatch: avoid useless strbuf write

We create a strbuf only to insert a single string, pass the
resulting buffer to a function (which does not modify the
string), and then free it. We can just pass the original
string instead.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoformat_config: simplify buffer handling
Jeff King [Thu, 20 Aug 2015 14:47:34 +0000 (10:47 -0400)] 
format_config: simplify buffer handling

When formatting a config value into a strbuf, we may end
up stringifying it into a fixed-size buffer using sprintf,
and then copying that buffer into the strbuf. We can
eliminate the middle-man (and drop some calls to sprintf!)
by writing directly to the strbuf.

The reason it was written this way in the first place is
that we need to know before writing the value whether to
insert a delimiter. Instead of delaying the write of the
value, we speculatively write the delimiter, and roll it
back in the single case that cares.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoformat_config: don't init strbuf
Jeff King [Thu, 20 Aug 2015 14:46:04 +0000 (10:46 -0400)] 
format_config: don't init strbuf

It's unusual for a function which writes to a passed-in
strbuf to call strbuf_init; that will throw away anything
already there, leaking memory. In this case, there are
exactly two callers; one relies on this initialization and
the other passes in an already-initialized buffer.

There's no leak, as the initialized buffer doesn't have
anything in it. But let's bump the strbuf_init out to the
one caller who needs it, making format_config more
idiomatic.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoconfig: restructure format_config() for better control flow
SZEDER Gábor [Thu, 20 Aug 2015 14:14:22 +0000 (16:14 +0200)] 
config: restructure format_config() for better control flow

Commit 578625fa91 (config: add '--name-only' option to list only
variable names, 2015-08-10) modified format_config() such that it
returned from the middle of the function when showing only keys,
resulting in ugly code structure.

Reorganize the if statements and dealing with the key-value delimiter to
make the function easier to read.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot3020: fix typo in test description
SZEDER Gábor [Thu, 20 Aug 2015 13:58:55 +0000 (15:58 +0200)] 
t3020: fix typo in test description

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agops_matched: xcalloc() takes nmemb and then element size
Junio C Hamano [Thu, 20 Aug 2015 16:57:32 +0000 (09:57 -0700)] 
ps_matched: xcalloc() takes nmemb and then element size

Even though multiplication is commutative, the order of arguments
should be xcalloc(nmemb, size).  ps_matched is an array of 1-byte
element whose size is the same as the number of pathspec elements.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSync with maint
Junio C Hamano [Wed, 19 Aug 2015 21:49:37 +0000 (14:49 -0700)] 
Sync with maint

* maint:
  Start preparing for 2.5.1

8 years agoFourth batch for 2.6
Junio C Hamano [Wed, 19 Aug 2015 21:46:09 +0000 (14:46 -0700)] 
Fourth batch for 2.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'tb/complete-rebase-i-edit-todo'
Junio C Hamano [Wed, 19 Aug 2015 21:48:56 +0000 (14:48 -0700)] 
Merge branch 'tb/complete-rebase-i-edit-todo'

The command-line completion script (in contrib/) has been updated.

* tb/complete-rebase-i-edit-todo:
  completion: offer '--edit-todo' during interactive rebase

8 years agoMerge branch 'jk/git-path'
Junio C Hamano [Wed, 19 Aug 2015 21:48:56 +0000 (14:48 -0700)] 
Merge branch 'jk/git-path'

git_path() and mkpath() are handy helper functions but it is easy
to misuse, as the callers need to be careful to keep the number of
active results below 4.  Their uses have been reduced.

* jk/git-path:
  memoize common git-path "constant" files
  get_repo_path: refactor path-allocation
  find_hook: keep our own static buffer
  refs.c: remove_empty_directories can take a strbuf
  refs.c: avoid git_path assignment in lock_ref_sha1_basic
  refs.c: avoid repeated git_path calls in rename_tmp_log
  refs.c: simplify strbufs in reflog setup and writing
  path.c: drop git_path_submodule
  refs.c: remove extra git_path calls from read_loose_refs
  remote.c: drop extraneous local variable from migrate_file
  prefer mkpathdup to mkpath in assignments
  prefer git_pathdup to git_path in some possibly-dangerous cases
  add_to_alternates_file: don't add duplicate entries
  t5700: modernize style
  cache.h: complete set of git_path_submodule helpers
  cache.h: clarify documentation for git_path, et al

8 years agoMerge branch 'jc/finalize-temp-file'
Junio C Hamano [Wed, 19 Aug 2015 21:48:55 +0000 (14:48 -0700)] 
Merge branch 'jc/finalize-temp-file'

Long overdue micro clean-up.

* jc/finalize-temp-file:
  sha1_file.c: rename move_temp_to_file() to finalize_object_file()

8 years agoMerge branch 'ps/guess-repo-name-at-root'
Junio C Hamano [Wed, 19 Aug 2015 21:48:54 +0000 (14:48 -0700)] 
Merge branch 'ps/guess-repo-name-at-root'

"git clone $URL", when cloning from a site whose sole purpose is to
host a single repository (hence, no path after <scheme>://<site>/),
tried to use the site name as the new repository name, but did not
remove username or password when <site> part was of the form
<user>@<pass>:<host>.  The code is taught to redact these.

* ps/guess-repo-name-at-root:
  clone: abort if no dir name could be guessed
  clone: do not use port number as dir name
  clone: do not include authentication data in guessed dir

8 years agoMerge branch 'jk/guess-repo-name-regression-fix'
Junio C Hamano [Wed, 19 Aug 2015 21:48:54 +0000 (14:48 -0700)] 
Merge branch 'jk/guess-repo-name-regression-fix'

"git clone $URL" in recent releases of Git contains a regression in
the code that invents a new repository name incorrectly based on
the $URL.  This has been corrected.

* jk/guess-repo-name-regression-fix:
  clone: use computed length in guess_dir_name
  clone: add tests for output directory

8 years agoMerge branch 'jk/negative-hiderefs'
Junio C Hamano [Wed, 19 Aug 2015 21:48:53 +0000 (14:48 -0700)] 
Merge branch 'jk/negative-hiderefs'

A negative !ref entry in multi-value transfer.hideRefs
configuration can be used to say "don't hide this one".

* jk/negative-hiderefs:
  refs: support negative transfer.hideRefs
  docs/config.txt: reorder hideRefs config

8 years agoMerge branch 'jk/test-with-x'
Junio C Hamano [Wed, 19 Aug 2015 21:48:53 +0000 (14:48 -0700)] 
Merge branch 'jk/test-with-x'

Running tests with the "-x" option to make them verbose had some
unpleasant interactions with other features of the test suite.

* jk/test-with-x:
  test-lib: disable trace when test is not verbose
  test-lib: turn off "-x" tracing during chain-lint check

8 years agoMerge branch 'ps/t1509-chroot-test-fixup'
Junio C Hamano [Wed, 19 Aug 2015 21:48:52 +0000 (14:48 -0700)] 
Merge branch 'ps/t1509-chroot-test-fixup'

t1509 test that requires a dedicated VM environment had some
bitrot, which has been corrected.

* ps/t1509-chroot-test-fixup:
  tests: fix cleanup after tests in t1509-root-worktree
  tests: fix broken && chains in t1509-root-worktree

8 years agoMerge branch 'sb/check-return-from-read-ref'
Junio C Hamano [Wed, 19 Aug 2015 21:48:52 +0000 (14:48 -0700)] 
Merge branch 'sb/check-return-from-read-ref'

* sb/check-return-from-read-ref:
  transport-helper: die on errors reading refs.

8 years agoMerge branch 'mm/pull-upload-pack'
Junio C Hamano [Wed, 19 Aug 2015 21:48:51 +0000 (14:48 -0700)] 
Merge branch 'mm/pull-upload-pack'

"git pull" in recent releases of Git has a regression in the code
that allows custom path to the --upload-pack=<program>.  This has
been corrected.

Note that this is irrelevant for 'master' with "git pull" rewritten
in C.

* mm/pull-upload-pack:
  pull.sh: quote $upload_pack when passing it to git-fetch

8 years agoStart preparing for 2.5.1
Junio C Hamano [Wed, 19 Aug 2015 21:26:31 +0000 (14:26 -0700)] 
Start preparing for 2.5.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'ta/docfix-index-format-tech' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:34 +0000 (14:41 -0700)] 
Merge branch 'ta/docfix-index-format-tech' into maint

* ta/docfix-index-format-tech:
  typofix for index-format.txt

8 years agoMerge branch 'sb/parse-options-codeformat' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:33 +0000 (14:41 -0700)] 
Merge branch 'sb/parse-options-codeformat' into maint

* sb/parse-options-codeformat:
  parse-options: align curly braces for all options

8 years agoMerge branch 'sb/remove-unused-var-from-builtin-add' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:33 +0000 (14:41 -0700)] 
Merge branch 'sb/remove-unused-var-from-builtin-add' into maint

* sb/remove-unused-var-from-builtin-add:
  add: remove dead code

8 years agoMerge branch 'kn/tag-doc-fix' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:32 +0000 (14:41 -0700)] 
Merge branch 'kn/tag-doc-fix' into maint

* kn/tag-doc-fix:
  Documentation/tag: remove double occurance of "<pattern>"

8 years agoMerge branch 'es/doc-clean-outdated-tools' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:31 +0000 (14:41 -0700)] 
Merge branch 'es/doc-clean-outdated-tools' into maint

* es/doc-clean-outdated-tools:
  Documentation/git-tools: retire manually-maintained list
  Documentation/git-tools: drop references to defunct tools
  Documentation/git-tools: fix item text formatting
  Documentation/git-tools: improve discoverability of Git wiki
  Documentation/git: drop outdated Cogito reference

8 years agoMerge branch 'nd/export-worktree' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:30 +0000 (14:41 -0700)] 
Merge branch 'nd/export-worktree' into maint

Running an aliased command from a subdirectory when the .git thing
in the working tree is a gitfile pointing elsewhere did not work.

* nd/export-worktree:
  setup: set env $GIT_WORK_TREE when work tree is set, like $GIT_DIR

8 years agoMerge branch 'mh/fast-import-optimize-current-from' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:29 +0000 (14:41 -0700)] 
Merge branch 'mh/fast-import-optimize-current-from' into maint

Often a fast-import stream builds a new commit on top of the
previous commit it built, and it often unconditionally emits a
"from" command to specify the first parent, which can be omitted in
such a case.  This caused fast-import to forget the tree of the
previous commit and then re-read it from scratch, which was
inefficient.  Optimize for this common case.

* mh/fast-import-optimize-current-from:
  fast-import: do less work when given "from" matches current branch head

8 years agoMerge branch 'ib/scripted-parse-opt-better-hint-string' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:29 +0000 (14:41 -0700)] 
Merge branch 'ib/scripted-parse-opt-better-hint-string' into maint

The "rev-parse --parseopt" mode parsed the option specification
and the argument hint in a strange way to allow '=' and other
special characters in the option name while forbidding them from
the argument hint.  This made it impossible to define an option
like "--pair <key>=<value>" with "pair=key=value" specification,
which instead would have defined a "--pair=key <value>" option.

* ib/scripted-parse-opt-better-hint-string:
  rev-parse --parseopt: allow [*=?!] in argument hints

8 years agoMerge branch 'se/doc-checkout-ours-theirs' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:28 +0000 (14:41 -0700)] 
Merge branch 'se/doc-checkout-ours-theirs' into maint

A "rebase" replays changes of the local branch on top of something
else, as such they are placed in stage #3 and referred to as
"theirs", while the changes in the new base, typically a foreign
work, are placed in stage #2 and referred to as "ours".  Clarify
the "checkout --ours/--theirs".

* se/doc-checkout-ours-theirs:
  checkout: document subtlety around --ours/--theirs

8 years agoMerge branch 'cb/uname-in-untracked' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:27 +0000 (14:41 -0700)] 
Merge branch 'cb/uname-in-untracked' into maint

An experimental "untracked cache" feature used uname(2) in a
slightly unportable way.

* cb/uname-in-untracked:
  untracked: fix detection of uname(2) failure

8 years agoMerge branch 'as/sparse-checkout-removal' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:27 +0000 (14:41 -0700)] 
Merge branch 'as/sparse-checkout-removal' into maint

"sparse checkout" misbehaved for a path that is excluded from the
checkout when switching between branches that differ at the path.

* as/sparse-checkout-removal:
  unpack-trees: don't update files with CE_WT_REMOVE set

8 years agoMerge branch 'db/send-pack-user-signingkey' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:26 +0000 (14:41 -0700)] 
Merge branch 'db/send-pack-user-signingkey' into maint

The low-level "git send-pack" did not honor 'user.signingkey'
configuration variable when sending a signed-push.

* db/send-pack-user-signingkey:
  builtin/send-pack.c: respect user.signingkey

8 years agoMerge branch 'jx/do-not-crash-receive-pack-wo-head' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:26 +0000 (14:41 -0700)] 
Merge branch 'jx/do-not-crash-receive-pack-wo-head' into maint

An attempt to delete a ref by pushing into a repositorywhose HEAD
symbolic reference points at an unborn branch that cannot be
created due to ref D/F conflict (e.g. refs/heads/a/b exists, HEAD
points at refs/heads/a) failed.

* jx/do-not-crash-receive-pack-wo-head:
  receive-pack: crash when checking with non-exist HEAD

8 years agoMerge branch 'da/subtree-date-confusion' into maint
Junio C Hamano [Wed, 19 Aug 2015 21:41:24 +0000 (14:41 -0700)] 
Merge branch 'da/subtree-date-confusion' into maint

"git subtree" (in contrib/) depended on "git log" output to be
stable, which was a no-no.  Apply a workaround to force a
particular date format.

* da/subtree-date-confusion:
  contrib/subtree: ignore log.date configuration

8 years agosubmodule: allow erroneous values for the fetchRecurseSubmodules option
Heiko Voigt [Tue, 18 Aug 2015 00:22:00 +0000 (17:22 -0700)] 
submodule: allow erroneous values for the fetchRecurseSubmodules option

We should not die when reading the submodule config cache since the
user might not be able to get out of that situation when the
configuration is part of the history.

We should handle this condition later when the value is about to be
used.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosubmodule: use new config API for worktree configurations
Heiko Voigt [Tue, 18 Aug 2015 00:21:59 +0000 (17:21 -0700)] 
submodule: use new config API for worktree configurations

We remove the extracted functions and directly parse into and read out
of the cache. This allows us to have one unified way of accessing
submodule configuration values specific to single submodules. Regardless
whether we need to access a configuration from history or from the
worktree.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosubmodule: extract functions for config set and lookup
Heiko Voigt [Tue, 18 Aug 2015 00:21:58 +0000 (17:21 -0700)] 
submodule: extract functions for config set and lookup

This is one step towards using the new configuration API. We just
extract these functions to make replacing the actual code easier.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agosubmodule: implement a config API for lookup of .gitmodules values
Heiko Voigt [Tue, 18 Aug 2015 00:21:57 +0000 (17:21 -0700)] 
submodule: implement a config API for lookup of .gitmodules values

In a superproject some commands need to interact with submodules. They
need to query values from the .gitmodules file either from the worktree
of from certain revisions. At the moment this is quite hard since a
caller would need to read the .gitmodules file from the history and then
parse the values. We want to provide an API for this so we have one
place to get values from .gitmodules from any revision (including the
worktree).

The API is realized as a cache which allows us to lazily read
.gitmodules configurations by commit into a runtime cache which can then
be used to easily lookup values from it. Currently only the values for
path or name are stored but it can be extended for any value needed.

It is expected that .gitmodules files do not change often between
commits. Thats why we lookup the .gitmodules sha1 from a commit and then
either lookup an already parsed configuration or parse and cache an
unknown one for each sha1. The cache is lazily build on demand for each
requested commit.

This cache can be used for all purposes which need knowledge about
submodule configurations. Example use cases are:

 * Recursive submodule checkout needs to lookup a submodule name from
   its path when a submodule first appears. This needs be done before
   this configuration exists in the worktree.

 * The implementation of submodule support for 'git archive' needs to
   lookup the submodule name to generate the archive when given a
   revision that is not checked out.

 * 'git fetch' when given the --recurse-submodules=on-demand option (or
   configuration) needs to lookup submodule names by path from the
   database rather than reading from the worktree. For new submodule it
   needs to lookup the name from its path to allow cloning new
   submodules into the .git folder so they can be checked out without
   any network interaction when the user does a checkout of that
   revision.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoam --skip/--abort: merge HEAD/ORIG_HEAD tree into index
Paul Tan [Wed, 19 Aug 2015 08:22:22 +0000 (16:22 +0800)] 
am --skip/--abort: merge HEAD/ORIG_HEAD tree into index

After running "git am --abort", and then running "git reset --hard",
files that were not modified would still be re-checked out.

This is because clean_index() in builtin/am.c mistakenly called the
read_tree() function, which overwrites all entries in the index,
including the stat info.

"git am --skip" did not seem to have this issue because am_skip() called
am_run(), which called refresh_cache() to update the stat info. However,
there's still a performance penalty as the lack of stat info meant that
refresh_cache() would have to scan all files for changes.

Fix this by using unpack_trees() instead to merge the tree into the
index, so that the stat info from the index is kept.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agountracked cache: fix entry invalidation
Nguyễn Thái Ngọc Duy [Wed, 19 Aug 2015 13:01:26 +0000 (20:01 +0700)] 
untracked cache: fix entry invalidation

First, the current code in untracked_cache_invalidate_path() is wrong
because it can only handle paths "a" or "a/b", not "a/b/c" because
lookup_untracked() only looks for entries directly under the given
directory. In the last case, it will look for the entry "b/c" in
directory "a" instead. This means if you delete or add an entry in a
subdirectory, untracked cache may become out of date because it does not
invalidate properly. This is noticed by David Turner.

The second problem is about invalidation inside a fully untracked/excluded
directory. In this case we may have to invalidate back to root. See the
comment block for detail.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agountracked-cache: fix subdirectory handling
David Turner [Wed, 19 Aug 2015 13:01:25 +0000 (20:01 +0700)] 
untracked-cache: fix subdirectory handling

Previously, some calls lookup_untracked would pass a full path.  But
lookup_untracked assumes that the portion of the path up to and
including to the untracked_cache_dir has been removed.  So
lookup_untracked would be looking in the untracked_cache for 'foo' for
'foo/bar' (instead of just looking for 'bar').  This would cause
untracked cache corruption.

Instead, treat_directory learns to track the base length of the parent
directory, so that only the last path component is passed to
lookup_untracked.

Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agot7063: use --force-untracked-cache to speed up a bit
Nguyễn Thái Ngọc Duy [Wed, 19 Aug 2015 13:01:24 +0000 (20:01 +0700)] 
t7063: use --force-untracked-cache to speed up a bit

When in the middle of t7063, we are sure untracked cache is supported,
so we can use --force-untracked-cache to skip the support detection
phase and save a few seconds. It's also good that --force-untracked-cache
is exercised in the test suite.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoThird batch for 2.6
Junio C Hamano [Mon, 17 Aug 2015 22:09:25 +0000 (15:09 -0700)] 
Third batch for 2.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'dt/untracked-sparse'
Junio C Hamano [Mon, 17 Aug 2015 22:07:52 +0000 (15:07 -0700)] 
Merge branch 'dt/untracked-sparse'

Allow untracked cache (experimental) to be used when sparse
checkout (experimental) is also in use.

* dt/untracked-sparse:
  untracked-cache: support sparse checkout

8 years agoMerge branch 'ta/docfix-index-format-tech'
Junio C Hamano [Mon, 17 Aug 2015 22:07:52 +0000 (15:07 -0700)] 
Merge branch 'ta/docfix-index-format-tech'

* ta/docfix-index-format-tech:
  typofix for index-format.txt

8 years agoMerge branch 'mh/get-remote-group-fix'
Junio C Hamano [Mon, 17 Aug 2015 22:07:51 +0000 (15:07 -0700)] 
Merge branch 'mh/get-remote-group-fix'

An off-by-one error made "git remote" to mishandle a remote with a
single letter nickname.

* mh/get-remote-group-fix:
  get_remote_group(): use skip_prefix()
  get_remote_group(): eliminate superfluous call to strcspn()
  get_remote_group(): rename local variable "space" to "wordlen"
  get_remote_group(): handle remotes with single-character names

8 years agoMerge branch 'kd/pull-rebase-autostash'
Junio C Hamano [Mon, 17 Aug 2015 22:07:50 +0000 (15:07 -0700)] 
Merge branch 'kd/pull-rebase-autostash'

"git pull --rebase" has been taught to pay attention to
rebase.autostash configuration.

* kd/pull-rebase-autostash:
  pull: allow dirty tree when rebase.autostash enabled

8 years agosend-email: provide whitelist of SMTP AUTH mechanisms
Jan Viktorin [Tue, 11 Aug 2015 23:39:44 +0000 (01:39 +0200)] 
send-email: provide whitelist of SMTP AUTH mechanisms

When sending an e-mail, the client and server must agree on an
authentication mechanism. Some servers (due to misconfiguration
or a bug) deny valid credentials for certain mechanisms. In this
patch, a new option --smtp-auth and configuration entry smtpAuth
are introduced. If smtp_auth is defined, it works as a whitelist
of allowed mechanisms for authentication selected from the ones
supported by the installed SASL perl library.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agopo/README: Update directions for l10n contributors
Philip Oakley [Sun, 16 Aug 2015 07:56:56 +0000 (15:56 +0800)] 
po/README: Update directions for l10n contributors

Some Linux distributions (such as Ubuntu) have their own l10n workflows,
and their translations may be different.  Add notes for this case for
l10n translators.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agohttp: add support for specifying the SSL version
Elia Pinto [Fri, 14 Aug 2015 19:37:43 +0000 (21:37 +0200)] 
http: add support for specifying the SSL version

Teach git about a new option, "http.sslVersion", which permits one
to specify the SSL version to use when negotiating SSL connections.
The setting can be overridden by the GIT_SSL_VERSION environment
variable.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoconfig: close config file handle in case of error
Sven Strickroth [Fri, 14 Aug 2015 20:21:17 +0000 (22:21 +0200)] 
config: close config file handle in case of error

When updating an existing configuration file, we did not always
close the filehandle that is reading from the current configuration
file when we encountered an error (e.g. when unsetting a variable
that does not exist).

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocredential-cache--daemon: use tempfile module
Michael Haggerty [Mon, 10 Aug 2015 09:47:51 +0000 (11:47 +0200)] 
credential-cache--daemon: use tempfile module

Use the tempfile module to ensure that the socket file gets deleted on
program exit.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agocredential-cache--daemon: delete socket from main()
Michael Haggerty [Mon, 10 Aug 2015 09:47:50 +0000 (11:47 +0200)] 
credential-cache--daemon: delete socket from main()

main() is responsible for cleaning up the socket in the case of
errors, so it is reasonable to also make it responsible for cleaning
it up when there are no errors. This change also makes the next step
easier.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agogc: use tempfile module to handle gc.pid file
Michael Haggerty [Mon, 10 Aug 2015 09:47:49 +0000 (11:47 +0200)] 
gc: use tempfile module to handle gc.pid file

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agolock_repo_for_gc(): compute the path to "gc.pid" only once
Michael Haggerty [Mon, 10 Aug 2015 09:47:48 +0000 (11:47 +0200)] 
lock_repo_for_gc(): compute the path to "gc.pid" only once

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agodiff: use tempfile module
Michael Haggerty [Wed, 12 Aug 2015 17:12:01 +0000 (19:12 +0200)] 
diff: use tempfile module

Also add some code comments explaining how the fields in "struct
diff_tempfile" are used.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoSecond batch for 2.6
Junio C Hamano [Wed, 12 Aug 2015 21:16:31 +0000 (14:16 -0700)] 
Second batch for 2.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 years agoMerge branch 'sb/remove-unused-var-from-builtin-add'
Junio C Hamano [Wed, 12 Aug 2015 21:09:58 +0000 (14:09 -0700)] 
Merge branch 'sb/remove-unused-var-from-builtin-add'

* sb/remove-unused-var-from-builtin-add:
  add: remove dead code