]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
7 years agoMerge branch 'nd/init-core-worktree-in-multi-worktree-world'
Junio C Hamano [Mon, 3 Oct 2016 20:30:34 +0000 (13:30 -0700)] 
Merge branch 'nd/init-core-worktree-in-multi-worktree-world'

"git init" tried to record core.worktree in the repository's
'config' file when GIT_WORK_TREE environment variable was set and
it was different from where GIT_DIR appears as ".git" at its top,
but the logic was faulty when .git is a "gitdir:" file that points
at the real place, causing trouble in working trees that are
managed by "git worktree".  This has been corrected.

* nd/init-core-worktree-in-multi-worktree-world:
  init: kill git_link variable
  init: do not set unnecessary core.worktree
  init: kill set_git_dir_init()
  init: call set_git_dir_init() from within init_db()
  init: correct re-initialization from a linked worktree

7 years agoMerge branch 'ik/gitweb-force-highlight'
Junio C Hamano [Mon, 3 Oct 2016 20:30:33 +0000 (13:30 -0700)] 
Merge branch 'ik/gitweb-force-highlight'

"gitweb" can spawn "highlight" to show blob contents with
(programming) language-specific syntax highlighting, but only
when the language is known.  "highlight" can however be told
to make the guess itself by giving it "--force" option, which
has been enabled.

* ik/gitweb-force-highlight:
  gitweb: use highlight's shebang detection
  gitweb: remove unused guess_file_syntax() parameter

7 years agoMerge branch 'rs/copy-array'
Junio C Hamano [Mon, 3 Oct 2016 20:30:33 +0000 (13:30 -0700)] 
Merge branch 'rs/copy-array'

Code cleanup.

* rs/copy-array:
  use COPY_ARRAY
  add COPY_ARRAY

7 years agoSync with maint
Junio C Hamano [Thu, 29 Sep 2016 23:58:29 +0000 (16:58 -0700)] 
Sync with maint

* maint:
  Prepare for 2.10.1

7 years agoSixth batch for 2.11
Junio C Hamano [Thu, 29 Sep 2016 23:58:20 +0000 (16:58 -0700)] 
Sixth batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jc/worktree-config'
Junio C Hamano [Thu, 29 Sep 2016 23:57:14 +0000 (16:57 -0700)] 
Merge branch 'jc/worktree-config'

"git worktree", even though it used the default_abbrev setting that
ought to be affected by core.abbrev configuration variable, ignored
the variable setting.  The command has been taught to read the
default set of configuration variables to correct this.

* jc/worktree-config:
  worktree: honor configuration variables

7 years agoMerge branch 'jk/ident-ai-canonname-could-be-null'
Junio C Hamano [Thu, 29 Sep 2016 23:57:14 +0000 (16:57 -0700)] 
Merge branch 'jk/ident-ai-canonname-could-be-null'

In the codepath that comes up with the hostname to be used in an
e-mail when the user didn't tell us, we looked at ai_canonname
field in struct addrinfo without making sure it is not NULL first.

* jk/ident-ai-canonname-could-be-null:
  ident: handle NULL ai_canonname

7 years agoMerge branch 'jt/fetch-pack-in-vain-count-with-stateless'
Junio C Hamano [Thu, 29 Sep 2016 23:57:13 +0000 (16:57 -0700)] 
Merge branch 'jt/fetch-pack-in-vain-count-with-stateless'

When "git fetch" tries to find where the history of the repository
it runs in has diverged from what the other side has, it has a
mechanism to avoid digging too deep into irrelevant side branches.
This however did not work well over the "smart-http" transport due
to a design bug, which has been fixed.

* jt/fetch-pack-in-vain-count-with-stateless:
  fetch-pack: do not reset in_vain on non-novel acks

7 years agoMerge branch 'jk/verify-packfile-gently'
Junio C Hamano [Thu, 29 Sep 2016 23:57:13 +0000 (16:57 -0700)] 
Merge branch 'jk/verify-packfile-gently'

A low-level function verify_packfile() was meant to show errors
that were detected without dying itself, but under some conditions
it didn't and died instead, which has been fixed.

* jk/verify-packfile-gently:
  verify_packfile: check pack validity before accessing data

7 years agoMerge branch 'jt/mailinfo-fold-in-body-headers'
Junio C Hamano [Thu, 29 Sep 2016 23:57:12 +0000 (16:57 -0700)] 
Merge branch 'jt/mailinfo-fold-in-body-headers'

When "git format-patch --stdout" output is placed as an in-body
header and it uses the RFC2822 header folding, "git am" failed to
put the header line back into a single logical line.  The
underlying "git mailinfo" was taught to handle this properly.

* jt/mailinfo-fold-in-body-headers:
  mailinfo: handle in-body header continuations
  mailinfo: make is_scissors_line take plain char *
  mailinfo: separate in-body header processing

7 years agoPrepare for 2.10.1
Junio C Hamano [Thu, 29 Sep 2016 23:51:09 +0000 (16:51 -0700)] 
Prepare for 2.10.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'tg/add-chmod+x-fix' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:47 +0000 (16:49 -0700)] 
Merge branch 'tg/add-chmod+x-fix' into maint

"git add --chmod=+x <pathspec>" added recently only toggled the
executable bit for paths that are either new or modified. This has
been corrected to flip the executable bit for all paths that match
the given pathspec.

* tg/add-chmod+x-fix:
  t3700-add: do not check working tree file mode without POSIXPERM
  t3700-add: create subdirectory gently
  add: modify already added files when --chmod is given
  read-cache: introduce chmod_index_entry
  update-index: add test for chmod flags

7 years agoMerge branch 'et/add-chmod-x' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:46 +0000 (16:49 -0700)] 
Merge branch 'et/add-chmod-x' into maint

"git add --chmod=+x" added recently lacked documentation, which has
been corrected.

* et/add-chmod-x:
  add: document the chmod option

7 years agoMerge branch 'rt/rebase-i-broken-insn-advise' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:46 +0000 (16:49 -0700)] 
Merge branch 'rt/rebase-i-broken-insn-advise' into maint

When "git rebase -i" is given a broken instruction, it told the
user to fix it with "--edit-todo", but didn't say what the step
after that was (i.e. "--continue").

* rt/rebase-i-broken-insn-advise:
  rebase -i: improve advice on bad instruction lines

7 years agoMerge branch 'ls/travis-homebrew-path-fix' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:45 +0000 (16:49 -0700)] 
Merge branch 'ls/travis-homebrew-path-fix' into maint

The procedure to build Git on Mac OS X for Travis CI hardcoded the
internal directory structure we assumed HomeBrew uses, which was a
no-no.  The procedure has been updated to ask HomeBrew things we
need to know to fix this.

* ls/travis-homebrew-path-fix:
  travis-ci: ask homebrew for its path instead of hardcoding it

7 years agoMerge branch 'js/regexec-buf' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:44 +0000 (16:49 -0700)] 
Merge branch 'js/regexec-buf' into maint

Some codepaths in "git diff" used regexec(3) on a buffer that was
mmap(2)ed, which may not have a terminating NUL, leading to a read
beyond the end of the mapped region.  This was fixed by introducing
a regexec_buf() helper that takes a <ptr,len> pair with REG_STARTEND
extension.

* js/regexec-buf:
  regex: use regexec_buf()
  regex: add regexec_buf() that can work on a non NUL-terminated string
  regex: -G<pattern> feeds a non NUL-terminated string to regexec() and fails

7 years agoMerge branch 'nd/checkout-disambiguation' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:43 +0000 (16:49 -0700)] 
Merge branch 'nd/checkout-disambiguation' into maint

"git checkout <word>" does not follow the usual disambiguation
rules when the <word> can be both a rev and a path, to allow
checking out a branch 'foo' in a project that happens to have a
file 'foo' in the working tree without having to disambiguate.
This was poorly documented and the check was incorrect when the
command was run from a subdirectory.

* nd/checkout-disambiguation:
  checkout: fix ambiguity check in subdir
  checkout.txt: document a common case that ignores ambiguation rules
  checkout: add some spaces between code and comment

7 years agoMerge branch 'ep/doc-check-ref-format-example' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:43 +0000 (16:49 -0700)] 
Merge branch 'ep/doc-check-ref-format-example' into maint

A shell script example in check-ref-format documentation has been
fixed.

* ep/doc-check-ref-format-example:
  git-check-ref-format.txt: fixup documentation

7 years agoMerge branch 'mm/config-color-ui-default-to-auto' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:42 +0000 (16:49 -0700)] 
Merge branch 'mm/config-color-ui-default-to-auto' into maint

Documentation for individual configuration variables to control use
of color (like `color.grep`) said that their default value is
'false', instead of saying their default is taken from `color.ui`.
When we updated the default value for color.ui from 'false' to
'auto' quite a while ago, all of them broke.  This has been
corrected.

* mm/config-color-ui-default-to-auto:
  Documentation/config: default for color.* is color.ui

7 years agoMerge branch 'jk/reduce-gc-aggressive-depth' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:42 +0000 (16:49 -0700)] 
Merge branch 'jk/reduce-gc-aggressive-depth' into maint

"git gc --aggressive" used to limit the delta-chain length to 250,
which is way too deep for gaining additional space savings and is
detrimental for runtime performance.  The limit has been reduced to
50.

* jk/reduce-gc-aggressive-depth:
  gc: default aggressive depth to 50

7 years agoMerge branch 'jk/rebase-i-drop-ident-check' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:41 +0000 (16:49 -0700)] 
Merge branch 'jk/rebase-i-drop-ident-check' into maint

Even when "git pull --rebase=preserve" (and the underlying "git
rebase --preserve") can complete without creating any new commit
(i.e. fast-forwards), it still insisted on having a usable ident
information (read: user.email is set correctly), which was less
than nice.  As the underlying commands used inside "git rebase"
would fail with a more meaningful error message and advice text
when the bogus ident matters, this extra check was removed.

* jk/rebase-i-drop-ident-check:
  rebase-interactive: drop early check for valid ident

7 years agoMerge branch 'jt/format-patch-base-info-above-sig' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:40 +0000 (16:49 -0700)] 
Merge branch 'jt/format-patch-base-info-above-sig' into maint

"git format-patch --base=..." feature that was recently added
showed the base commit information after "-- " e-mail signature
line, which turned out to be inconvenient.  The base information
has been moved above the signature line.

* jt/format-patch-base-info-above-sig:
  format-patch: show base info before email signature

7 years agoMerge branch 'ks/perf-build-with-autoconf' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:40 +0000 (16:49 -0700)] 
Merge branch 'ks/perf-build-with-autoconf' into maint

Performance tests done via "t/perf" did not use the same set of
build configuration if the user relied on autoconf generated
configuration.

* ks/perf-build-with-autoconf:
  t/perf/run: copy config.mak.autogen & friends to build area

7 years agoMerge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:39 +0000 (16:49 -0700)] 
Merge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context' into maint

"git diff -W" output needs to extend the context backward to
include the header line of the current function and also forward to
include the body of the entire current function up to the header
line of the next one.  This process may have to merge to adjacent
hunks, but the code forgot to do so in some cases.

* rs/xdiff-merge-overlapping-hunks-for-W-context:
  xdiff: fix merging of hunks with -W context and -u context

7 years agoMerge branch 'ew/http-do-not-forget-to-call-curl-multi-remove-handle' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:39 +0000 (16:49 -0700)] 
Merge branch 'ew/http-do-not-forget-to-call-curl-multi-remove-handle' into maint

The http transport (with curl-multi option, which is the default
these days) failed to remove curl-easy handle from a curlm session,
which led to unnecessary API failures.

* ew/http-do-not-forget-to-call-curl-multi-remove-handle:
  http: always remove curl easy from curlm session on release
  http: consolidate #ifdefs for curl_multi_remove_handle
  http: warn on curl_multi_add_handle failures

7 years agoMerge branch 'jk/patch-ids-no-merges' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:38 +0000 (16:49 -0700)] 
Merge branch 'jk/patch-ids-no-merges' into maint

"git log --cherry-pick" used to include merge commits as candidates
to be matched up with other commits, resulting a lot of wasted time.
The patch-id generation logic has been updated to ignore merges to
avoid the wastage.

* jk/patch-ids-no-merges:
  patch-ids: refuse to compute patch-id for merge commit
  patch-ids: turn off rename detection

7 years agoMerge branch 'js/git-gui-commit-gpgsign' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:38 +0000 (16:49 -0700)] 
Merge branch 'js/git-gui-commit-gpgsign' into maint

"git commit-tree" stopped reading commit.gpgsign configuration
variable that was meant for Porcelain "git commit" in Git 2.9; we
forgot to update "git gui" to look at the configuration to match
this change.

* js/git-gui-commit-gpgsign:
  git-gui: respect commit.gpgsign again

7 years agoMerge branch 'jk/fix-remote-curl-url-wo-proto' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:38 +0000 (16:49 -0700)] 
Merge branch 'jk/fix-remote-curl-url-wo-proto' into maint

"git fetch http::/site/path" did not die correctly and segfaulted
instead.

* jk/fix-remote-curl-url-wo-proto:
  remote-curl: handle URLs without protocol

7 years agoMerge branch 'sy/git-gui-i18n-ja' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:37 +0000 (16:49 -0700)] 
Merge branch 'sy/git-gui-i18n-ja' into maint

Update Japanese translation for "git-gui".

* sy/git-gui-i18n-ja:
  git-gui: update Japanese information
  git-gui: update Japanese translation
  git-gui: add Japanese language code
  git-gui: apply po template to Japanese translation
  git-gui: consistently use the same word for "blame" in Japanese
  git-gui: consistently use the same word for "remote" in Japanese

7 years agoMerge branch 'mr/vcs-svn-printf-ulong' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:37 +0000 (16:49 -0700)] 
Merge branch 'mr/vcs-svn-printf-ulong' into maint

Code cleanup.

* mr/vcs-svn-printf-ulong:
  vcs-svn/fast_export: fix timestamp fmt specifiers

7 years agoMerge branch 'rs/unpack-trees-reduce-file-scope-global' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:36 +0000 (16:49 -0700)] 
Merge branch 'rs/unpack-trees-reduce-file-scope-global' into maint

Code cleanup.

* rs/unpack-trees-reduce-file-scope-global:
  unpack-trees: pass checkout state explicitly to check_updates()

7 years agoMerge branch 'rs/strbuf-remove-fix' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:35 +0000 (16:49 -0700)] 
Merge branch 'rs/strbuf-remove-fix' into maint

Code cleanup.

* rs/strbuf-remove-fix:
  strbuf: use valid pointer in strbuf_remove()

7 years agoMerge branch 'rs/checkout-some-states-are-const' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:35 +0000 (16:49 -0700)] 
Merge branch 'rs/checkout-some-states-are-const' into maint

Code cleanup.

* rs/checkout-some-states-are-const:
  checkout: constify parameters of checkout_stage() and checkout_merged()

7 years agoMerge branch 'bw/pathspec-remove-unused-extern-decl' into maint
Junio C Hamano [Thu, 29 Sep 2016 23:49:34 +0000 (16:49 -0700)] 
Merge branch 'bw/pathspec-remove-unused-extern-decl' into maint

Code cleanup.

* bw/pathspec-remove-unused-extern-decl:
  pathspec: remove unnecessary function prototypes

7 years agoworktree: honor configuration variables
Junio C Hamano [Tue, 27 Sep 2016 06:49:39 +0000 (23:49 -0700)] 
worktree: honor configuration variables

The command accesses default_abbrev (defined in environment.c and is
updated via core.abbrev configuration), but never makes any call to
git_config().  The output from "worktree list" ignores the abbrev
setting for this reason.

Make a call to git_config() to read the default set of configuration
variables at the beginning of the command.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoFifth batch for 2.11
Junio C Hamano [Mon, 26 Sep 2016 23:11:46 +0000 (16:11 -0700)] 
Fifth batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jk/clone-recursive-progress'
Junio C Hamano [Mon, 26 Sep 2016 23:09:22 +0000 (16:09 -0700)] 
Merge branch 'jk/clone-recursive-progress'

"git clone --recurse-submodules" lost the progress eye-candy in
recent update, which has been corrected.

* jk/clone-recursive-progress:
  clone: pass --progress decision to recursive submodules

7 years agoMerge branch 'jk/doc-cvs-update'
Junio C Hamano [Mon, 26 Sep 2016 23:09:22 +0000 (16:09 -0700)] 
Merge branch 'jk/doc-cvs-update'

Documentation around tools to import from CVS was fairly outdated.

* jk/doc-cvs-update:
  docs/cvs-migration: mention cvsimport caveats
  docs/cvs-migration: update link to cvsps homepage
  docs/cvsimport: prefer cvs-fast-export to parsecvs

7 years agoMerge branch 'rt/rebase-i-broken-insn-advise'
Junio C Hamano [Mon, 26 Sep 2016 23:09:21 +0000 (16:09 -0700)] 
Merge branch 'rt/rebase-i-broken-insn-advise'

When "git rebase -i" is given a broken instruction, it told the
user to fix it with "--edit-todo", but didn't say what the step
after that was (i.e. "--continue").

* rt/rebase-i-broken-insn-advise:
  rebase -i: improve advice on bad instruction lines

7 years agoMerge branch 'rs/checkout-init-macro'
Junio C Hamano [Mon, 26 Sep 2016 23:09:21 +0000 (16:09 -0700)] 
Merge branch 'rs/checkout-init-macro'

Code cleanup.

* rs/checkout-init-macro:
  introduce CHECKOUT_INIT

7 years agoMerge branch 'ls/travis-homebrew-path-fix'
Junio C Hamano [Mon, 26 Sep 2016 23:09:20 +0000 (16:09 -0700)] 
Merge branch 'ls/travis-homebrew-path-fix'

The procedure to build Git on Mac OS X for Travis CI hardcoded the
internal directory structure we assumed HomeBrew uses, which was a
no-no.  The procedure has been updated to ask HomeBrew things we
need to know to fix this.

* ls/travis-homebrew-path-fix:
  travis-ci: ask homebrew for its path instead of hardcoding it

7 years agoMerge branch 'tg/add-chmod+x-fix'
Junio C Hamano [Mon, 26 Sep 2016 23:09:20 +0000 (16:09 -0700)] 
Merge branch 'tg/add-chmod+x-fix'

"git add --chmod=+x <pathspec>" added recently only toggled the
executable bit for paths that are either new or modified. This has
been corrected to flip the executable bit for all paths that match
the given pathspec.

* tg/add-chmod+x-fix:
  t3700-add: do not check working tree file mode without POSIXPERM
  t3700-add: create subdirectory gently
  add: modify already added files when --chmod is given
  read-cache: introduce chmod_index_entry
  update-index: add test for chmod flags

7 years agoMerge branch 'js/regexec-buf'
Junio C Hamano [Mon, 26 Sep 2016 23:09:19 +0000 (16:09 -0700)] 
Merge branch 'js/regexec-buf'

Some codepaths in "git diff" used regexec(3) on a buffer that was
mmap(2)ed, which may not have a terminating NUL, leading to a read
beyond the end of the mapped region.  This was fixed by introducing
a regexec_buf() helper that takes a <ptr,len> pair with REG_STARTEND
extension.

* js/regexec-buf:
  regex: use regexec_buf()
  regex: add regexec_buf() that can work on a non NUL-terminated string
  regex: -G<pattern> feeds a non NUL-terminated string to regexec() and fails

7 years agoMerge branch 'nd/checkout-disambiguation'
Junio C Hamano [Mon, 26 Sep 2016 23:09:18 +0000 (16:09 -0700)] 
Merge branch 'nd/checkout-disambiguation'

"git checkout <word>" does not follow the usual disambiguation
rules when the <word> can be both a rev and a path, to allow
checking out a branch 'foo' in a project that happens to have a
file 'foo' in the working tree without having to disambiguate.
This was poorly documented and the check was incorrect when the
command was run from a subdirectory.

* nd/checkout-disambiguation:
  checkout: fix ambiguity check in subdir
  checkout.txt: document a common case that ignores ambiguation rules
  checkout: add some spaces between code and comment

7 years agoMerge branch 'va/i18n-more'
Junio C Hamano [Mon, 26 Sep 2016 23:09:17 +0000 (16:09 -0700)] 
Merge branch 'va/i18n-more'

Even more i18n.

* va/i18n-more:
  i18n: stash: mark messages for translation
  i18n: notes-merge: mark die messages for translation
  i18n: ident: mark hint for translation
  i18n: i18n: diff: mark die messages for translation
  i18n: connect: mark die messages for translation
  i18n: commit: mark message for translation

7 years agoMerge branch 'jt/format-patch-rfc'
Junio C Hamano [Mon, 26 Sep 2016 23:09:17 +0000 (16:09 -0700)] 
Merge branch 'jt/format-patch-rfc'

In some projects, it is common to use "[RFC PATCH]" as the subject
prefix for a patch meant for discussion rather than application.  A
new option "--rfc" was a short-hand for "--subject-prefix=RFC PATCH"
to help the participants of such projects.

* jt/format-patch-rfc:
  format-patch: add "--rfc" for the common case of [RFC PATCH]

7 years agoMerge branch 'ep/doc-check-ref-format-example'
Junio C Hamano [Mon, 26 Sep 2016 23:09:17 +0000 (16:09 -0700)] 
Merge branch 'ep/doc-check-ref-format-example'

A shell script example in check-ref-format documentation has been
fixed.

* ep/doc-check-ref-format-example:
  git-check-ref-format.txt: fixup documentation

7 years agoMerge branch 'mh/diff-indent-heuristic'
Junio C Hamano [Mon, 26 Sep 2016 23:09:16 +0000 (16:09 -0700)] 
Merge branch 'mh/diff-indent-heuristic'

Output from "git diff" can be made easier to read by selecting
which lines are common and which lines are added/deleted
intelligently when the lines before and after the changed section
are the same.  A command line option is added to help with the
experiment to find a good heuristics.

* mh/diff-indent-heuristic:
  blame: honor the diff heuristic options and config
  parse-options: add parse_opt_unknown_cb()
  diff: improve positioning of add/delete blocks in diffs
  xdl_change_compact(): introduce the concept of a change group
  recs_match(): take two xrecord_t pointers as arguments
  is_blank_line(): take a single xrecord_t as argument
  xdl_change_compact(): only use heuristic if group can't be matched
  xdl_change_compact(): fix compaction heuristic to adjust ixo

7 years agoMerge branch 'rs/c-auto-resets-attributes'
Junio C Hamano [Mon, 26 Sep 2016 23:09:15 +0000 (16:09 -0700)] 
Merge branch 'rs/c-auto-resets-attributes'

The pretty-format specifier "%C(auto)" used by the "log" family of
commands to enable coloring of the output is taught to also issue a
color-reset sequence to the output.

* rs/c-auto-resets-attributes:
  pretty: let %C(auto) reset all attributes

7 years agoMerge branch 'mm/config-color-ui-default-to-auto'
Junio C Hamano [Mon, 26 Sep 2016 23:09:14 +0000 (16:09 -0700)] 
Merge branch 'mm/config-color-ui-default-to-auto'

Documentation for individual configuration variables to control use
of color (like `color.grep`) said that their default value is
'false', instead of saying their default is taken from `color.ui`.
When we updated the default value for color.ui from 'false' to
'auto' quite a while ago, all of them broke.  This has been
corrected.

* mm/config-color-ui-default-to-auto:
  Documentation/config: default for color.* is color.ui

7 years agoMerge branch 'rs/cocci'
Junio C Hamano [Mon, 26 Sep 2016 23:09:14 +0000 (16:09 -0700)] 
Merge branch 'rs/cocci'

Code cleanup.

* rs/cocci:
  use strbuf_addstr() for adding constant strings to a strbuf, part 2
  add coccicheck make target
  contrib/coccinelle: fix semantic patch for oid_to_hex_r()

7 years agouse COPY_ARRAY
René Scharfe [Sun, 25 Sep 2016 07:24:03 +0000 (09:24 +0200)] 
use COPY_ARRAY

Add a semantic patch for converting certain calls of memcpy(3) to
COPY_ARRAY() and apply that transformation to the code base.  The result
is
 shorter and safer code.  For now only consider calls where source and
destination have the same type, or in other words: easy cases.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoadd COPY_ARRAY
René Scharfe [Sun, 25 Sep 2016 07:15:42 +0000 (09:15 +0200)] 
add COPY_ARRAY

Add COPY_ARRAY, a safe and convenient helper for copying arrays,
complementing ALLOC_ARRAY and REALLOC_ARRAY.  Users just specify source,
destination and the number of elements; the size of an element is
inferred automatically.

It checks if the multiplication of size and element count overflows.
The inferred size is passed first to st_mult, which allows the division
there to be done at compilation time.

As a basic type safety check it makes sure the sizes of source and
destination elements are the same.  That's evaluated at compilation time
as well.

COPY_ARRAY is safe to use with NULL as source pointer iff 0 elements are
to be copied.  That convention is used in some cases for initializing
arrays.  Raw memcpy(3) does not support it -- compilers are allowed to
assume that only valid pointers are passed to it and can optimize away
NULL checks after such a call.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agogitweb: use highlight's shebang detection
Ian Kelling [Sat, 24 Sep 2016 22:32:58 +0000 (15:32 -0700)] 
gitweb: use highlight's shebang detection

The "highlight" binary can, in some cases, determine the language type
by the means of file contents, for example the shebang in the first line
for some scripting languages.  Make use of this autodetection for files
which syntax is not known by gitweb.  In that case, pass the blob
contents to "highlight --force"; the parameter is needed to make it
always generate HTML output (which includes HTML-escaping).

Although we now run highlight on files which do not end up highlighted,
performance is virtually unaffected because when we call highlight, it
is used for escaping HTML.  In the case that highlight is used, gitweb
calls sanitize() instead of esc_html(), and the latter is significantly
slower (it does more, being roughly a superset of sanitize()).  Simple
benchmark comparing performance of 'blob' view of files without syntax
highlighting in gitweb before and after this change indicates ±1%
difference in request time for all file types.  Benchmark was performed
on local instance on Debian, using Apache/2.4.23 web server and CGI.

Document the feature and improve syntax highlight documentation, add
test to ensure gitweb doesn't crash when language detection is used.

Signed-off-by: Ian Kelling <ian@iankelling.org>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agogitweb: remove unused guess_file_syntax() parameter
Ian Kelling [Sat, 24 Sep 2016 22:32:57 +0000 (15:32 -0700)] 
gitweb: remove unused guess_file_syntax() parameter

Signed-off-by: Ian Kelling <ian@iankelling.org>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoinit: kill git_link variable
Nguyễn Thái Ngọc Duy [Sun, 25 Sep 2016 03:14:40 +0000 (10:14 +0700)] 
init: kill git_link variable

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoinit: do not set unnecessary core.worktree
Nguyễn Thái Ngọc Duy [Sun, 25 Sep 2016 03:14:39 +0000 (10:14 +0700)] 
init: do not set unnecessary core.worktree

The function needs_work_tree_config() that is called from
create_default_files() is supposed to be fed the path to ".git" that
looks as if it is at the top of the working tree, and decide if that
location matches the actual worktree being used.  This comparison allows
"git init" to decide if core.worktree needs to be recorded in the
working tree.

In the current code, however, we feed the return value from
get_git_dir(), which can be totally different from what the function
expects when "gitdir" file is involved.  Instead of giving the path to
the ".git" at the top of the working tree, we end up feeding the actual
path that the file points at.

This original location of ".git" however is only known to init_db().
Make init_db() save it and have it passed to create_default_files() as a
new parameter, which passes the correct location down to
needs_work_tree_config() to fix this.

Noticed-by: Max Nordlund <max.nordlund@sqore.com>
Helped-by: Michael J Gruber <git@drmicha.warpmail.net>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoinit: kill set_git_dir_init()
Nguyễn Thái Ngọc Duy [Sun, 25 Sep 2016 03:14:38 +0000 (10:14 +0700)] 
init: kill set_git_dir_init()

This is a pure code move, necessary to kill the global variable git_link
later (and also helps a bit in the next patch).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoinit: call set_git_dir_init() from within init_db()
Nguyễn Thái Ngọc Duy [Sun, 25 Sep 2016 03:14:37 +0000 (10:14 +0700)] 
init: call set_git_dir_init() from within init_db()

The next commit requires that set_git_dir_init() must be called before
init_db(). Let's make sure nobody can do otherwise.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoinit: correct re-initialization from a linked worktree
Nguyễn Thái Ngọc Duy [Sun, 25 Sep 2016 03:14:36 +0000 (10:14 +0700)] 
init: correct re-initialization from a linked worktree

When 'git init' is called from a linked worktree, we treat '.git'
dir (which is $GIT_COMMON_DIR/worktrees/something) as the main
'.git' (i.e. $GIT_COMMON_DIR) and populate the whole repository skeleton
in there. It does not harm anything (*) but it is still wrong.

Since 'git init' calls set_git_dir() at preparation time, which
indirectly calls get_common_dir() and correctly detects multiple
worktree setup, all git_path_buf() calls in create_default_files() will
return correct paths in both single and multiple worktree setups. The
only thing left is copy_templates(), which targets $GIT_DIR, not
$GIT_COMMON_DIR.

Fix that with get_git_common_dir(). This function will return $GIT_DIR
in single-worktree setup, so we don't have to make a special case for
multiple-worktree here.

(*) It does in fact, thanks to another bug. More on that later.

Noticed-by: Max Nordlund <max.nordlund@sqore.com>
Helped-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agofetch-pack: do not reset in_vain on non-novel acks
Jonathan Tan [Fri, 23 Sep 2016 17:41:35 +0000 (10:41 -0700)] 
fetch-pack: do not reset in_vain on non-novel acks

The MAX_IN_VAIN mechanism was introduced in commit f061e5f ("fetch-pack:
give up after getting too many "ack continue"", 2006-05-24) to stop ref
negotiation if a number of consecutive "have"s have been sent with no
corresponding new acks. This is to stop the client from digging too deep
in an irrelevant side branch in vain without ever finding a common
ancestor. A use case (as described in that commit) is the scenario in
which the local repository has more roots than the remote repository.

However, during a negotiation in which stateless RPCs are used,
MAX_IN_VAIN will (almost) never trigger (in the more-roots scenario
above and others) because in each new request, the client has to inform
the server of objects it already has and knows the server has (to remind
the server of the state), which the server then acks.

Make fetch-pack only consider, as new acks for the purpose of
MAX_IN_VAIN, acks for objects for which the client has never received an
ack before in this session.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoident: handle NULL ai_canonname
Jeff King [Fri, 23 Sep 2016 04:37:53 +0000 (00:37 -0400)] 
ident: handle NULL ai_canonname

We call getaddrinfo() to try to convert a short hostname
into a fully-qualified one (to use it as an email domain).
If there isn't a canonical name, getaddrinfo() will
generally return either a NULL addrinfo list, or one in
which ai->ai_canonname is a copy of the original name.

However, if the result of gethostname() looks like an IP
address, then getaddrinfo() behaves differently on some
systems. On OS X, it will return a "struct addrinfo" with a
NULL ai_canonname, and we segfault feeding it to strchr().

This is hard to test reliably because it involves not only a
system where we we have to fallback to gethostname() to come
up with an ident, but also where the hostname is a number
with no dots. But I was able to replicate the bug by faking
a hostname, like:

    diff --git a/ident.c b/ident.c
    index e20a772..b790d28 100644
    --- a/ident.c
    +++ b/ident.c
    @@ -128,6 +128,7 @@ static void add_domainname(struct strbuf *out, int *is_bogus)
                     *is_bogus = 1;
                     return;
             }
    +        xsnprintf(buf, sizeof(buf), "1");
             if (strchr(buf, '.'))
                     strbuf_addstr(out, buf);
             else if (canonical_name(buf, out) < 0) {

and running "git var GIT_AUTHOR_IDENT" on an OS X system.

Before this patch it segfaults, and after we correctly
complain of the bogus "user@1.(none)" address (though this
bogus address would be suitable for non-object uses like
writing reflogs).

Reported-by: Jonas Thiel <jonas.lierschied@gmx.de>
Diagnosed-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agointroduce CHECKOUT_INIT
René Scharfe [Thu, 22 Sep 2016 16:11:33 +0000 (18:11 +0200)] 
introduce CHECKOUT_INIT

Add a static initializer for struct checkout and use it throughout the
code base.  It's shorter, avoids a memset(3) call and makes sure the
base_dir member is initialized to a valid (empty) string.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agodocs/cvs-migration: mention cvsimport caveats
Jeff King [Thu, 22 Sep 2016 07:26:28 +0000 (03:26 -0400)] 
docs/cvs-migration: mention cvsimport caveats

Back when this guide was written, cvsimport was the only
game in town. These days it is probably not the best option.
Rather than go into details, let's point people to the note
at the top of cvsimport which gives other options.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agodocs/cvs-migration: update link to cvsps homepage
Jeff King [Thu, 22 Sep 2016 07:26:07 +0000 (03:26 -0400)] 
docs/cvs-migration: update link to cvsps homepage

The old page gives a 404 now. Searching for "cvsps" via
Google returns a GitHub project page as the top hit.

Reported-by: Dan Pritts
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agodocs/cvsimport: prefer cvs-fast-export to parsecvs
Jeff King [Thu, 22 Sep 2016 07:25:28 +0000 (03:25 -0400)] 
docs/cvsimport: prefer cvs-fast-export to parsecvs

parsecvs maintenance was taken over by ESR, and the name
changed to cvs-fast-export as it learned to support that
output format. Let's point to cvs-fast-export, as it should
have additional bug-fixes and be more convenient to use.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoclone: pass --progress decision to recursive submodules
Jeff King [Thu, 22 Sep 2016 05:24:46 +0000 (01:24 -0400)] 
clone: pass --progress decision to recursive submodules

When cloning with "--recursive", we'd generally expect
submodules to show progress reports if the main clone did,
too.

In older versions of git, this mostly worked out of the
box. Since we show progress by default when stderr is a tty,
and since the child clones inherit the parent stderr, then
both processes would come to the same decision by default.
If the parent clone was asked for "--quiet", we passed down
"--quiet" to the child. However, if stderr was not a tty and
the user specified "--progress", we did not propagate this
to the child.

That's a minor bug, but things got much worse when we
switched recently to submodule--helper's update_clone
command. With that change, the stderr of the child clones
are always connected to a pipe, and we never output
progress at all.

This patch teaches git-submodule and git-submodule--helper
how to pass down an explicit "--progress" flag when cloning.
The clone command then decides to propagate that flag based
on the cloning decision made earlier (which takes into
account isatty(2) of the parent process, existing --progress
or --quiet flags, etc). Since the child processes always run
without a tty on stderr, we don't have to worry about
passing an explicit "--no-progress"; it's the default for
them.

This fixes the recent loss of progress during recursive
clones. And as a bonus, it makes:

  git clone --recursive --progress ... 2>&1 | cat

work by triggering progress explicitly in the children.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoverify_packfile: check pack validity before accessing data
Jeff King [Thu, 22 Sep 2016 03:49:05 +0000 (23:49 -0400)] 
verify_packfile: check pack validity before accessing data

The verify_packfile() does not explicitly open the packfile;
instead, it starts with a sha1 checksum over the whole pack,
and relies on use_pack() to open the packfile as a side
effect.

If the pack cannot be opened for whatever reason (either
because its header information is corrupted, or perhaps
because a simultaneous repack deleted it), then use_pack()
will die(), as it has no way to return an error. This is not
ideal, as verify_packfile() otherwise tries to gently return
an error (this lets programs like git-fsck go on to check
other packs).

Instead, let's check is_pack_valid() up front, and return an
error if it fails. This will open the pack as a side effect,
and then use_pack() will later rely on our cached
descriptor, and avoid calling die().

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agotravis-ci: ask homebrew for its path instead of hardcoding it
Lars Schneider [Wed, 21 Sep 2016 08:45:18 +0000 (10:45 +0200)] 
travis-ci: ask homebrew for its path instead of hardcoding it

The TravisCI macOS build is broken because homebrew (a macOS dependency
manager) changed its internal directory structure [1]. This is a problem
because we modify the Perforce dependencies in the homebrew repository
before installing them.

Fix it by asking homebrew for its path instead of hardcoding it.

[1] https://github.com/Homebrew/brew/commit/0a09ae30f8b6117ad699b4a0439010738989c547

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoFourth batch for 2.11
Junio C Hamano [Wed, 21 Sep 2016 22:20:44 +0000 (15:20 -0700)] 
Fourth batch for 2.11

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jk/reduce-gc-aggressive-depth'
Junio C Hamano [Wed, 21 Sep 2016 22:15:29 +0000 (15:15 -0700)] 
Merge branch 'jk/reduce-gc-aggressive-depth'

"git gc --aggressive" used to limit the delta-chain length to 250,
which is way too deep for gaining additional space savings and is
detrimental for runtime performance.  The limit has been reduced to
50.

* jk/reduce-gc-aggressive-depth:
  gc: default aggressive depth to 50

7 years agoMerge branch 'jk/rebase-i-drop-ident-check'
Junio C Hamano [Wed, 21 Sep 2016 22:15:28 +0000 (15:15 -0700)] 
Merge branch 'jk/rebase-i-drop-ident-check'

Even when "git pull --rebase=preserve" (and the underlying "git
rebase --preserve") can complete without creating any new commit
(i.e. fast-forwards), it still insisted on having a usable ident
information (read: user.email is set correctly), which was less
than nice.  As the underlying commands used inside "git rebase"
would fail with a more meaningful error message and advice text
when the bogus ident matters, this extra check was removed.

* jk/rebase-i-drop-ident-check:
  rebase-interactive: drop early check for valid ident

7 years agoMerge branch 'va/i18n'
Junio C Hamano [Wed, 21 Sep 2016 22:15:28 +0000 (15:15 -0700)] 
Merge branch 'va/i18n'

More i18n.

* va/i18n:
  i18n: update-index: mark warnings for translation
  i18n: show-branch: mark plural strings for translation
  i18n: show-branch: mark error messages for translation
  i18n: receive-pack: mark messages for translation
  notes: spell first word of error messages in lowercase
  i18n: notes: mark error messages for translation
  i18n: merge-recursive: mark verbose message for translation
  i18n: merge-recursive: mark error messages for translation
  i18n: config: mark error message for translation
  i18n: branch: mark option description for translation
  i18n: blame: mark error messages for translation

7 years agoMerge branch 'jt/format-patch-base-info-above-sig'
Junio C Hamano [Wed, 21 Sep 2016 22:15:27 +0000 (15:15 -0700)] 
Merge branch 'jt/format-patch-base-info-above-sig'

"git format-patch --base=..." feature that was recently added
showed the base commit information after "-- " e-mail signature
line, which turned out to be inconvenient.  The base information
has been moved above the signature line.

* jt/format-patch-base-info-above-sig:
  format-patch: show base info before email signature

7 years agoMerge branch 'ks/perf-build-with-autoconf'
Junio C Hamano [Wed, 21 Sep 2016 22:15:27 +0000 (15:15 -0700)] 
Merge branch 'ks/perf-build-with-autoconf'

Performance tests done via "t/perf" did not use the same set of
build configuration if the user relied on autoconf generated
configuration.

* ks/perf-build-with-autoconf:
  t/perf/run: copy config.mak.autogen & friends to build area

7 years agoMerge branch 'mr/vcs-svn-printf-ulong'
Junio C Hamano [Wed, 21 Sep 2016 22:15:27 +0000 (15:15 -0700)] 
Merge branch 'mr/vcs-svn-printf-ulong'

Code cleanup.

* mr/vcs-svn-printf-ulong:
  vcs-svn/fast_export: fix timestamp fmt specifiers

7 years agoMerge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context'
Junio C Hamano [Wed, 21 Sep 2016 22:15:26 +0000 (15:15 -0700)] 
Merge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context'

"git diff -W" output needs to extend the context backward to
include the header line of the current function and also forward to
include the body of the entire current function up to the header
line of the next one.  This process may have to merge to adjacent
hunks, but the code forgot to do so in some cases.

* rs/xdiff-merge-overlapping-hunks-for-W-context:
  xdiff: fix merging of hunks with -W context and -u context

7 years agoMerge branch 'rs/unpack-trees-reduce-file-scope-global'
Junio C Hamano [Wed, 21 Sep 2016 22:15:26 +0000 (15:15 -0700)] 
Merge branch 'rs/unpack-trees-reduce-file-scope-global'

Code cleanup.

* rs/unpack-trees-reduce-file-scope-global:
  unpack-trees: pass checkout state explicitly to check_updates()

7 years agoMerge branch 'rs/strbuf-remove-fix'
Junio C Hamano [Wed, 21 Sep 2016 22:15:25 +0000 (15:15 -0700)] 
Merge branch 'rs/strbuf-remove-fix'

Code cleanup.

* rs/strbuf-remove-fix:
  strbuf: use valid pointer in strbuf_remove()

7 years agoMerge branch 'rs/pack-sort-with-llist-mergesort'
Junio C Hamano [Wed, 21 Sep 2016 22:15:25 +0000 (15:15 -0700)] 
Merge branch 'rs/pack-sort-with-llist-mergesort'

Code cleanup.

* rs/pack-sort-with-llist-mergesort:
  sha1_file: use llist_mergesort() for sorting packs

7 years agoMerge branch 'rs/checkout-some-states-are-const'
Junio C Hamano [Wed, 21 Sep 2016 22:15:24 +0000 (15:15 -0700)] 
Merge branch 'rs/checkout-some-states-are-const'

Code cleanup.

* rs/checkout-some-states-are-const:
  checkout: constify parameters of checkout_stage() and checkout_merged()

7 years agoMerge branch 'jk/setup-sequence-update'
Junio C Hamano [Wed, 21 Sep 2016 22:15:23 +0000 (15:15 -0700)] 
Merge branch 'jk/setup-sequence-update'

There were numerous corner cases in which the configuration files
are read and used or not read at all depending on the directory a
Git command was run, leading to inconsistent behaviour.  The code
to set-up repository access at the beginning of a Git process has
been updated to fix them.

* jk/setup-sequence-update:
  t1007: factor out repeated setup
  init: reset cached config when entering new repo
  init: expand comments explaining config trickery
  config: only read .git/config from configured repos
  test-config: setup git directory
  t1302: use "git -C"
  pager: handle early config
  pager: use callbacks instead of configset
  pager: make pager_program a file-local static
  pager: stop loading git_default_config()
  pager: remove obsolete comment
  diff: always try to set up the repository
  diff: handle --no-index prefixes consistently
  diff: skip implicit no-index check when given --no-index
  patch-id: use RUN_SETUP_GENTLY
  hash-object: always try to set up the git repository

7 years agoMerge branch 'ew/http-do-not-forget-to-call-curl-multi-remove-handle'
Junio C Hamano [Wed, 21 Sep 2016 22:15:23 +0000 (15:15 -0700)] 
Merge branch 'ew/http-do-not-forget-to-call-curl-multi-remove-handle'

The http transport (with curl-multi option, which is the default
these days) failed to remove curl-easy handle from a curlm session,
which led to unnecessary API failures.

* ew/http-do-not-forget-to-call-curl-multi-remove-handle:
  http: always remove curl easy from curlm session on release
  http: consolidate #ifdefs for curl_multi_remove_handle
  http: warn on curl_multi_add_handle failures

7 years agoMerge branch 'bw/pathspec-remove-unused-extern-decl'
Junio C Hamano [Wed, 21 Sep 2016 22:15:22 +0000 (15:15 -0700)] 
Merge branch 'bw/pathspec-remove-unused-extern-decl'

Code cleanup.

* bw/pathspec-remove-unused-extern-decl:
  pathspec: remove unnecessary function prototypes

7 years agoMerge branch 'ks/pack-objects-bitmap'
Junio C Hamano [Wed, 21 Sep 2016 22:15:21 +0000 (15:15 -0700)] 
Merge branch 'ks/pack-objects-bitmap'

Some codepaths in "git pack-objects" were not ready to use an
existing pack bitmap; now they are and as the result they have
become faster.

* ks/pack-objects-bitmap:
  pack-objects: use reachability bitmap index when generating non-stdout pack
  pack-objects: respect --local/--honor-pack-keep/--incremental when bitmap is in use

7 years agoMerge branch 'jk/patch-ids-no-merges'
Junio C Hamano [Wed, 21 Sep 2016 22:15:20 +0000 (15:15 -0700)] 
Merge branch 'jk/patch-ids-no-merges'

"git log --cherry-pick" used to include merge commits as candidates
to be matched up with other commits, resulting a lot of wasted time.
The patch-id generation logic has been updated to ignore merges to
avoid the wastage.

* jk/patch-ids-no-merges:
  patch-ids: refuse to compute patch-id for merge commit
  patch-ids: turn off rename detection

7 years agoMerge branch 'jk/delta-base-cache'
Junio C Hamano [Wed, 21 Sep 2016 22:15:20 +0000 (15:15 -0700)] 
Merge branch 'jk/delta-base-cache'

Recently we updated the code to manage the in-core cache that holds
objects that have recently been used to reconstitute other objects
that are stored as deltas against them, but the update used an
incorrect API function to manage the list of these objects.  This
has been fixed.

* jk/delta-base-cache:
  add_delta_base_cache: use list_for_each_safe

7 years agoMerge branch 'et/add-chmod-x'
Junio C Hamano [Wed, 21 Sep 2016 22:15:19 +0000 (15:15 -0700)] 
Merge branch 'et/add-chmod-x'

"git add --chmod=+x" added recently lacked documentation, which has
been corrected.

* et/add-chmod-x:
  add: document the chmod option

7 years agoMerge branch 'js/cat-file-filters'
Junio C Hamano [Wed, 21 Sep 2016 22:15:18 +0000 (15:15 -0700)] 
Merge branch 'js/cat-file-filters'

Even though "git hash-objects", which is a tool to take an
on-filesystem data stream and put it into the Git object store,
allowed to perform the "outside-world-to-Git" conversions (e.g.
end-of-line conversions and application of the clean-filter), and
it had the feature on by default from very early days, its reverse
operation "git cat-file", which takes an object from the Git object
store and externalize for the consumption by the outside world,
lacked an equivalent mechanism to run the "Git-to-outside-world"
conversion.  The command learned the "--filters" option to do so.

* js/cat-file-filters:
  cat-file: support --textconv/--filters in batch mode
  cat-file --textconv/--filters: allow specifying the path separately
  cat-file: introduce the --filters option
  cat-file: fix a grammo in the man page

7 years agoMerge branch 'jt/accept-capability-advertisement-when-fetching-from-void'
Junio C Hamano [Wed, 21 Sep 2016 22:15:17 +0000 (15:15 -0700)] 
Merge branch 'jt/accept-capability-advertisement-when-fetching-from-void'

JGit can show a fake ref "capabilities^{}" to "git fetch" when it
does not advertise any refs, but "git fetch" was not prepared to
see such an advertisement.  When the other side disconnects without
giving any ref advertisement, we used to say "there may not be a
repository at that URL", but we may have seen other advertisement
like "shallow" and ".have" in which case we definitely know that a
repository is there.  The code to detect this case has also been
updated.

* jt/accept-capability-advertisement-when-fetching-from-void:
  connect: advertized capability is not a ref
  connect: tighten check for unexpected early hang up
  tests: move test_lazy_prereq JGIT to test-lib.sh

7 years agot3700-add: do not check working tree file mode without POSIXPERM
Johannes Sixt [Tue, 20 Sep 2016 06:18:25 +0000 (08:18 +0200)] 
t3700-add: do not check working tree file mode without POSIXPERM

A recently introduced test checks the result of 'git status' after
setting the executable bit on a file. This check does not yield the
expected result when the filesystem does not support the executable
bit.

What we care about is that a file added with "--chmod=+x" has
executable bit in the index and that "--chmod=+x" (or any other
options for that matter) does not muck with working tree files.
The former is tested by other existing tests, so let's check the
latter more explicitly and only under POSIXPERM prerequisite.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoregex: use regexec_buf()
Johannes Schindelin [Wed, 21 Sep 2016 18:24:14 +0000 (20:24 +0200)] 
regex: use regexec_buf()

The new regexec_buf() function operates on buffers with an explicitly
specified length, rather than NUL-terminated strings.

We need to use this function whenever the buffer we want to pass to
regexec(3) may have been mmap(2)ed (and is hence not NUL-terminated).

Note: the original motivation for this patch was to fix a bug where
`git diff -G <regex>` would crash. This patch converts more callers,
though, some of which allocated to construct NUL-terminated strings,
or worse, modified buffers to temporarily insert NULs while calling
regexec(3).  By converting them to use regexec_buf(), the code has
become much cleaner.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoregex: add regexec_buf() that can work on a non NUL-terminated string
Johannes Schindelin [Wed, 21 Sep 2016 18:24:04 +0000 (20:24 +0200)] 
regex: add regexec_buf() that can work on a non NUL-terminated string

We just introduced a test that demonstrates that our sloppy use of
regexec() on a mmap()ed area can result in incorrect results or even
hard crashes.

So what we need to fix this is a function that calls regexec() on a
length-delimited, rather than a NUL-terminated, string.

Happily, there is an extension to regexec() introduced by the NetBSD
project and present in all major regex implementation including
Linux', MacOSX' and the one Git includes in compat/regex/: by using
the (non-POSIX) REG_STARTEND flag, it is possible to tell the
regexec() function that it should only look at the offsets between
pmatch[0].rm_so and pmatch[0].rm_eo.

That is exactly what we need.

Since support for REG_STARTEND is so widespread by now, let's just
introduce a helper function that always uses it, and tell people
on a platform whose regex library does not support it to use the
one from our compat/regex/ directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoregex: -G<pattern> feeds a non NUL-terminated string to regexec() and fails
Johannes Schindelin [Wed, 21 Sep 2016 18:23:22 +0000 (20:23 +0200)] 
regex: -G<pattern> feeds a non NUL-terminated string to regexec() and fails

When our pickaxe code feeds file contents to regexec(), it implicitly
assumes that the file contents are read into implicitly NUL-terminated
buffers (i.e. that we overallocate by 1, appending a single '\0').

This is not so.

In particular when the file contents are simply mmap()ed, we can be
virtually certain that the buffer is preceding uninitialized bytes, or
invalid pages.

Note that the test we add here is known to be flakey: we simply cannot
know whether the byte following the mmap()ed ones is a NUL or not.

Typically, on Linux the test passes. On Windows, it fails virtually
every time due to an access violation (that's a segmentation fault for
you Unix-y people out there). And Windows would be correct: the
regexec() call wants to operate on a regular, NUL-terminated string,
there is no NUL in the mmap()ed memory range, and it is undefined
whether the next byte is even legal to access.

When run with --valgrind it demonstrates quite clearly the breakage, of
course.

Being marked with `test_expect_failure`, this test will sometimes be
declare "TODO fixed", even if it only passes by mistake.

This test case represents a Minimal, Complete and Verifiable Example of
a breakage reported by Chris Sidi.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agogit-check-ref-format.txt: fixup documentation
Elia Pinto [Tue, 20 Sep 2016 07:33:14 +0000 (07:33 +0000)] 
git-check-ref-format.txt: fixup documentation

die is not a standard shell function. Use
a different shell code for the example.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agot3700-add: create subdirectory gently
Johannes Sixt [Tue, 20 Sep 2016 06:16:11 +0000 (08:16 +0200)] 
t3700-add: create subdirectory gently

The subdirectory 'sub' is created early in the test file. Later, a test
case removes it during its clean-up actions. However, this test case is
protected by POSIXPERM. Consequently, 'sub' remains when the POSIXPERM
prerequisite is not satisfied. Later, a recently introduced test case
creates 'sub' again. Use -p with mkdir so that it does not fail if 'sub'
already exists.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomailinfo: handle in-body header continuations
Jonathan Tan [Tue, 20 Sep 2016 17:17:53 +0000 (10:17 -0700)] 
mailinfo: handle in-body header continuations

Mailinfo currently handles multi-line headers, but it does not handle
multi-line in-body headers. Teach it to handle such headers, for
example, for this input:

  From: author <author@example.com>
  Date: Fri, 9 Jun 2006 00:44:16 -0700
  Subject: a very long
   broken line

  Subject: another very long
   broken line

interpret the in-body subject to be "another very long broken line"
instead of "another very long".

An existing test (t/t5100/msg0015) has an indented line immediately
after an in-body header - it has been modified to reflect the new
functionality.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: stash: mark messages for translation
Vasco Almeida [Mon, 19 Sep 2016 13:08:21 +0000 (13:08 +0000)] 
i18n: stash: mark messages for translation

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: notes-merge: mark die messages for translation
Vasco Almeida [Mon, 19 Sep 2016 13:08:20 +0000 (13:08 +0000)] 
i18n: notes-merge: mark die messages for translation

Update test to reflect changes.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: ident: mark hint for translation
Vasco Almeida [Mon, 19 Sep 2016 13:08:19 +0000 (13:08 +0000)] 
i18n: ident: mark hint for translation

Mark env_hint for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>