Junio C Hamano [Mon, 17 Feb 2020 21:22:19 +0000 (13:22 -0800)]
Merge branch 'es/outside-repo-errmsg-hints'
Error message clarification.
* es/outside-repo-errmsg-hints:
prefix_path: show gitdir when arg is outside repo
Junio C Hamano [Mon, 17 Feb 2020 21:22:19 +0000 (13:22 -0800)]
Merge branch 'jk/doc-credential-helper'
Docfix.
* jk/doc-credential-helper:
doc: move credential helper info into gitcredentials(7)
Junio C Hamano [Mon, 17 Feb 2020 21:22:18 +0000 (13:22 -0800)]
Merge branch 'js/mingw-open-in-gdb'
Dev support.
* js/mingw-open-in-gdb:
mingw: add a helper function to attach GDB to the current process
Junio C Hamano [Mon, 17 Feb 2020 21:22:18 +0000 (13:22 -0800)]
Merge branch 'js/test-unc-fetch'
Test updates.
* js/test-unc-fetch:
t5580: test cloning without file://, test fetching via UNC paths
Junio C Hamano [Mon, 17 Feb 2020 21:22:18 +0000 (13:22 -0800)]
Merge branch 'js/test-avoid-pipe'
Test clean-up.
* js/test-avoid-pipe:
t9001, t9116: avoid pipes
Junio C Hamano [Mon, 17 Feb 2020 21:22:18 +0000 (13:22 -0800)]
Merge branch 'js/test-write-junit-xml-fix'
Testfix.
* js/test-write-junit-xml-fix:
tests: fix --write-junit-xml with subshells
Junio C Hamano [Mon, 17 Feb 2020 21:22:17 +0000 (13:22 -0800)]
Merge branch 'jk/mailinfo-cleanup'
Code clean-up.
* jk/mailinfo-cleanup:
mailinfo: factor out some repeated header handling
mailinfo: be more liberal with header whitespace
mailinfo: simplify parsing of header values
mailinfo: treat header values as C strings
Junio C Hamano [Mon, 17 Feb 2020 21:22:17 +0000 (13:22 -0800)]
Merge branch 'mr/show-config-scope'
"git config" learned to show in which "scope", in addition to in
which file, each config setting comes from.
* mr/show-config-scope:
config: add '--show-scope' to print the scope of a config value
submodule-config: add subomdule config scope
config: teach git_config_source to remember its scope
config: preserve scope in do_git_config_sequence
config: clarify meaning of command line scoping
config: split repo scope to local and worktree
config: make scope_name non-static and rename it
t1300: create custom config file without special characters
t1300: fix over-indented HERE-DOCs
config: fix typo in variable name
Junio C Hamano [Mon, 17 Feb 2020 21:22:17 +0000 (13:22 -0800)]
Merge branch 'rs/strbuf-insertstr'
Code clean-up.
* rs/strbuf-insertstr:
mailinfo: don't insert header prefix for handle_content_type()
strbuf: add and use strbuf_insertstr()
Junio C Hamano [Mon, 17 Feb 2020 21:22:17 +0000 (13:22 -0800)]
Merge branch 'rs/parse-options-concat-dup'
Code clean-up.
* rs/parse-options-concat-dup:
parse-options: simplify parse_options_dup()
parse-options: const parse_options_concat() parameters
parse-options: factor out parse_options_count()
parse-options: use COPY_ARRAY in parse_options_concat()
Junio C Hamano [Mon, 17 Feb 2020 21:22:16 +0000 (13:22 -0800)]
Merge branch 'bc/hash-independent-tests-part-8'
Preparation for SHA-256 migration continues.
* bc/hash-independent-tests-part-8: (21 commits)
t6024: update for SHA-256
t6006: make hash size independent
t6000: abstract away SHA-1-specific constants
t5703: make test work with SHA-256
t5607: make hash size independent
t5318: update for SHA-256
t5515: make test hash independent
t5321: make test hash independent
t5313: make test hash independent
t5309: make test hash independent
t5302: make hash size independent
t4060: make test work with SHA-256
t4211: add test cases for SHA-256
t4211: move SHA-1-specific test cases into a directory
t4013: make test hash independent
t3311: make test work with SHA-256
t3310: make test work with SHA-256
t3309: make test work with SHA-256
t3308: make test work with SHA-256
t3206: make hash size independent
...
Junio C Hamano [Mon, 17 Feb 2020 21:22:16 +0000 (13:22 -0800)]
Merge branch 'rs/name-rev-memsave'
Memory footprint and performance of "git name-rev" has been
improved.
* rs/name-rev-memsave:
name-rev: sort tip names before applying
name-rev: release unused name strings
name-rev: generate name strings only if they are better
name-rev: pre-size buffer in get_parent_name()
name-rev: factor out get_parent_name()
name-rev: put struct rev_name into commit slab
name-rev: don't _peek() in create_or_update_name()
name-rev: don't leak path copy in name_ref()
name-rev: respect const qualifier
name-rev: remove unused typedef
name-rev: rewrite create_or_update_name()
Junio C Hamano [Mon, 17 Feb 2020 04:41:40 +0000 (20:41 -0800)]
Sync with 2.25.1
Junio C Hamano [Mon, 17 Feb 2020 04:37:38 +0000 (20:37 -0800)]
Git 2.25.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Emily Shaffer [Sat, 15 Feb 2020 01:00:13 +0000 (17:00 -0800)]
prefix_path: show gitdir when arg is outside repo
When developing a script, it can be painful to understand why Git thinks
something is outside the current repo, if the current repo isn't what
the user thinks it is. Since this can be tricky to diagnose, especially
in cases like submodules or nested worktrees, let's give the user a hint
about which repository is offended about that path.
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Acked-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Fri, 14 Feb 2020 18:54:59 +0000 (13:54 -0500)]
doc: move credential helper info into gitcredentials(7)
The details of how credential helpers can be called or implemented were
originally covered in Documentation/technical/. Those are topics that
end users might care about (and we even referenced them in the
credentials manpage), but those docs typically don't ship as part of the
end user documentation, making them less useful.
This situation got slightly worse recently in
f3b9055624 (credential:
move doc to credential.h, 2019-11-17), where we moved them into the C
header file, making them even harder to find.
So let's move put this information into the gitcredentials(7)
documentation, which is meant to describe the overall concepts of our
credential handling. This was already pointing to the API docs for these
concepts, so we can just include it inline instead.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 14 Feb 2020 20:54:31 +0000 (12:54 -0800)]
Sync with maint
Junio C Hamano [Fri, 14 Feb 2020 20:54:07 +0000 (12:54 -0800)]
The fifth batch for 2.26
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 14 Feb 2020 20:54:24 +0000 (12:54 -0800)]
Merge branch 'tb/commit-graph-object-dir'
The code to compute the commit-graph has been taught to use a more
robust way to tell if two object directories refer to the same
thing.
* tb/commit-graph-object-dir:
commit-graph.h: use odb in 'load_commit_graph_one_fd_st'
commit-graph.c: remove path normalization, comparison
commit-graph.h: store object directory in 'struct commit_graph'
commit-graph.h: store an odb in 'struct write_commit_graph_context'
t5318: don't pass non-object directory to '--object-dir'
Junio C Hamano [Fri, 14 Feb 2020 20:54:24 +0000 (12:54 -0800)]
Merge branch 'jk/index-pack-dupfix'
The index-pack code now diagnoses a bad input packstream that
records the same object twice when it is used as delta base; the
code used to declare a software bug when encountering such an
input, but it is an input error.
* jk/index-pack-dupfix:
index-pack: downgrade twice-resolved REF_DELTA to die()
Junio C Hamano [Fri, 14 Feb 2020 20:54:23 +0000 (12:54 -0800)]
Merge branch 'jk/alloc-cleanups'
Misc code clean-ups.
* jk/alloc-cleanups:
tree-walk.c: break circular dependency with unpack-trees
traverse_trees(): use stack array for name entries
walker_fetch(): avoid raw array length computation
normalize_path_copy(): document "dst" size expectations
Junio C Hamano [Fri, 14 Feb 2020 20:54:23 +0000 (12:54 -0800)]
Merge branch 'jh/notes-fanout-fix'
The code to automatically shrink the fan-out in the notes tree had
an off-by-one bug, which has been killed.
* jh/notes-fanout-fix:
notes.c: fix off-by-one error when decreasing notes fanout
t3305: check notes fanout more carefully and robustly
Junio C Hamano [Fri, 14 Feb 2020 20:54:23 +0000 (12:54 -0800)]
Merge branch 'pk/status-of-uncloned-submodule'
The way "git submodule status" reports an initialized but not yet
populated submodule has not been reimplemented correctly when a
part of the "git submodule" command was rewritten in C, which has
been corrected.
* pk/status-of-uncloned-submodule:
t7400: testcase for submodule status on unregistered inner git repos
submodule: fix status of initialized but not cloned submodules
t7400: add a testcase for submodule status on empty dirs
Junio C Hamano [Fri, 14 Feb 2020 20:54:22 +0000 (12:54 -0800)]
Merge branch 'mt/use-passed-repo-more-in-funcs'
Some codepaths were given a repository instance as a parameter to
work in the repository, but passed the_repository instance to its
callees, which has been cleaned up (somewhat).
* mt/use-passed-repo-more-in-funcs:
sha1-file: allow check_object_signature() to handle any repo
sha1-file: pass git_hash_algo to hash_object_file()
sha1-file: pass git_hash_algo to write_object_file_prepare()
streaming: allow open_istream() to handle any repo
pack-check: use given repo's hash_algo at verify_packfile()
cache-tree: use given repo's hash_algo at verify_one()
diff: make diff_populate_filespec() honor its repo argument
Junio C Hamano [Fri, 14 Feb 2020 20:54:22 +0000 (12:54 -0800)]
Merge branch 'jk/diff-honor-wserrhighlight-in-plumbing'
The diff-* plumbing family of subcommands now pay attention to the
diff.wsErrorHighlight configuration, which has been ignored before;
this allows "git add -p" to also show the whitespace problems to
the end user.
* jk/diff-honor-wserrhighlight-in-plumbing:
diff: move diff.wsErrorHighlight to "basic" config
Junio C Hamano [Fri, 14 Feb 2020 20:54:22 +0000 (12:54 -0800)]
Merge branch 'ds/sparse-checkout-harden'
Some rough edges in the sparse-checkout feature, especially around
the cone mode, have been cleaned up.
* ds/sparse-checkout-harden:
sparse-checkout: fix cone mode behavior mismatch
sparse-checkout: improve docs around 'set' in cone mode
sparse-checkout: escape all glob characters on write
sparse-checkout: use C-style quotes in 'list' subcommand
sparse-checkout: unquote C-style strings over --stdin
sparse-checkout: write escaped patterns in cone mode
sparse-checkout: properly match escaped characters
sparse-checkout: warn on globs in cone patterns
sparse-checkout: detect short patterns
sparse-checkout: cone mode does not recognize "**"
sparse-checkout: fix documentation typo for core.sparseCheckoutCone
clone: fix --sparse option with URLs
sparse-checkout: create leading directories
t1091: improve here-docs
t1091: use check_files to reduce boilerplate
Junio C Hamano [Fri, 14 Feb 2020 20:54:22 +0000 (12:54 -0800)]
Merge branch 'ld/p4-cleanup-processes'
p4 updates.
* ld/p4-cleanup-processes:
git-p4: avoid leak of file handle when cloning
git-p4: check for access to remote host earlier
git-p4: cleanup better on error exit
git-p4: create helper function importRevisions()
git-p4: disable some pylint warnings, to get pylint output to something manageable
git-p4: add P4CommandException to report errors talking to Perforce
git-p4: make closeStreams() idempotent
Junio C Hamano [Fri, 14 Feb 2020 20:54:21 +0000 (12:54 -0800)]
Merge branch 'jt/connectivity-check-optim-in-partial-clone'
Unneeded connectivity check is now disabled in a partial clone when
fetching into it.
* jt/connectivity-check-optim-in-partial-clone:
fetch: forgo full connectivity check if --filter
connected: verify promisor-ness of partial clone
Junio C Hamano [Fri, 14 Feb 2020 20:54:21 +0000 (12:54 -0800)]
Merge branch 'jk/get-oid-error-message-i18n'
A low-level API function get_oid(), that accepts various ways to
name an object, used to issue end-user facing error messages
without l10n, which has been updated to be translatable.
* jk/get-oid-error-message-i18n:
sha1-name: mark get_oid() error messages for translation
t1506: drop space after redirection operator
t1400: avoid "test" string comparisons
Junio C Hamano [Fri, 14 Feb 2020 20:54:21 +0000 (12:54 -0800)]
Merge branch 'ag/edit-todo-drop-check'
Allow the rebase.missingCommitsCheck configuration to kick in when
"rebase --edit-todo" and "rebase --continue" restarts the procedure.
* ag/edit-todo-drop-check:
rebase-interactive: warn if commit is dropped with `rebase --edit-todo'
sequencer: move check_todo_list_from_file() to rebase-interactive.c
Junio C Hamano [Fri, 14 Feb 2020 20:54:21 +0000 (12:54 -0800)]
Merge branch 'dl/test-must-fail-fixes-2'
Test updates.
* dl/test-must-fail-fixes-2:
t4124: only mark git command with test_must_fail
t3507: use test_path_is_missing()
t3507: fix indentation
t3504: do check for conflict marker after failed cherry-pick
t3419: stop losing return code of git command
t3415: increase granularity of test_auto_{fixup,squash}()
t3415: stop losing return codes of git commands
t3310: extract common notes_merge_files_gone()
t3030: use test_path_is_missing()
t2018: replace "sha" with "oid"
t2018: don't lose return code of git commands
t2018: teach do_checkout() to accept `!` arg
t2018: be more discerning when checking for expected exit codes
t2018: improve style of if-statement
t2018: add space between function name and ()
t2018: remove trailing space from test description
Junio C Hamano [Fri, 14 Feb 2020 20:54:20 +0000 (12:54 -0800)]
Merge branch 'ag/rebase-avoid-unneeded-checkout'
"git rebase -i" (and friends) used to unnecessarily check out the
tip of the branch to be rebased, which has been corrected.
* ag/rebase-avoid-unneeded-checkout:
rebase -i: stop checking out the tip of the branch to rebase
Junio C Hamano [Fri, 14 Feb 2020 20:54:20 +0000 (12:54 -0800)]
Merge branch 'js/rebase-i-with-colliding-hash'
"git rebase -i" identifies existing commits in its todo file with
their abbreviated object name, which could become ambigous as it
goes to create new commits, and has a mechanism to avoid ambiguity
in the main part of its execution. A few other cases however were
not covered by the protection against ambiguity, which has been
corrected.
* js/rebase-i-with-colliding-hash:
rebase -i: also avoid SHA-1 collisions with missingCommitsCheck
rebase -i: re-fix short SHA-1 collision
parse_insn_line(): improve error message when parsing failed
Junio C Hamano [Fri, 14 Feb 2020 20:54:20 +0000 (12:54 -0800)]
Merge branch 'kw/fsmonitor-watchman-racefix'
A new version of fsmonitor-watchman hook has been introduced, to
avoid races.
* kw/fsmonitor-watchman-racefix:
fsmonitor: update documentation for hook version and watchman hooks
fsmonitor: add fsmonitor hook scripts for version 2
fsmonitor: handle version 2 of the hooks that will use opaque token
fsmonitor: change last update timestamp on the index_state to opaque token
Junio C Hamano [Fri, 14 Feb 2020 20:54:20 +0000 (12:54 -0800)]
Merge branch 'mt/threaded-grep-in-object-store'
Traditionally, we avoided threaded grep while searching in objects
(as opposed to files in the working tree) as accesses to the object
layer is not thread-safe. This limitation is getting lifted.
* mt/threaded-grep-in-object-store:
grep: use no. of cores as the default no. of threads
grep: move driver pre-load out of critical section
grep: re-enable threads in non-worktree case
grep: protect packed_git [re-]initialization
grep: allow submodule functions to run in parallel
submodule-config: add skip_if_read option to repo_read_gitmodules()
grep: replace grep_read_mutex by internal obj read lock
object-store: allow threaded access to object reading
replace-object: make replace operations thread-safe
grep: fix racy calls in grep_objects()
grep: fix race conditions at grep_submodule()
grep: fix race conditions on userdiff calls
Junio C Hamano [Fri, 14 Feb 2020 20:54:19 +0000 (12:54 -0800)]
Merge branch 'jn/promote-proto2-to-default'
The transport protocol version 2 becomes the default one.
* jn/promote-proto2-to-default:
fetch: default to protocol version 2
protocol test: let protocol.version override GIT_TEST_PROTOCOL_VERSION
test: request GIT_TEST_PROTOCOL_VERSION=0 when appropriate
config doc: protocol.version is not experimental
fetch test: use more robust test for filtered objects
Junio C Hamano [Fri, 14 Feb 2020 20:54:19 +0000 (12:54 -0800)]
Merge branch 'jk/packfile-reuse-cleanup'
The way "git pack-objects" reuses objects stored in existing pack
to generate its result has been improved.
* jk/packfile-reuse-cleanup:
pack-bitmap: don't rely on bitmap_git->reuse_objects
pack-objects: add checks for duplicate objects
pack-objects: improve partial packfile reuse
builtin/pack-objects: introduce obj_is_packed()
pack-objects: introduce pack.allowPackReuse
csum-file: introduce hashfile_total()
pack-bitmap: simplify bitmap_has_oid_in_uninteresting()
pack-bitmap: uninteresting oid can be outside bitmapped packfile
pack-bitmap: introduce bitmap_walk_contains()
ewah/bitmap: introduce bitmap_word_alloc()
packfile: expose get_delta_base()
builtin/pack-objects: report reused packfile objects
Junio C Hamano [Fri, 14 Feb 2020 20:54:19 +0000 (12:54 -0800)]
Merge branch 'hw/advice-add-nothing'
Two help messages given when "git add" notices the user gave it
nothing to add have been updated to use advise() API.
* hw/advice-add-nothing:
add: change advice config variables used by the add API
add: use advise function to display hints
Junio C Hamano [Fri, 14 Feb 2020 20:42:34 +0000 (12:42 -0800)]
Merge branch 'js/convert-typofix' into maint
Typofix.
* js/convert-typofix:
convert: fix typo
Junio C Hamano [Fri, 14 Feb 2020 20:42:33 +0000 (12:42 -0800)]
Merge branch 'js/ci-squelch-doc-warning' into maint
Squelch unhelpful warning message during documentation build.
* js/ci-squelch-doc-warning:
ci: ignore rubygems warning in the "Documentation" job
Junio C Hamano [Fri, 14 Feb 2020 20:42:33 +0000 (12:42 -0800)]
Merge branch 'jb/multi-pack-index-docfix' into maint
Doc fix.
* jb/multi-pack-index-docfix:
pack-format: correct multi-pack-index description
Junio C Hamano [Fri, 14 Feb 2020 20:42:33 +0000 (12:42 -0800)]
Merge branch 'ma/diff-doc-clarify-regexp-example' into maint
Doc clarification.
* ma/diff-doc-clarify-regexp-example:
diff-options.txt: avoid "regex" overload in example
Junio C Hamano [Fri, 14 Feb 2020 20:42:32 +0000 (12:42 -0800)]
Merge branch 'ms/doc-bundle-format' into maint
Technical details of the bundle format has been documented.
I think this is in a good enough shape.
* ms/doc-bundle-format:
doc: describe Git bundle format
Junio C Hamano [Fri, 14 Feb 2020 20:42:32 +0000 (12:42 -0800)]
Merge branch 'es/submodule-fetch-message-fix' into maint
Error message fix.
* es/submodule-fetch-message-fix:
submodule: add newline on invalid submodule error
Junio C Hamano [Fri, 14 Feb 2020 20:42:32 +0000 (12:42 -0800)]
Merge branch 'jb/parse-options-message-fix' into maint
Error message fix.
* jb/parse-options-message-fix:
parse-options: lose an unnecessary space in an error message
Junio C Hamano [Fri, 14 Feb 2020 20:42:32 +0000 (12:42 -0800)]
Merge branch 'ma/filter-branch-doc-caret' into maint
Doc mark-up updates.
* ma/filter-branch-doc-caret:
git-filter-branch.txt: wrap "maths" notation in backticks
Junio C Hamano [Fri, 14 Feb 2020 20:42:32 +0000 (12:42 -0800)]
Merge branch 'km/submodule-doc-use-sm-path' into maint
Docfix.
* km/submodule-doc-use-sm-path:
submodule foreach: replace $path with $sm_path in example
Junio C Hamano [Fri, 14 Feb 2020 20:42:31 +0000 (12:42 -0800)]
Merge branch 'pb/do-not-recurse-grep-no-index' into maint
"git grep --no-index" should not get affected by the contents of
the .gitmodules file but when "--recurse-submodules" is given or
the "submodule.recurse" variable is set, it did. Now these
settings are ignored in the "--no-index" mode.
* pb/do-not-recurse-grep-no-index:
grep: ignore --recurse-submodules if --no-index is given
Junio C Hamano [Fri, 14 Feb 2020 20:42:31 +0000 (12:42 -0800)]
Merge branch 'jt/t5616-robustify' into maint
Futureproofing a test not to depend on the current implementation
detail.
* jt/t5616-robustify:
t5616: make robust to delta base change
Junio C Hamano [Fri, 14 Feb 2020 20:42:31 +0000 (12:42 -0800)]
Merge branch 'en/fill-directory-fixes-more' into maint
Corner case bugs in "git clean" that stems from a (necessarily for
performance reasons) awkward calling convention in the directory
enumeration API has been corrected.
* en/fill-directory-fixes-more:
dir: point treat_leading_path() warning to the right place
dir: restructure in a way to avoid passing around a struct dirent
dir: treat_leading_path() and read_directory_recursive(), round 2
clean: demonstrate a bug with pathspecs
Junio C Hamano [Fri, 14 Feb 2020 20:42:31 +0000 (12:42 -0800)]
Merge branch 'bc/misconception-doc' into maint
Doc updates.
* bc/misconception-doc:
docs: mention when increasing http.postBuffer is valuable
doc: dissuade users from trying to ignore tracked files
Junio C Hamano [Fri, 14 Feb 2020 20:42:31 +0000 (12:42 -0800)]
Merge branch 'bc/author-committer-doc' into maint
Clarify documentation on committer/author identities.
* bc/author-committer-doc:
doc: provide guidance on user.name format
docs: expand on possible and recommended user config options
doc: move author and committer information to git-commit(1)
Junio C Hamano [Fri, 14 Feb 2020 20:42:30 +0000 (12:42 -0800)]
Merge branch 'ds/refmap-doc' into maint
"git fetch --refmap=" option has got a better documentation.
* ds/refmap-doc:
fetch: document and test --refmap=""
Junio C Hamano [Fri, 14 Feb 2020 20:42:30 +0000 (12:42 -0800)]
Merge branch 'bc/actualmente' into maint
Doc grammo fix.
* bc/actualmente:
docs: use "currently" for the present time
Junio C Hamano [Fri, 14 Feb 2020 20:42:30 +0000 (12:42 -0800)]
Merge branch 'rt/submodule-i18n' into maint
Comments update.
* rt/submodule-i18n:
submodule.c: mark more strings for translation
Junio C Hamano [Fri, 14 Feb 2020 20:42:29 +0000 (12:42 -0800)]
Merge branch 'jk/test-fixes' into maint
Test fixes.
* jk/test-fixes:
t7800: don't rely on reuse_worktree_file()
t4018: drop "debugging" cat from hunk-header tests
Junio C Hamano [Fri, 14 Feb 2020 20:42:29 +0000 (12:42 -0800)]
Merge branch 'jk/asan-build-fix' into maint
Work around test breakages caused by custom regex engine used in
libasan, when address sanitizer is used with more recent versions
of gcc and clang.
* jk/asan-build-fix:
Makefile: use compat regex with SANITIZE=address
Junio C Hamano [Fri, 14 Feb 2020 20:42:29 +0000 (12:42 -0800)]
Merge branch 'ds/sparse-cone' into maint
The code recently added in this release to move to the entry beyond
the ones in the same directory in the index in the sparse-cone mode
did not count the number of entries to skip over incorrectly, which
has been corrected.
* ds/sparse-cone:
.mailmap: fix GGG authoship screwup
unpack-trees: correctly compute result count
Junio C Hamano [Fri, 14 Feb 2020 20:42:29 +0000 (12:42 -0800)]
Merge branch 'nd/switch-and-restore' into maint
"git restore --staged" did not correctly update the cache-tree
structure, resulting in bogus trees to be written afterwards, which
has been corrected.
* nd/switch-and-restore:
restore: invalidate cache-tree when removing entries with --staged
Junio C Hamano [Fri, 14 Feb 2020 20:42:28 +0000 (12:42 -0800)]
Merge branch 'jk/no-flush-upon-disconnecting-slrpc-transport' into maint
Reduce unnecessary round-trip when running "ls-remote" over the
stateless RPC mechanism.
* jk/no-flush-upon-disconnecting-slrpc-transport:
transport: don't flush when disconnecting stateless-rpc helper
Junio C Hamano [Fri, 14 Feb 2020 20:42:28 +0000 (12:42 -0800)]
Merge branch 'hw/tutorial-favor-switch-over-checkout' into maint
Complete an update to tutorial that encourages "git switch" over
"git checkout" that was done only half-way.
* hw/tutorial-favor-switch-over-checkout:
doc/gitcore-tutorial: fix prose to match example command
Junio C Hamano [Fri, 14 Feb 2020 20:42:27 +0000 (12:42 -0800)]
Merge branch 'es/unpack-trees-oob-fix' into maint
The code that tries to skip over the entries for the paths in a
single directory using the cache-tree was not careful enough
against corrupt index file.
* es/unpack-trees-oob-fix:
unpack-trees: watch for out-of-range index position
Junio C Hamano [Fri, 14 Feb 2020 20:42:27 +0000 (12:42 -0800)]
Merge branch 'bc/run-command-nullness-after-free-fix' into maint
C pedantry ;-) fix.
* bc/run-command-nullness-after-free-fix:
run-command: avoid undefined behavior in exists_in_PATH
Junio C Hamano [Fri, 14 Feb 2020 20:42:27 +0000 (12:42 -0800)]
Merge branch 'en/string-list-can-be-custom-sorted' into maint
API-doc update.
* en/string-list-can-be-custom-sorted:
string-list: note in docs that callers can specify sorting function
Junio C Hamano [Fri, 14 Feb 2020 20:42:27 +0000 (12:42 -0800)]
Merge branch 'jt/sha1-file-remove-oi-skip-cached' into maint
has_object_file() said "no" given an object registered to the
system via pretend_object_file(), making it inconsistent with
read_object_file(), causing lazy fetch to attempt fetching an
empty tree from promisor remotes.
* jt/sha1-file-remove-oi-skip-cached:
sha1-file: remove OBJECT_INFO_SKIP_CACHED
Junio C Hamano [Fri, 14 Feb 2020 20:42:27 +0000 (12:42 -0800)]
Merge branch 'hw/commit-advise-while-rejecting' into maint
"git commit" gives output similar to "git status" when there is
nothing to commit, but without honoring the advise.statusHints
configuration variable, which has been corrected.
* hw/commit-advise-while-rejecting:
commit: honor advice.statusHints when rejecting an empty commit
Johannes Schindelin [Thu, 13 Feb 2020 21:49:53 +0000 (21:49 +0000)]
mingw: add a helper function to attach GDB to the current process
When debugging Git, the criss-cross spawning of processes can make
things quite a bit difficult, especially when a Unix shell script is
thrown in the mix that calls a `git.exe` that then segfaults.
To help debugging such things, we introduce the `open_in_gdb()` function
which can be called at a code location where the segfault happens (or as
close as one can get); This will open a new MinTTY window with a GDB
that already attached to the current process.
Inspired by Derrick Stolee.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Thu, 13 Feb 2020 21:51:44 +0000 (21:51 +0000)]
t5580: test cloning without file://, test fetching via UNC paths
On Windows, it is quite common to work with network drives. The format
of the paths to network drives (or "network shares", or UNC paths) is:
\\<server>\<share>\...
We already have a couple regression tests revolving around those types
of paths, but we missed cloning and fetching from UNC paths without
leading `file://` (and with backslashes instead of forward slashes).
This lil' patch closes that gap.
It gets a bit silly to add the commands to the name of the test script,
so let's just rename it while we're testing more UNC stuff.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Fri, 14 Feb 2020 13:53:21 +0000 (13:53 +0000)]
t9001, t9116: avoid pipes
When grepping through the output of a command in the test suite, there
is always a chance that something goes wrong, in which case there would
not be anything useful to debug.
Let's redirect the output into a file instead, and grep that file, so
that the log can be inspected easily if the grep fails.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 12 Feb 2020 20:12:08 +0000 (12:12 -0800)]
The fourth batch for 2.26
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 12 Feb 2020 20:41:39 +0000 (12:41 -0800)]
Merge branch 'js/convert-typofix'
Typofix.
* js/convert-typofix:
convert: fix typo
Junio C Hamano [Wed, 12 Feb 2020 20:41:39 +0000 (12:41 -0800)]
Merge branch 'js/ci-squelch-doc-warning'
Squelch unhelpful warning message during documentation build.
* js/ci-squelch-doc-warning:
ci: ignore rubygems warning in the "Documentation" job
Junio C Hamano [Wed, 12 Feb 2020 20:41:39 +0000 (12:41 -0800)]
Merge branch 'jb/multi-pack-index-docfix'
Doc fix.
* jb/multi-pack-index-docfix:
pack-format: correct multi-pack-index description
Junio C Hamano [Wed, 12 Feb 2020 20:41:38 +0000 (12:41 -0800)]
Merge branch 'ma/diff-doc-clarify-regexp-example'
Doc clarification.
* ma/diff-doc-clarify-regexp-example:
diff-options.txt: avoid "regex" overload in example
Junio C Hamano [Wed, 12 Feb 2020 20:41:38 +0000 (12:41 -0800)]
Merge branch 'ms/doc-bundle-format'
Technical details of the bundle format has been documented.
* ms/doc-bundle-format:
doc: describe Git bundle format
Junio C Hamano [Wed, 12 Feb 2020 20:41:38 +0000 (12:41 -0800)]
Merge branch 'es/submodule-fetch-message-fix'
Error message fix.
* es/submodule-fetch-message-fix:
submodule: add newline on invalid submodule error
Junio C Hamano [Wed, 12 Feb 2020 20:41:37 +0000 (12:41 -0800)]
Merge branch 'jb/parse-options-message-fix'
Error message fix.
* jb/parse-options-message-fix:
parse-options: lose an unnecessary space in an error message
Junio C Hamano [Wed, 12 Feb 2020 20:41:37 +0000 (12:41 -0800)]
Merge branch 'ma/filter-branch-doc-caret'
Doc mark-up updates.
* ma/filter-branch-doc-caret:
git-filter-branch.txt: wrap "maths" notation in backticks
Junio C Hamano [Wed, 12 Feb 2020 20:41:37 +0000 (12:41 -0800)]
Merge branch 'km/submodule-doc-use-sm-path'
Docfix.
* km/submodule-doc-use-sm-path:
submodule foreach: replace $path with $sm_path in example
Junio C Hamano [Wed, 12 Feb 2020 20:41:37 +0000 (12:41 -0800)]
Merge branch 'jc/skip-prefix'
Code simplification.
* jc/skip-prefix:
C: use skip_prefix() to avoid hardcoded string length
Junio C Hamano [Wed, 12 Feb 2020 20:41:36 +0000 (12:41 -0800)]
Merge branch 'pb/do-not-recurse-grep-no-index'
"git grep --no-index" should not get affected by the contents of
the .gitmodules file but when "--recurse-submodules" is given or
the "submodule.recurse" variable is set, it did. Now these
settings are ignored in the "--no-index" mode.
* pb/do-not-recurse-grep-no-index:
grep: ignore --recurse-submodules if --no-index is given
Junio C Hamano [Wed, 12 Feb 2020 20:41:36 +0000 (12:41 -0800)]
Merge branch 'hw/doc-git-dir'
One effect of specifying where the GIT_DIR is (either with the
environment variable, or with the "git --git-dir=<where> cmd"
option) is to disable the repository discovery. This has been
placed a bit more stress in the documentation, as new users often
get confused.
* hw/doc-git-dir:
git: update documentation for --git-dir
Junio C Hamano [Wed, 12 Feb 2020 20:41:36 +0000 (12:41 -0800)]
Merge branch 'jk/push-default-doc'
Doc update.
* jk/push-default-doc:
doc: drop "explicitly given" from push.default description
Junio C Hamano [Wed, 12 Feb 2020 20:41:36 +0000 (12:41 -0800)]
Merge branch 'jk/clang-sanitizer-fixes'
C pedantry ;-) fix.
* jk/clang-sanitizer-fixes:
obstack: avoid computing offsets from NULL pointer
xdiff: avoid computing non-zero offset from NULL pointer
avoid computing zero offsets from NULL pointer
merge-recursive: use subtraction to flip stage
merge-recursive: silence -Wxor-used-as-pow warning
Junio C Hamano [Wed, 12 Feb 2020 20:41:35 +0000 (12:41 -0800)]
Merge branch 'dt/submodule-rm-with-stale-cache'
Running "git rm" on a submodule failed unnecessarily when
.gitmodules is only cache-dirty, which has been corrected.
* dt/submodule-rm-with-stale-cache:
git rm submodule: succeed if .gitmodules index stat info is zero
Junio C Hamano [Wed, 12 Feb 2020 20:41:35 +0000 (12:41 -0800)]
Merge branch 'jt/t5616-robustify'
Futureproofing a test not to depend on the current implementation
detail.
* jt/t5616-robustify:
t5616: make robust to delta base change
Junio C Hamano [Wed, 12 Feb 2020 20:41:35 +0000 (12:41 -0800)]
Merge branch 'jk/escaped-wildcard-dwim'
Disambiguation logic to tell revisions and pathspec apart has been
tweaked so that backslash-escaped glob special characters do not
count in the "wildcards are pathspec" rule.
* jk/escaped-wildcard-dwim:
verify_filename(): handle backslashes in "wildcards are pathspecs" rule
Junio C Hamano [Wed, 12 Feb 2020 20:41:35 +0000 (12:41 -0800)]
Merge branch 'jn/pretend-object-doc'
Warn programmers about pretend_object_file() that allows the code
to tentatively use in-core objects.
* jn/pretend-object-doc:
sha1-file: document how to use pretend_object_file
Johannes Schindelin [Wed, 12 Feb 2020 11:27:55 +0000 (11:27 +0000)]
tests: fix --write-junit-xml with subshells
In t0000, more precisely in its `test_bool_env` test case, there are two
subshells that are supposed to fail. To be even _more_ precise, they
fail by calling the `error` function, and that is okay, because it is in
a subshell, and it is expected that those two subshell invocations fail.
However, the `error` function also tries to finalize the JUnit XML (if
that XML was asked for, via `--write-junit-xml`. As a consequence, the
XML is edited to add a `time` attribute for the `testsuite` tag. And
since there are two expected `error` calls in addition to the final
`test_done`, the `finalize_junit_xml` function is called three times and
naturally the `time` attribute is added _three times_.
Azure Pipelines is not happy with that, complaining thusly:
##[warning]Failed to read D:\a\1\s\t\out\TEST-t0000-basic.xml. Error : 'time' is a duplicate attribute name. Line 2, position 82..
One possible way to address this would be to unset `write_junit_xml` in
the `test_bool_env` test case.
But that would be fragile, as other `error` calls in subshells could be
introduced.
So let's just modify `finalize_junit_xml` to remove any `time` attribute
before adding the authoritative one.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Tue, 11 Feb 2020 18:56:18 +0000 (18:56 +0000)]
convert: fix typo
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Tue, 11 Feb 2020 17:20:05 +0000 (12:20 -0500)]
mailinfo: factor out some repeated header handling
We do the same thing for each header: match it, copy it to a strbuf, and
decode it. Let's put that in a helper function to avoid repetition.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Tue, 11 Feb 2020 17:19:53 +0000 (12:19 -0500)]
mailinfo: be more liberal with header whitespace
RFC822 and friends allow arbitrary whitespace after the colon of a
header and before the values. I.e.:
Subject:foo
Subject: foo
Subject: foo
all have the subject "foo". But mailinfo requires exactly one space.
This doesn't seem to be bothering anybody, but it is pickier than the
standard specifies. And we can easily just soak up arbitrary whitespace
there in our parser, so let's do so.
Note that the test covers both too little and too much whitespace, but
the "too much" case already works fine (because we later eat leading and
trailing whitespace from the values).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Tue, 11 Feb 2020 17:19:23 +0000 (12:19 -0500)]
mailinfo: simplify parsing of header values
Our code to parse header values first checks to see if a line starts
with a header, and then manually skips past the matched string to find
the value. We can do this all in one step by modeling after
skip_prefix(), which returns a pointer into the string after the
parsing.
This lets us remove some repeated strings, and will also enable us to
parse more flexibly in a future patch.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Tue, 11 Feb 2020 17:18:52 +0000 (12:18 -0500)]
mailinfo: treat header values as C strings
We read each header line into a strbuf, which means that we could
in theory handle header values with embedded NUL bytes. But in practice,
the values we parse out are passed to decode_header(), which uses
strstr(), strchr(), etc. And we would not expect such bytes anyway; they
are forbidden by RFC822, etc. and any non-ASCII characters should be
encoded with RFC2047 encoding.
So let's switch to using strbuf_addstr(), which saves us some length
computations (and will enable further cleanups in this code).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthew Rogers [Mon, 10 Feb 2020 00:30:59 +0000 (00:30 +0000)]
config: add '--show-scope' to print the scope of a config value
When a user queries config values with --show-origin, often it's
difficult to determine what the actual "scope" (local, global, etc.) of
a given value is based on just the origin file.
Teach 'git config' the '--show-scope' option to print the scope of all
displayed config values. Note that we should never see anything of
"submodule" scope as that is only ever used by submodule-config.c when
parsing the '.gitmodules' file.
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthew Rogers [Mon, 10 Feb 2020 00:30:58 +0000 (00:30 +0000)]
submodule-config: add subomdule config scope
Before the changes to teach git_config_source to remember scope
information submodule-config.c never needed to consider the question of
config scope. Even though zeroing out git_config_source is still
correct and preserved the previous behavior of setting the scope to
CONFIG_SCOPE_UNKNOWN, it's better to be explicit about such situations
by explicitly setting the scope. As none of the current config_scope
enumerations make sense we create CONFIG_SCOPE_SUBMODULE to describe the
situation.
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthew Rogers [Mon, 10 Feb 2020 00:30:57 +0000 (00:30 +0000)]
config: teach git_config_source to remember its scope
There are many situations where the scope of a config command is known
beforehand, such as passing of '--local', '--file', etc. to an
invocation of git config. However, this information is lost when moving
from builtin/config.c to /config.c. This historically hasn't been a big
deal, but to prepare for the upcoming --show-scope option we teach
git_config_source to keep track of the source and the config machinery
to use that information to set current_parsing_scope appropriately.
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthew Rogers [Mon, 10 Feb 2020 00:30:56 +0000 (00:30 +0000)]
config: preserve scope in do_git_config_sequence
do_git_config_sequence operated under the assumption that it was correct
to set current_parsing_scope to CONFIG_SCOPE_UNKNOWN as part of the
cleanup it does after it finishes execution. This is incorrect, as it
blows away the current_parsing_scope if do_git_config_sequence is called
recursively. As such situations are rare (git config running with the
'--blob' option is one example) this has yet to cause a problem, but the
upcoming '--show-scope' option will experience issues in that case, lets
teach do_git_config_sequence to preserve the current_parsing_scope from
before it started execution.
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthew Rogers [Mon, 10 Feb 2020 00:30:55 +0000 (00:30 +0000)]
config: clarify meaning of command line scoping
CONFIG_SCOPE_CMDLINE is generally used in the code to refer to config
values passed in via the -c option. Options passed in using this
mechanism share similar scoping characteristics with the --file and
--blob options of the 'config' command, namely that they are only in use
for that single invocation of git, and that they supersede the normal
system/global/local hierarchy. This patch introduces
CONFIG_SCOPE_COMMAND to reflect this new idea, which also makes
CONFIG_SCOPE_CMDLINE redundant.
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthew Rogers [Mon, 10 Feb 2020 00:30:54 +0000 (00:30 +0000)]
config: split repo scope to local and worktree
Previously when iterating through git config variables, worktree config
and local config were both considered "CONFIG_SCOPE_REPO". This was
never a problem before as no one had needed to differentiate between the
two cases, but future functionality may care whether or not the config
options come from a worktree or from the repository's actual local
config file. For example, the planned feature to add a '--show-scope'
to config to allow a user to see which scope listed config options come
from would confuse users if it just printed 'repo' rather than 'local'
or 'worktree' as the documentation would lead them to expect. As well
as the additional benefit of making the implementation look more like
how the documentation describes the interface.
To accomplish this we split out what was previously considered repo
scope to be local and worktree.
The clients of 'current_config_scope()' who cared about
CONFIG_SCOPE_REPO are also modified to similarly care about
CONFIG_SCOPE_WORKTREE and CONFIG_SCOPE_LOCAL to preserve previous behavior.
Signed-off-by: Matthew Rogers <mattr94@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>