1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 06:47:52 +01:00
Commit graph

53936 commits

Author SHA1 Message Date
Junio C Hamano
7bdebaa646 Merge branch 'sg/ref-filter-wo-repository'
"git ls-remote --sort=<thing>" can feed an object that is not yet
available into the comparison machinery and segfault, which has
been corrected to check such a request upfront and reject it.

* sg/ref-filter-wo-repository:
  ref-filter: don't look for objects when outside of a repository
2018-11-18 18:23:59 +09:00
Junio C Hamano
56e4af3d34 Merge branch 'nd/doc-extensions'
Doc update.

* nd/doc-extensions:
  doc: move extensions.worktreeConfig to the right place
2018-11-18 18:23:59 +09:00
Junio C Hamano
7b9bb3876d Merge branch 'js/fuzz-cxxflags'
The build procedure to link for fuzzing test has been made
customizable with a new Makefile variable.

* js/fuzz-cxxflags:
  Makefile: use FUZZ_CXXFLAGS for linking fuzzers
2018-11-18 18:23:58 +09:00
Junio C Hamano
b8a9209193 Merge branch 'js/mingw-msdn-url'
The URL to an MSDN page in a comment has been updated.

* js/mingw-msdn-url:
  mingw: replace an obsolete link with the superseding one
2018-11-18 18:23:58 +09:00
Junio C Hamano
c56aa1d280 Merge branch 'js/mingw-create-hard-link'
Windows update.

* js/mingw-create-hard-link:
  mingw: use `CreateHardLink()` directly
2018-11-18 18:23:58 +09:00
Junio C Hamano
744fad66c9 Merge branch 'js/config-sequence'
A sanity check for start-up sequence has been added in the config
API codepath.

* js/config-sequence:
  config: report a bug if git_dir exists without commondir
2018-11-18 18:23:57 +09:00
Junio C Hamano
06a2d241cf Merge branch 'lj/mingw-pthread-cond'
Code simplification.

* lj/mingw-pthread-cond:
  win32: replace pthread_cond_*() with much simpler code
2018-11-18 18:23:57 +09:00
Junio C Hamano
ca6e972dde Merge branch 'nd/command-list-gen-fix'
Build tweak.

* nd/command-list-gen-fix:
  build: fix broken command-list.h generation with core.autocrlf
2018-11-18 18:23:57 +09:00
Junio C Hamano
0466aebd3a Merge branch 'ag/p3400-force-checkout'
Perf test tweak.

* ag/p3400-force-checkout:
  p3400: replace calls to `git checkout -b' by `git checkout -B'
2018-11-18 18:23:57 +09:00
Junio C Hamano
e14af5f7aa Merge branch 'cb/notes-freeing-always-null-fix'
Code cleanup.

* cb/notes-freeing-always-null-fix:
  builtin/notes: remove unnecessary free
2018-11-18 18:23:57 +09:00
Junio C Hamano
0de3a73eb6 Merge branch 'js/rebase-r-and-merge-head'
Bugfix for the recently graduated "git rebase --rebase-merges".

* js/rebase-r-and-merge-head:
  status: rebase and merge can be in progress at the same time
  built-in rebase --skip/--abort: clean up stale .git/<name> files
  rebase -i: include MERGE_HEAD into files to clean up
  rebase -r: do not write MERGE_HEAD unless needed
  rebase -r: demonstrate bug with conflicting merges
2018-11-18 18:23:56 +09:00
Junio C Hamano
bda53f4185 Merge branch 'js/apply-recount-allow-noop'
When editing a patch in a "git add -i" session, a hunk could be
made to no-op.  The "git apply" program used to reject a patch with
such a no-op hunk to catch user mistakes, but it is now updated to
explicitly allow a no-op hunk in an edited patch.

* js/apply-recount-allow-noop:
  apply --recount: allow "no-op hunks"
2018-11-18 18:23:56 +09:00
Junio C Hamano
c72431ffc9 Merge branch 'ra/rev-parse-exclude-glob'
"rev-parse --exclude=<pattern> --branches=<pattern>" etc. did not
quite work, which has been corrected.

* ra/rev-parse-exclude-glob:
  refs: fix some exclude patterns being ignored
  refs: show --exclude failure with --branches/tags/remotes=glob
2018-11-18 18:23:56 +09:00
Junio C Hamano
bb6dd0ecad Merge branch 'js/builtin-rebase-perf-fix'
Code clean-up with correction to make the reimplemented "git
rebase" a more faithful rewrite of the original, which also regains
performance.

* js/builtin-rebase-perf-fix:
  built-in rebase: reinstate `checkout -q` behavior where appropriate
  rebase: prepare reset_head() for more flags
  rebase: consolidate clean-up code before leaving reset_head()
2018-11-18 18:23:55 +09:00
Junio C Hamano
5d90463e8c Merge branch 'js/mailmap'
Update the mailmap to unify multiple entries for the authors with
commits since v2.10.

* js/mailmap:
  Update .mailmap
2018-11-18 18:23:55 +09:00
Junio C Hamano
9aefd35380 Merge branch 'js/rebase-autostash-detach-fix'
"git rebase --autostash" did not correctly re-attach the HEAD at times.

* js/rebase-autostash-detach-fix:
  built-in rebase --autostash: leave the current branch alone if possible
  built-in rebase: demonstrate regression with --autostash
2018-11-18 18:23:55 +09:00
Junio C Hamano
a517079437 Merge branch 'ab/range-diff-no-patch'
The "--no-patch" option, which can be used to get a high-level
overview without the actual line-by-line patch difference shown, of
the "range-diff" command was earlier broken, which has been
corrected.

* ab/range-diff-no-patch:
  range-diff: make diff option behavior (e.g. --stat) consistent
  range-diff: fix regression in passing along diff options
  range-diff doc: add a section about output stability
2018-11-18 18:23:54 +09:00
Junio C Hamano
6d2035ee60 Merge branch 'jk/verify-sig-merge-into-void'
"git merge" and "git pull" that merges into an unborn branch used
to completely ignore "--verify-signatures", which has been
corrected.

* jk/verify-sig-merge-into-void:
  pull: handle --verify-signatures for unborn branch
  merge: handle --verify-signatures for unborn branch
  merge: extract verify_merge_signature() helper
2018-11-18 18:23:54 +09:00
Junio C Hamano
39847644ad Merge branch 'js/mingw-res-rebuild'
Windows build update.

* js/mingw-res-rebuild:
  Windows: force-recompile git.res for differing architectures
2018-11-18 18:23:53 +09:00
Junio C Hamano
ab96f28ba4 Merge branch 'jk/unused-parameter-fixes'
Various functions have been audited for "-Wunused-parameter" warnings
and bugs in them got fixed.

* jk/unused-parameter-fixes:
  midx: double-check large object write loop
  assert NOARG/NONEG behavior of parse-options callbacks
  parse-options: drop OPT_DATE()
  apply: return -1 from option callback instead of calling exit(1)
  cat-file: report an error on multiple --batch options
  tag: mark "--message" option with NONEG
  show-branch: mark --reflog option as NONEG
  format-patch: mark "--no-numbered" option with NONEG
  status: mark --find-renames option with NONEG
  cat-file: mark batch options with NONEG
  pack-objects: mark index-version option as NONEG
  ls-files: mark exclude options as NONEG
  am: handle --no-patch-format option
  apply: mark include/exclude options as NONEG
2018-11-18 18:23:53 +09:00
Junio C Hamano
fa2f2f085e Merge branch 'jk/curl-ldflags'
The way -lcurl library gets linked has been simplified by taking
advantage of the fact that we can just ask curl-config command how.

* jk/curl-ldflags:
  build: link with curl-defined linker flags
2018-11-18 18:23:53 +09:00
Junio C Hamano
95a3ef5e2e Merge branch 'mg/gpg-fingerprint-test'
Add a few tests for a topic already in 'master'.

* mg/gpg-fingerprint-test:
  t/t7510-signed-commit.sh: add signing subkey to Eris Discordia key
  t/t7510-signed-commit.sh: Add %GP to custom format checks
2018-11-18 18:23:53 +09:00
Junio C Hamano
26b80a841a Merge branch 'nd/pthreads'
The codebase has been cleaned up to reduce "#ifndef NO_PTHREADS".

* nd/pthreads:
  Clean up pthread_create() error handling
  read-cache.c: initialize copy_len to shut up gcc 8
  read-cache.c: reduce branching based on HAVE_THREADS
  read-cache.c: remove #ifdef NO_PTHREADS
  pack-objects: remove #ifdef NO_PTHREADS
  preload-index.c: remove #ifdef NO_PTHREADS
  grep: clean up num_threads handling
  grep: remove #ifdef NO_PTHREADS
  attr.c: remove #ifdef NO_PTHREADS
  name-hash.c: remove #ifdef NO_PTHREADS
  index-pack: remove #ifdef NO_PTHREADS
  send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c
  run-command.h: include thread-utils.h instead of pthread.h
  thread-utils: macros to unconditionally compile pthreads API
2018-11-18 18:23:52 +09:00
Junio C Hamano
62ca33e02a Merge branch 'ds/reachable-topo-order'
The revision walker machinery learned to take advantage of the
commit generation numbers stored in the commit-graph file.

* ds/reachable-topo-order:
  t6012: make rev-list tests more interesting
  revision.c: generation-based topo-order algorithm
  commit/revisions: bookkeeping before refactoring
  revision.c: begin refactoring --topo-order logic
  test-reach: add rev-list tests
  test-reach: add run_three_modes method
  prio-queue: add 'peek' operation
2018-11-18 18:23:52 +09:00
Johannes Schindelin
2ef2ae2917 mingw: replace an obsolete link with the superseding one
The MSDN documentation has been superseded by Microsoft Docs (which is
backed by a repository on GitHub containing many, many files in Markdown
format).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-16 14:57:54 +09:00
Josh Steadmon
927c77e7d4 Makefile: use FUZZ_CXXFLAGS for linking fuzzers
OSS-Fuzz requires C++-specific flags to link fuzzers. Passing these in
CFLAGS causes lots of build warnings. Using separate FUZZ_CXXFLAGS
avoids this.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-16 14:25:06 +09:00
Nguyễn Thái Ngọc Duy
356aea6f79 doc: move extensions.worktreeConfig to the right place
All config extensions are described in technical/repository-version.txt.
I made a mistake of adding it in config.txt instead. This patch moves
it back to where it belongs.

Since repository-version.txt is not part of officially generated
documents (it's not even part of DOC_HTML target), it's only visible
to developers who read plain .txt files. Let's include it in
gitrepository-layout.5 for more visibility. Some minor asciidoc fixes
are required in repository-version.txt to make this happen.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-16 14:10:31 +09:00
SZEDER Gábor
47bd3d0c14 ref-filter: don't look for objects when outside of a repository
The command 'git ls-remote --sort=authordate <remote>' segfaults when
run outside of a repository, ever since the introduction of its
'--sort' option in 1fb20dfd8e (ls-remote: create '--sort' option,
2018-04-09).

While in general the 'git ls-remote' command can be run outside of a
repository just fine, its '--sort=<key>' option with certain keys does
require access to the referenced objects.  This sorting is implemented
using the generic ref-filter sorting facility, which already handles
missing objects gracefully with the appropriate 'missing object
deadbeef for HEAD' message.  However, being generic means that it
checks replace refs while trying to retrieve an object, and while
doing so it accesses the 'git_replace_ref_base' variable, which has
not been initialized and is still a NULL pointer when outside of a
repository, thus causing the segfault.

Make ref-filter more careful upfront while parsing the format string,
and make it error out when encountering a format atom requiring object
access when we are not in a repository.  Also add a test to ensure
that 'git ls-remote --sort' fails gracefully when executed outside of
a repository.

Reported-by: H.Merijn Brand <h.m.brand@xs4all.nl>
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-16 13:49:08 +09:00
Johannes Schindelin
44004872c8 config: report a bug if git_dir exists without commondir
This did happen at some stage, and was fixed relatively quickly. Make
sure that we detect very quickly, too, should that happen again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-16 11:54:01 +09:00
Ævar Arnfjörð Bjarmason
a48e12ef7a range-diff: make diff option behavior (e.g. --stat) consistent
Make the behavior when diff options (e.g. "--stat") are passed
consistent with how "diff" behaves.

Before 73a834e9e2 ("range-diff: relieve callers of low-level
configuration burden", 2018-07-22) running range-diff with "--stat"
would produce stat output and the diff output, as opposed to how
"diff" behaves where once "--stat" is specified "--patch" also needs
to be provided to emit the patch output.

As noted in a previous change ("range-diff doc: add a section about
output stability", 2018-11-07) the "--stat" output with "range-diff"
is useless at the moment.

But we should behave consistently with "diff" in anticipation of such
output being useful in the future, because it would make for confusing
UI if "diff" and "range-diff" behaved differently when it came to how
they interpret diff options.

The new behavior is also consistent with the existing documentation
added in ba931edd28 ("range-diff: populate the man page",
2018-08-13). See "[...]also accepts the regular diff options[...]" in
git-range-diff(1).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-14 15:25:48 +09:00
Loo Rong Jie
c73b7ad548 win32: replace pthread_cond_*() with much simpler code
The Win32 CONDITION_VARIABLE has better performance and is easier to
maintain, as the code is a lot shorter now (the semantics of the
CONDITION_VARIABLE matches the pthread_cond_t very well).

Note: CONDITION_VARIABLE is not available in Windows XP and below,
but the declared minimal Windows version required to build and run
Git for Windows is Windows Vista (which is also beyond its
end-of-life, but for less long than Windows XP), so that's okay.

Signed-off-by: Loo Rong Jie <loorongjie@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-14 15:14:22 +09:00
Johannes Schindelin
1e1a876bb2 mingw: use CreateHardLink() directly
The function `CreateHardLink()` is available in all supported Windows
versions (even since Windows XP), so there is no more need to resolve it
at runtime.

Helped-by: Max Kirillov <max@max630.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-14 14:41:15 +09:00
Junio C Hamano
d166e6afe5 Tenth batch for 2.20
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-11-13 22:37:28 +09:00
Junio C Hamano
95182c65d8 Merge branch 'nd/complete-format-patch'
The support for format-patch (and send-email) by the command-line
completion script (in contrib/) has been simplified a bit.

* nd/complete-format-patch:
  completion: use __gitcomp_builtin for format-patch
2018-11-13 22:37:28 +09:00
Junio C Hamano
1e4a714e68 Merge branch 'nd/tree-walk-path-exclusion'
Pathspec matching against a tree object were buggy when negative
pathspec elements were involved, which has been fixed.

* nd/tree-walk-path-exclusion:
  tree-walk.c: fix overoptimistic inclusion in :(exclude) matching
2018-11-13 22:37:28 +09:00
Junio C Hamano
57f06d5ab5 Merge branch 'sg/travis-install-dependencies'
The procedure to install dependencies before testing at Travis CI
is getting revamped for both simplicity and flexibility, taking
advantage of the recent move to the vm-based environment.

* sg/travis-install-dependencies:
  travis-ci: install packages in 'ci/install-dependencies.sh'
2018-11-13 22:37:27 +09:00
Junio C Hamano
9235a6ce47 Merge branch 'bp/add-diff-files-optim'
"git add" needs to internally run "diff-files" equivalent, and the
codepath learned the same optimization as "diff-files" has to run
lstat(2) in parallel to find which paths have been updated in the
working tree.

* bp/add-diff-files-optim:
  add: speed up cmd_add() by utilizing read_cache_preload()
2018-11-13 22:37:27 +09:00
Junio C Hamano
39d23dfa40 Merge branch 'jk/xdiff-interface'
The interface into "xdiff" library used to discover the offset and
size of a generated patch hunk by first formatting it into the
textual hunk header "@@ -n,m +k,l @@" and then parsing the numbers
out.  A new interface has been introduced to allow callers a more
direct access to them.

* jk/xdiff-interface:
  xdiff-interface: drop parse_hunk_header()
  range-diff: use a hunk callback
  diff: convert --check to use a hunk callback
  combine-diff: use an xdiff hunk callback
  diff: use hunk callback for word-diff
  diff: discard hunk headers for patch-ids earlier
  diff: avoid generating unused hunk header lines
  xdiff-interface: provide a separate consume callback for hunks
  xdiff: provide a separate emit callback for hunks
2018-11-13 22:37:27 +09:00
Junio C Hamano
f22838aa7a Merge branch 'jk/misc-unused-fixes'
Assorted fixes for bugs found while auditing -Wunused-parameter
warnings.

* jk/misc-unused-fixes:
  approxidate: fix NULL dereference in date_time()
  pathspec: handle non-terminated strings with :(attr)
  approxidate: handle pending number for "specials"
  rev-list: handle flags for --indexed-objects
2018-11-13 22:37:26 +09:00
Junio C Hamano
e146cc97be Merge branch 'nd/per-worktree-ref-iteration'
The code to traverse objects for reachability, used to decide what
objects are unreferenced and expendable, have been taught to also
consider per-worktree refs of other worktrees as starting points to
prevent data loss.

* nd/per-worktree-ref-iteration:
  git-worktree.txt: correct linkgit command name
  reflog expire: cover reflog from all worktrees
  fsck: check HEAD and reflog from other worktrees
  fsck: move fsck_head_link() to get_default_heads() to avoid some globals
  revision.c: better error reporting on ref from different worktrees
  revision.c: correct a parameter name
  refs: new ref types to make per-worktree refs visible to all worktrees
  Add a place for (not) sharing stuff between worktrees
  refs.c: indent with tabs, not spaces
2018-11-13 22:37:26 +09:00
Junio C Hamano
11aa560de9 Merge branch 'bp/refresh-index-using-preload'
The helper function to refresh the cached stat information in the
in-core index has learned to perform the lstat() part of the
operation in parallel on multi-core platforms.

* bp/refresh-index-using-preload:
  refresh_index: remove unnecessary calls to preload_index()
  speed up refresh_index() by utilizing preload_index()
2018-11-13 22:37:26 +09:00
Junio C Hamano
409b3f287b Merge branch 'ag/rebase-i-in-c'
Code clean-up for a topic already in 'master'.

* ag/rebase-i-in-c:
  sequencer.c: remove a stray semicolon
2018-11-13 22:37:25 +09:00
Junio C Hamano
2281aa8721 Merge branch 'al/send-email-auto-cte-fixup'
"git send-email --transfer-encoding=..." in recent versions of Git
sometimes produced an empty "Content-Transfer-Encoding:" header,
which has been corrected.

* al/send-email-auto-cte-fixup:
  send-email: avoid empty transfer encoding header
2018-11-13 22:37:25 +09:00
Junio C Hamano
291123e69b Merge branch 'ds/add-missing-tags'
The history traversal used to implement the tag-following has been
optimized by introducing a new helper.

* ds/add-missing-tags:
  remote: make add_missing_tags() linear
  test-reach: test get_reachable_subset
  commit-reach: implement get_reachable_subset
2018-11-13 22:37:24 +09:00
Junio C Hamano
1961efecae Merge branch 'sh/mingw-safer-compat-poll'
Windows fix.

* sh/mingw-safer-compat-poll:
  poll: use GetTickCount64() to avoid wrap-around issues
2018-11-13 22:37:24 +09:00
Junio C Hamano
6e31fa9cc2 Merge branch 'js/rebase-p-tests'
In preparation to the day when we can deprecate and remove the
"rebase -p", make sure we can skip and later remove tests for
it.

* js/rebase-p-tests:
  tests: optionally skip `git rebase -p` tests
  t3418: decouple test cases from a previous `rebase -p` test case
  t3404: decouple some test cases from outcomes of previous test cases
2018-11-13 22:37:24 +09:00
Junio C Hamano
6b2a52431b Merge branch 'pw/am-rebase-read-author-script'
Unify code to read the author-script used in "git am" and the
commands that use the sequencer machinery, e.g. "git rebase -i".

* pw/am-rebase-read-author-script:
  sequencer: use read_author_script()
  add read_author_script() to libgit
  am: rename read_author_script()
  am: improve author-script error reporting
  am: don't die in read_author_script()
2018-11-13 22:37:23 +09:00
Junio C Hamano
fd4bb3806b Merge branch 'jc/war-on-string-list'
Replace three string-list instances used as look-up tables in "git
fetch" with hashmaps.

* jc/war-on-string-list:
  fetch: replace string-list used as a look-up table with a hashmap
2018-11-13 22:37:23 +09:00
Junio C Hamano
20d04b4419 Merge branch 'ag/rev-parse-all-exclude-fix'
"git rev-parse --exclude=* --branches --branches"  (i.e. first
saying "add only things that do not match '*' out of all branches"
and then adding all branches, without any exclusion this time")
worked as expected, but "--exclude=* --all --all" did not work the
same way, which has been fixed.

* ag/rev-parse-all-exclude-fix:
  rev-parse: clear --exclude list after 'git rev-parse --all'
2018-11-13 22:37:23 +09:00
Junio C Hamano
67cf2fa3d5 Merge branch 'jt/tighten-fetch-proto-v2-response'
"git fetch" was a bit loose in parsing resposes from the other side
when talking over the protocol v2.

* jt/tighten-fetch-proto-v2-response:
  fetch-pack: be more precise in parsing v2 response
2018-11-13 22:37:22 +09:00