git/git.git
2 years agoMerge branch 'ot/ref-filter-cleanup'
Junio C Hamano [Thu, 8 Mar 2018 20:36:24 +0000 (12:36 -0800)]
Merge branch 'ot/ref-filter-cleanup'

Code cleanup.

* ot/ref-filter-cleanup:
  ref-filter: get rid of goto
  ref-filter: get rid of duplicate code

2 years agoMerge branch 'jh/status-no-ahead-behind'
Junio C Hamano [Thu, 8 Mar 2018 20:36:24 +0000 (12:36 -0800)]
Merge branch 'jh/status-no-ahead-behind'

"git status" can spend a lot of cycles to compute the relation
between the current branch and its upstream, which can now be
disabled with "--no-ahead-behind" option.

* jh/status-no-ahead-behind:
  status: support --no-ahead-behind in long format
  status: update short status to respect --no-ahead-behind
  status: add --[no-]ahead-behind to status and commit for V2 format.
  stat_tracking_info: return +1 when branches not equal

2 years agoMerge branch 'sg/travis-build-during-script-phase'
Junio C Hamano [Thu, 8 Mar 2018 20:36:23 +0000 (12:36 -0800)]
Merge branch 'sg/travis-build-during-script-phase'

Build the executable in 'script' phase in Travis CI integration, to
follow the established practice, rather than during 'before_script'
phase.  This allows the CI categorize the failures better ('failed'
is project's fault, 'errored' is build environment's).

* sg/travis-build-during-script-phase:
  travis-ci: build Git during the 'script' phase

2 years agoSeventh batch for 2.17
Junio C Hamano [Tue, 6 Mar 2018 22:59:10 +0000 (14:59 -0800)]
Seventh batch for 2.17

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'bw/perl-timegm-timelocal-fix'
Junio C Hamano [Tue, 6 Mar 2018 22:54:08 +0000 (14:54 -0800)]
Merge branch 'bw/perl-timegm-timelocal-fix'

Y2k20 fix ;-) for our perl scripts.

* bw/perl-timegm-timelocal-fix:
  perl: call timegm and timelocal with 4-digit year

2 years agoMerge branch 'jk/strbuf-read-file-close-error'
Junio C Hamano [Tue, 6 Mar 2018 22:54:08 +0000 (14:54 -0800)]
Merge branch 'jk/strbuf-read-file-close-error'

Code clean-up.

* jk/strbuf-read-file-close-error:
  strbuf_read_file(): preserve errno across close() call

2 years agoMerge branch 'bw/c-plus-plus'
Junio C Hamano [Tue, 6 Mar 2018 22:54:07 +0000 (14:54 -0800)]
Merge branch 'bw/c-plus-plus'

Avoid using identifiers that clash with C++ keywords.  Even though
it is not a goal to compile Git with C++ compilers, changes like
this help use of code analysis tools that targets C++ on our
codebase.

* bw/c-plus-plus: (37 commits)
  replace: rename 'new' variables
  trailer: rename 'template' variables
  tempfile: rename 'template' variables
  wrapper: rename 'template' variables
  environment: rename 'namespace' variables
  diff: rename 'template' variables
  environment: rename 'template' variables
  init-db: rename 'template' variables
  unpack-trees: rename 'new' variables
  trailer: rename 'new' variables
  submodule: rename 'new' variables
  split-index: rename 'new' variables
  remote: rename 'new' variables
  ref-filter: rename 'new' variables
  read-cache: rename 'new' variables
  line-log: rename 'new' variables
  imap-send: rename 'new' variables
  http: rename 'new' variables
  entry: rename 'new' variables
  diffcore-delta: rename 'new' variables
  ...

2 years agoMerge branch 'rs/strbuf-read-file-or-whine'
Junio C Hamano [Tue, 6 Mar 2018 22:54:07 +0000 (14:54 -0800)]
Merge branch 'rs/strbuf-read-file-or-whine'

Code clean-up.

* rs/strbuf-read-file-or-whine:
  sequencer: factor out strbuf_read_file_or_whine()

2 years agoMerge branch 'ms/non-ascii-ticks'
Junio C Hamano [Tue, 6 Mar 2018 22:54:06 +0000 (14:54 -0800)]
Merge branch 'ms/non-ascii-ticks'

Doc markup fix.

* ms/non-ascii-ticks:
  Documentation/gitsubmodules.txt: avoid non-ASCII apostrophes

2 years agoMerge branch 'jk/test-helper-v-output-fix'
Junio C Hamano [Tue, 6 Mar 2018 22:54:05 +0000 (14:54 -0800)]
Merge branch 'jk/test-helper-v-output-fix'

Test framework update.

* jk/test-helper-v-output-fix:
  t: send verbose test-helper output to fd 4

2 years agoMerge branch 'jk/cached-commit-buffer'
Junio C Hamano [Tue, 6 Mar 2018 22:54:05 +0000 (14:54 -0800)]
Merge branch 'jk/cached-commit-buffer'

Code clean-up.

* jk/cached-commit-buffer:
  revision: drop --show-all option
  commit: drop uses of get_cached_commit_buffer()

2 years agoMerge branch 'bw/doc-submodule-recurse-config-with-clone'
Junio C Hamano [Tue, 6 Mar 2018 22:54:05 +0000 (14:54 -0800)]
Merge branch 'bw/doc-submodule-recurse-config-with-clone'

Doc update.

* bw/doc-submodule-recurse-config-with-clone:
  submodule: indicate that 'submodule.recurse' doesn't apply to clone

2 years agoMerge branch 'jc/allow-ff-merging-kept-tags'
Junio C Hamano [Tue, 6 Mar 2018 22:54:04 +0000 (14:54 -0800)]
Merge branch 'jc/allow-ff-merging-kept-tags'

Since Git 1.7.9, "git merge" defaulted to --no-ff (i.e. even when
the side branch being merged is a descendant of the current commit,
create a merge commit instead of fast-forwarding) when merging a
tag object.  This was appropriate default for integrators who pull
signed tags from their downstream contributors, but caused an
unnecessary merges when used by downstream contributors who
habitually "catch up" their topic branches with tagged releases
from the upstream.  Update "git merge" to default to --no-ff only
when merging a tag object that does *not* sit at its usual place in
refs/tags/ hierarchy, and allow fast-forwarding otherwise, to
mitigate the problem.

* jc/allow-ff-merging-kept-tags:
  merge: allow fast-forward when merging a tracked tag

2 years agoMerge branch 'ab/simplify-perl-makefile'
Junio C Hamano [Tue, 6 Mar 2018 22:54:04 +0000 (14:54 -0800)]
Merge branch 'ab/simplify-perl-makefile'

Hotfix for a topic already in 'master'.

* ab/simplify-perl-makefile:
  Makefile: generate Git(3pm) as dependency of the 'doc' and 'man' targets

2 years agoMerge branch 'pw/add-p-single'
Junio C Hamano [Tue, 6 Mar 2018 22:54:03 +0000 (14:54 -0800)]
Merge branch 'pw/add-p-single'

"git add -p" used to offer "/" (look for a matching hunk) as a
choice, even there was only one hunk, which has been corrected.
Also the single-key help is now given only for keys that are
enabled (e.g. help for '/' won't be shown when there is only one
hunk).

* pw/add-p-single:
  add -p: improve error messages
  add -p: only bind search key if there's more than one hunk
  add -p: only display help for active keys

2 years agoMerge branch 'sg/t6300-modernize'
Junio C Hamano [Tue, 6 Mar 2018 22:54:03 +0000 (14:54 -0800)]
Merge branch 'sg/t6300-modernize'

Test update.

* sg/t6300-modernize:
  t6300-for-each-ref: fix "more than one quoting style" tests

2 years agoMerge branch 'sb/color-h-cleanup'
Junio C Hamano [Tue, 6 Mar 2018 22:54:02 +0000 (14:54 -0800)]
Merge branch 'sb/color-h-cleanup'

Devdoc update.

* sb/color-h-cleanup:
  color.h: document and modernize header

2 years agoMerge branch 'nd/rebase-show-current-patch'
Junio C Hamano [Tue, 6 Mar 2018 22:54:02 +0000 (14:54 -0800)]
Merge branch 'nd/rebase-show-current-patch'

The new "--show-current-patch" option gives an end-user facing way
to get the diff being applied when "git rebase" (and "git am")
stops with a conflict.

* nd/rebase-show-current-patch:
  rebase: introduce and use pseudo-ref REBASE_HEAD
  rebase: add --show-current-patch
  am: add --show-current-patch

2 years agoMerge branch 'xz/send-email-batch-size'
Junio C Hamano [Tue, 6 Mar 2018 22:54:02 +0000 (14:54 -0800)]
Merge branch 'xz/send-email-batch-size'

"git send-email" learned to complain when the batch-size option is
not defined when the relogin-delay option is, since these two are
mutually required.

* xz/send-email-batch-size:
  send-email: error out when relogin delay is missing

2 years agoMerge branch 'ab/fetch-prune'
Junio C Hamano [Tue, 6 Mar 2018 22:54:01 +0000 (14:54 -0800)]
Merge branch 'ab/fetch-prune'

Clarify how configured fetch refspecs interact with the "--prune"
option of "git fetch", and also add a handy short-hand for getting
rid of stale tags that are locally held.

* ab/fetch-prune:
  fetch: make the --prune-tags work with <url>
  fetch: add a --prune-tags option and fetch.pruneTags config
  fetch tests: add scaffolding for the new fetch.pruneTags
  git-fetch & config doc: link to the new PRUNING section
  git remote doc: correct dangerous lies about what prune does
  git fetch doc: add a new section to explain the ins & outs of pruning
  fetch tests: fetch <url> <spec> as well as fetch [<remote>]
  fetch tests: expand case/esac for later change
  fetch tests: double quote a variable for interpolation
  fetch tests: test --prune and refspec interaction
  fetch tests: add a tag to be deleted to the pruning tests
  fetch tests: re-arrange arguments for future readability
  fetch tests: refactor in preparation for testing tag pruning
  remote: add a macro for "refs/tags/*:refs/tags/*"
  fetch: stop accessing "remote" variable indirectly
  fetch: trivially refactor assignment to ref_nr
  fetch: don't redundantly NULL something calloc() gave us

2 years agoMerge branch 'sm/mv-dry-run-update'
Junio C Hamano [Tue, 6 Mar 2018 22:54:00 +0000 (14:54 -0800)]
Merge branch 'sm/mv-dry-run-update'

Code clean-up.

* sm/mv-dry-run-update:
  mv: remove unneeded 'if (!show_only)'
  t7001: add test case for --dry-run

2 years agoMerge branch 'nm/tag-edit'
Junio C Hamano [Tue, 6 Mar 2018 22:53:59 +0000 (14:53 -0800)]
Merge branch 'nm/tag-edit'

"git tag" learned an explicit "--edit" option that allows the
message given via "-m" and "-F" to be further edited.

* nm/tag-edit:
  tag: add --edit option

3 years agoSixth batch for 2.17
Junio C Hamano [Wed, 28 Feb 2018 21:39:24 +0000 (13:39 -0800)]
Sixth batch for 2.17

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'jk/push-options-via-transport-fix'
Junio C Hamano [Wed, 28 Feb 2018 21:37:58 +0000 (13:37 -0800)]
Merge branch 'jk/push-options-via-transport-fix'

"git push" over http transport did not unquote the push-options
correctly.

* jk/push-options-via-transport-fix:
  remote-curl: unquote incoming push-options
  t5545: factor out http repository setup

3 years agoMerge branch 'tz/do-not-clean-spec-file'
Junio C Hamano [Wed, 28 Feb 2018 21:37:58 +0000 (13:37 -0800)]
Merge branch 'tz/do-not-clean-spec-file'

We no longer create any *.spec file, so "make clean" should not
remove it.

* tz/do-not-clean-spec-file:
  Makefile: remove *.spec from clean target

3 years agoMerge branch 'tg/worktree-create-tracking'
Junio C Hamano [Wed, 28 Feb 2018 21:37:56 +0000 (13:37 -0800)]
Merge branch 'tg/worktree-create-tracking'

Hotfix for a recent topic.

* tg/worktree-create-tracking:
  git-worktree.txt: fix indentation of example and text of 'add' command
  git-worktree.txt: fix missing ")" typo

3 years agoMerge branch 'gs/test-unset-xdg-cache-home'
Junio C Hamano [Wed, 28 Feb 2018 21:37:56 +0000 (13:37 -0800)]
Merge branch 'gs/test-unset-xdg-cache-home'

Test update.

* gs/test-unset-xdg-cache-home:
  test-lib.sh: unset XDG_CACHE_HOME

3 years agoMerge branch 'tk/apply-dev-null-verify-name-fix'
Junio C Hamano [Wed, 28 Feb 2018 21:37:55 +0000 (13:37 -0800)]
Merge branch 'tk/apply-dev-null-verify-name-fix'

Many places in "git apply" knew that "/dev/null" that signals
"there is no such file on this side of the diff" can be followed by
whitespace and garbage when parsing a patch, except for one, which
made an otherwise valid patch (e.g. ones from subversion) rejected.

* tk/apply-dev-null-verify-name-fix:
  apply: handle Subversion diffs with /dev/null gracefully
  apply: demonstrate a problem applying svn diffs

3 years agoMerge branch 'sb/status-doc-fix'
Junio C Hamano [Wed, 28 Feb 2018 21:37:54 +0000 (13:37 -0800)]
Merge branch 'sb/status-doc-fix'

Docfix.

* sb/status-doc-fix:
  Documentation/git-status: clarify status table for porcelain mode

3 years agoMerge branch 'es/worktree-add-post-checkout-hook'
Junio C Hamano [Wed, 28 Feb 2018 21:37:53 +0000 (13:37 -0800)]
Merge branch 'es/worktree-add-post-checkout-hook'

"git worktree add" learned to run the post-checkout hook, just like
"git clone" runs it upon the initial checkout.

* es/worktree-add-post-checkout-hook:
  worktree: add: fix 'post-checkout' not knowing new worktree location

3 years agoMerge branch 'nd/am-quit'
Junio C Hamano [Wed, 28 Feb 2018 21:37:52 +0000 (13:37 -0800)]
Merge branch 'nd/am-quit'

"git am" has learned the "--quit" option, in addition to the existing
"--abort" option; having the pair mirrors a few other commands like
"rebase" and "cherry-pick".

* nd/am-quit:
  am: support --quit

3 years agoFifth batch for 2.17
Junio C Hamano [Tue, 27 Feb 2018 18:35:18 +0000 (10:35 -0800)]
Fifth batch for 2.17

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoSync with maint
Junio C Hamano [Tue, 27 Feb 2018 18:53:19 +0000 (10:53 -0800)]
Sync with maint

3 years agoMerge branch 'ys/bisect-object-id-missing-conversion-fix' into maint
Junio C Hamano [Tue, 27 Feb 2018 18:43:55 +0000 (10:43 -0800)]
Merge branch 'ys/bisect-object-id-missing-conversion-fix' into maint

Fix for a commented-out code to adjust it to a rather old API change.

* ys/bisect-object-id-missing-conversion-fix:
  bisect: debug: convert struct object to object_id

3 years agoMerge branch 'sb/submodule-update-reset-fix' into maint
Junio C Hamano [Tue, 27 Feb 2018 18:43:54 +0000 (10:43 -0800)]
Merge branch 'sb/submodule-update-reset-fix' into maint

When resetting the working tree files recursively, the working tree
of submodules are now also reset to match.

* sb/submodule-update-reset-fix:
  submodule: submodule_move_head omits old argument in forced case
  unpack-trees: oneway_merge to update submodules
  t/lib-submodule-update.sh: fix test ignoring ignored files in submodules
  t/lib-submodule-update.sh: clarify test

3 years agoMerge branch 'ab/commit-m-with-fixup' into maint
Junio C Hamano [Tue, 27 Feb 2018 18:43:54 +0000 (10:43 -0800)]
Merge branch 'ab/commit-m-with-fixup' into maint

"git commit --fixup" did not allow "-m<message>" option to be used
at the same time; allow it to annotate resulting commit with more
text.

* ab/commit-m-with-fixup:
  commit: add support for --fixup <commit> -m"<extra message>"
  commit doc: document that -c, -C, -F and --fixup with -m error

3 years agoMerge branch 'nd/ita-wt-renames-in-status' into maint
Junio C Hamano [Tue, 27 Feb 2018 18:39:34 +0000 (10:39 -0800)]
Merge branch 'nd/ita-wt-renames-in-status' into maint

"git status" after moving a path in the working tree (hence making
it appear "removed") and then adding with the -N option (hence
making that appear "added") detected it as a rename, but did not
report the  old and new pathnames correctly.

* nd/ita-wt-renames-in-status:
  wt-status.c: handle worktree renames
  wt-status.c: rename rename-related fields in wt_status_change_data
  wt-status.c: catch unhandled diff status codes
  wt-status.c: coding style fix
  Use DIFF_DETECT_RENAME for detect_rename assignments
  t2203: test status output with porcelain v2 format

3 years agoMerge branch 'jt/binsearch-with-fanout'
Junio C Hamano [Tue, 27 Feb 2018 18:34:03 +0000 (10:34 -0800)]
Merge branch 'jt/binsearch-with-fanout'

Refactor the code to binary search starting from a fan-out table
(which is how the packfile is indexed with object names) into a
reusable helper.

* jt/binsearch-with-fanout:
  packfile: refactor hash search with fanout table
  packfile: remove GIT_DEBUG_LOOKUP log statements

3 years agoMerge branch 'rd/typofix'
Junio C Hamano [Tue, 27 Feb 2018 18:34:03 +0000 (10:34 -0800)]
Merge branch 'rd/typofix'

Typofix.

* rd/typofix:
  Correct mispellings of ".gitmodule" to ".gitmodules"
  t/: correct obvious typo "detahced"

3 years agoMerge branch 'jk/test-hashmap-updates'
Junio C Hamano [Tue, 27 Feb 2018 18:34:02 +0000 (10:34 -0800)]
Merge branch 'jk/test-hashmap-updates'

Code clean-up.

* jk/test-hashmap-updates:
  test-hashmap: use "unsigned int" for hash storage
  test-hashmap: simplify alloc_test_entry
  test-hashmap: use strbuf_getline rather than fgets
  test-hashmap: use xsnprintf rather than snprintf
  test-hashmap: check allocation computation for overflow
  test-hashmap: use ALLOC_ARRAY rather than bare malloc

3 years agoMerge branch 'jk/sq-dequote-on-bogus-input'
Junio C Hamano [Tue, 27 Feb 2018 18:34:02 +0000 (10:34 -0800)]
Merge branch 'jk/sq-dequote-on-bogus-input'

Code to unquote single-quoted string (used in the parser for
configuration files, etc.) did not diagnose bogus input correctly
and produced bogus results instead.

* jk/sq-dequote-on-bogus-input:
  sq_dequote: fix extra consumption of source string

3 years agoMerge branch 'bp/fsmonitor'
Junio C Hamano [Tue, 27 Feb 2018 18:34:01 +0000 (10:34 -0800)]
Merge branch 'bp/fsmonitor'

Doc update for a recently added feature.

* bp/fsmonitor:
  fsmonitor: update documentation to remove reference to invalid config settings

3 years agoMerge branch 'bc/doc-interpret-trailers-grammofix'
Junio C Hamano [Tue, 27 Feb 2018 18:34:00 +0000 (10:34 -0800)]
Merge branch 'bc/doc-interpret-trailers-grammofix'

Docfix.

* bc/doc-interpret-trailers-grammofix:
  docs/interpret-trailers: fix agreement error

3 years agoMerge branch 'as/ll-i18n'
Junio C Hamano [Tue, 27 Feb 2018 18:33:58 +0000 (10:33 -0800)]
Merge branch 'as/ll-i18n'

Some messages in low level start-up codepath have been i18n-ized.

* as/ll-i18n:
  Mark messages for translations

3 years agoMerge branch 'sg/doc-test-must-fail-args'
Junio C Hamano [Tue, 27 Feb 2018 18:33:58 +0000 (10:33 -0800)]
Merge branch 'sg/doc-test-must-fail-args'

Devdoc update.

* sg/doc-test-must-fail-args:
  t: document 'test_must_fail ok=<signal-name>'

3 years agoMerge branch 'sb/describe-blob'
Junio C Hamano [Tue, 27 Feb 2018 18:33:57 +0000 (10:33 -0800)]
Merge branch 'sb/describe-blob'

"git describe $garbage" stopped giving any errors when the garbage
happens to be a string with 40 hexadecimal letters.

* sb/describe-blob:
  describe: confirm that blobs actually exist

3 years agoMerge branch 'rs/check-ignore-multi'
Junio C Hamano [Tue, 27 Feb 2018 18:33:56 +0000 (10:33 -0800)]
Merge branch 'rs/check-ignore-multi'

"git check-ignore" with multiple paths got confused when one is a
file and the other is a directory, which has been fixed.

* rs/check-ignore-multi:
  check-ignore: fix mix of directories and other file types

3 years agoMerge branch 'rj/sparse-updates'
Junio C Hamano [Tue, 27 Feb 2018 18:33:55 +0000 (10:33 -0800)]
Merge branch 'rj/sparse-updates'

Devtool update.

* rj/sparse-updates:
  Makefile: suppress a sparse warning for pack-revindex.c
  config.mak.uname: remove SPARSE_FLAGS setting for cygwin

3 years agoMerge branch 'jk/t0002-simplify'
Junio C Hamano [Tue, 27 Feb 2018 18:33:55 +0000 (10:33 -0800)]
Merge branch 'jk/t0002-simplify'

Code cleanup.

* jk/t0002-simplify:
  t0002: simplify error checking

3 years agoMerge branch 'js/packet-read-line-check-null'
Junio C Hamano [Tue, 27 Feb 2018 18:33:54 +0000 (10:33 -0800)]
Merge branch 'js/packet-read-line-check-null'

Some low level protocol codepath could crash when they get an
unexpected flush packet, which is now fixed.

* js/packet-read-line-check-null:
  always check for NULL return from packet_read_line()
  correct error messages for NULL packet_read_line()

3 years agoMerge branch 'js/fix-merge-arg-quoting-in-rebase-p'
Junio C Hamano [Tue, 27 Feb 2018 18:33:54 +0000 (10:33 -0800)]
Merge branch 'js/fix-merge-arg-quoting-in-rebase-p'

"git rebase -p" mangled log messages of a merge commit, which is
now fixed.

* js/fix-merge-arg-quoting-in-rebase-p:
  rebase -p: fix incorrect commit message when calling `git merge`.

3 years agoMerge branch 'jk/gettext-poison'
Junio C Hamano [Tue, 27 Feb 2018 18:33:54 +0000 (10:33 -0800)]
Merge branch 'jk/gettext-poison'

Test updates.

* jk/gettext-poison:
  git-sh-i18n: check GETTEXT_POISON before USE_GETTEXT_SCHEME
  t0205: drop redundant test

3 years agoMerge branch 'jk/doc-do-not-write-extern'
Junio C Hamano [Tue, 27 Feb 2018 18:33:53 +0000 (10:33 -0800)]
Merge branch 'jk/doc-do-not-write-extern'

Devdoc update.

* jk/doc-do-not-write-extern:
  CodingGuidelines: mention "static" and "extern"

3 years agoMerge branch 'bp/name-hash-dirname-fix'
Junio C Hamano [Tue, 27 Feb 2018 18:33:53 +0000 (10:33 -0800)]
Merge branch 'bp/name-hash-dirname-fix'

"git add" files in the same directory, but spelling the directory
path in different cases on case insensitive filesystem, corrupted
the name hash data structure and led to unexpected results.  This
has been corrected.

* bp/name-hash-dirname-fix:
  name-hash: properly fold directory names in adjust_dirname_case()

3 years agoMerge branch 'jc/blame-missing-path'
Junio C Hamano [Tue, 27 Feb 2018 18:33:50 +0000 (10:33 -0800)]
Merge branch 'jc/blame-missing-path'

"git blame HEAD COPYING" in a bare repository failed to run, while
"git blame HEAD -- COPYING" run just fine.  This has been corrected.

* jc/blame-missing-path:
  blame: tighten command line parser

3 years agoMerge branch 'ab/untracked-cache-invalidation-docs'
Junio C Hamano [Tue, 27 Feb 2018 18:33:50 +0000 (10:33 -0800)]
Merge branch 'ab/untracked-cache-invalidation-docs'

Doc update to warn against remaining bugs in untracked cache.

* ab/untracked-cache-invalidation-docs:
  update-index doc: note the caveat with "could not open..."
  update-index doc: note a fixed bug in the untracked cache

3 years agoMerge branch 'nd/fix-untracked-cache-invalidation'
Junio C Hamano [Tue, 27 Feb 2018 18:33:49 +0000 (10:33 -0800)]
Merge branch 'nd/fix-untracked-cache-invalidation'

Some bugs around "untracked cache" feature have been fixed.

* nd/fix-untracked-cache-invalidation:
  dir.c: ignore paths containing .git when invalidating untracked cache
  dir.c: stop ignoring opendir() error in open_cached_dir()
  dir.c: fix missing dir invalidation in untracked code
  dir.c: avoid stat() in valid_cached_dir()
  status: add a failing test showing a core.untrackedCache bug

3 years agoperl: call timegm and timelocal with 4-digit year
Bernhard M. Wiedemann [Fri, 23 Feb 2018 17:20:45 +0000 (18:20 +0100)]
perl: call timegm and timelocal with 4-digit year

Amazingly, timegm(gmtime(0)) is only 0 before 2020 because perl's
timegm deviates from GNU timegm(3) in how it handles years.

man Time::Local says

 Whenever possible, use an absolute four digit year instead.

with a detailed explanation about ambiguity of 2-digit years above that.

Even though this ambiguity is error-prone with >50% of users getting it
wrong, it has been like this for 20+ years, so we just use 4-digit years
everywhere to be on the safe side.

We add some extra logic to cvsimport because it allows 2-digit year
input and interpreting an 18 as 1918 can be avoided easily and safely.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agostrbuf_read_file(): preserve errno across close() call
Jeff King [Fri, 23 Feb 2018 07:00:54 +0000 (02:00 -0500)]
strbuf_read_file(): preserve errno across close() call

If we encounter a read error, the user may want to report it
by looking at errno. However, our close() call may clobber
errno, leading to confusing results. Let's save and restore
it in the error case.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoDocumentation/gitsubmodules.txt: avoid non-ASCII apostrophes
Motoki Seki [Thu, 22 Feb 2018 08:52:25 +0000 (08:52 +0000)]
Documentation/gitsubmodules.txt: avoid non-ASCII apostrophes

In gitsubmodules.txt, a few non-ASCII apostrophes are used to spell
possessive, e.g. "submodule's".  These unfortunately are not
rendered at https://git-scm.com/docs/gitsubmodules correctly by the
renderer used there.

Use ASCII apostrophes instead to work around the problem.  It also
is good to be consistent, as there are possessives spelled with
ASCII apostrophes.

Signed-off-by: Motoki Seki <marmot.motoki@gmail.com>
Acked-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosequencer: factor out strbuf_read_file_or_whine()
René Scharfe [Thu, 22 Feb 2018 19:29:25 +0000 (20:29 +0100)]
sequencer: factor out strbuf_read_file_or_whine()

Reduce code duplication by factoring out a function that reads an entire
file into a strbuf, or reports errors on stderr if something goes wrong.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot: send verbose test-helper output to fd 4
Jeff King [Thu, 22 Feb 2018 06:48:37 +0000 (01:48 -0500)]
t: send verbose test-helper output to fd 4

Test helper functions like test_must_fail may produce
messages to stderr when they see a problem. When the tests
are run with "--verbose", this ends up on the test script's
stderr, and the user can read it.

But there's a problem. Some tests record stderr as part of
the test, like:

  test_must_fail git foo 2>output &&
  test_i18ngrep expected.message output

In this case the error text goes into "output". This makes
the --verbose output less useful (it also means we might
accidentally match it in the second, though in practice we
tend to produce these messages only on error, so we'd abort
the test when the first command fails).

Let's instead send this user-facing output directly to
descriptor 4, which always points to the original stderr (or
/dev/null in non-verbose mode). And it's already forbidden
to redirect descriptor 4, since we use it for BASH_XTRACEFD,
as explained in 9be795fbce (t5615: avoid re-using descriptor
4, 2017-12-08).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agorevision: drop --show-all option
Jeff King [Wed, 21 Feb 2018 23:27:24 +0000 (18:27 -0500)]
revision: drop --show-all option

This was an undocumented debugging aid that does not seem to
have come in handy in the past decade, judging from its lack
of mentions on the mailing list.

Let's drop it in the name of simplicity. This is morally a
revert of 3131b71301 (Add "--show-all" revision walker flag
for debugging, 2008-02-09), but note that I did leave in the
mapping of UNINTERESTING to "^" in get_revision_mark(). I
don't think this would be possible to trigger with the
current code, but it's the only sensible marker.

We'll skip the usual deprecation period because this was
explicitly a debugging aid that was never documented.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocommit: drop uses of get_cached_commit_buffer()
Jeff King [Wed, 21 Feb 2018 23:13:38 +0000 (18:13 -0500)]
commit: drop uses of get_cached_commit_buffer()

The "--show-all" revision option shows UNINTERESTING
commits. Some of these commits may be unparsed when we try
to show them (since we may or may not need to walk their
parents to fulfill the request).

Commit 3131b71301 (Add "--show-all" revision walker flag for
debugging, 2008-02-09) resolved this by just skipping
pretty-printing for commits without their object contents
cached, saying:

  Because we now end up listing commits we may not even have been parsed
  at all "show_log" and "show_commit" need to protect against commits
  that don't have a commit buffer entry.

That was the easy fix to avoid the pretty-printer segfaulting,
but:

  1. It doesn't work for all formats. E.g., --oneline
     prints the oid for each such commit but not a trailing
     newline, leading to jumbled output.

  2. It only affects some commits, depending on whether we
     happened to parse them or not (so if they were at the
     tip of an UNINTERESTING starting point, or if we
     happened to traverse over them, you'd see more data).

  3. It unncessarily ties the decision to show the verbose
     header to whether the commit buffer was cached. That
     makes it harder to change the logic around caching
     (e.g., if we could traverse without actually loading
     the full commit objects).

These days it's safe to feed such a commit to the
pretty-print code. Since be5c9fb904 (logmsg_reencode: lazily
load missing commit buffers, 2013-01-26), we'll load it on
demand in such a case. So let's just always show the verbose
headers.

This does change the behavior of plumbing, but:

  a. The --show-all option was explicitly introduced as a
     debugging aid, and was never documented (and has rarely
     even been mentioned on the list by git devs).

  b. Avoiding the commits was already not deterministic due
     to (2) above. So the caller might have seen full
     headers for these commits anyway, and would need to be
     prepared for it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoreplace: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:59 +0000 (10:59 -0800)]
replace: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agotrailer: rename 'template' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:58 +0000 (10:59 -0800)]
trailer: rename 'template' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agotempfile: rename 'template' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:57 +0000 (10:59 -0800)]
tempfile: rename 'template' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agowrapper: rename 'template' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:56 +0000 (10:59 -0800)]
wrapper: rename 'template' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoenvironment: rename 'namespace' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:55 +0000 (10:59 -0800)]
environment: rename 'namespace' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodiff: rename 'template' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:54 +0000 (10:59 -0800)]
diff: rename 'template' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoenvironment: rename 'template' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:53 +0000 (10:59 -0800)]
environment: rename 'template' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoinit-db: rename 'template' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:52 +0000 (10:59 -0800)]
init-db: rename 'template' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agounpack-trees: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:51 +0000 (10:59 -0800)]
unpack-trees: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agotrailer: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:50 +0000 (10:59 -0800)]
trailer: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosubmodule: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:49 +0000 (10:59 -0800)]
submodule: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosplit-index: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:48 +0000 (10:59 -0800)]
split-index: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoremote: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:47 +0000 (10:59 -0800)]
remote: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoref-filter: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:46 +0000 (10:59 -0800)]
ref-filter: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoread-cache: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:45 +0000 (10:59 -0800)]
read-cache: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoline-log: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:44 +0000 (10:59 -0800)]
line-log: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoimap-send: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:43 +0000 (10:59 -0800)]
imap-send: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agohttp: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:42 +0000 (10:59 -0800)]
http: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoentry: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:41 +0000 (10:59 -0800)]
entry: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodiffcore-delta: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:40 +0000 (10:59 -0800)]
diffcore-delta: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodiff: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:39 +0000 (10:59 -0800)]
diff: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodiff-lib: rename 'new' variable
Brandon Williams [Wed, 14 Feb 2018 18:59:38 +0000 (10:59 -0800)]
diff-lib: rename 'new' variable

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocommit: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:37 +0000 (10:59 -0800)]
commit: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocombine-diff: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:36 +0000 (10:59 -0800)]
combine-diff: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoremote: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:35 +0000 (10:59 -0800)]
remote: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoreflog: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:34 +0000 (10:59 -0800)]
reflog: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agopack-redundant: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:33 +0000 (10:59 -0800)]
pack-redundant: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agohelp: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:32 +0000 (10:59 -0800)]
help: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocheckout: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:31 +0000 (10:59 -0800)]
checkout: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoapply: rename 'new' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:30 +0000 (10:59 -0800)]
apply: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoapply: rename 'try' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:29 +0000 (10:59 -0800)]
apply: rename 'try' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodiff: rename 'this' variables
Brandon Williams [Wed, 14 Feb 2018 18:59:28 +0000 (10:59 -0800)]
diff: rename 'this' variables

Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoFourth batch for 2.17
Junio C Hamano [Wed, 21 Feb 2018 20:45:35 +0000 (12:45 -0800)]
Fourth batch for 2.17

3 years agoMerge branch 'sg/test-i18ngrep'
Junio C Hamano [Wed, 21 Feb 2018 20:45:05 +0000 (12:45 -0800)]
Merge branch 'sg/test-i18ngrep'

Test fixes.

* sg/test-i18ngrep:
  t: make 'test_i18ngrep' more informative on failure
  t: validate 'test_i18ngrep's parameters
  t: move 'test_i18ncmp' and 'test_i18ngrep' to 'test-lib-functions.sh'
  t5536: let 'test_i18ngrep' read the file without redirection
  t5510: consolidate 'grep' and 'test_i18ngrep' patterns
  t4001: don't run 'git status' upstream of a pipe
  t6022: don't run 'git merge' upstream of a pipe
  t5812: add 'test_i18ngrep's missing filename parameter
  t5541: add 'test_i18ngrep's missing filename parameter

3 years agoMerge branch 'gs/rebase-allow-empty-message'
Junio C Hamano [Wed, 21 Feb 2018 20:45:04 +0000 (12:45 -0800)]
Merge branch 'gs/rebase-allow-empty-message'

"git rebase" learned to take "--allow-empty-message" option.

* gs/rebase-allow-empty-message:
  rebase: add --allow-empty-message option

3 years agoMerge branch 'lw/daemon-log-destination'
Junio C Hamano [Wed, 21 Feb 2018 20:45:04 +0000 (12:45 -0800)]
Merge branch 'lw/daemon-log-destination'

The log from "git daemon" can be redirected with a new option; one
relevant use case is to send the log to standard error (instead of
syslog) when running it from inetd.

* lw/daemon-log-destination:
  daemon: add --log-destination=(stderr|syslog|none)