Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2022-05-11stash: integrate with sparse indexVictoria Dye
Enable sparse index in 'git stash' by disabling 'command_requires_full_index'. With sparse index enabled, some subcommands of 'stash' work without expanding the index, e.g., 'git stash', 'git stash list', 'git stash drop', etc. Others ensure the index is expanded either directly (as in the case of 'git stash [pop|apply]', where the call to 'merge_recursive_generic()' in 'do_apply_stash()' triggers the expansion), or in a command called internally by stash (e.g., 'git update-index' in 'git stash -u'). So, in addition to enabling sparse index, add tests to 't1092' demonstrating which variants of 'git stash' expand the index, and which do not. Finally, add the option to skip writing 'untracked.txt' in 'ensure_not_expanded', and use that option to successfully apply stashed untracked files without a conflict in 'untracked.txt'. Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-11stash: expand sparse-checkout compatibility testingVictoria Dye
Add tests verifying expected 'git stash' behavior in 't1092-sparse-checkout-compatibility'. These cases establish the expected behavior of 'git stash' in a sparse-checkout and verify consistency both with and without a sparse index. Although no sparse index compatibility has been integrated into 'git stash' yet, the tests are all 'expect_success' - we don't want the cone-mode sparse-checkout behavior to change depending on whether it is using a sparse index or not. Therefore, we expect these tests to continue passing once sparse index is integrated with 'git stash'. Additionally, add performance test cases for 'git stash' both with and without untracked files. Note that, unlike the other tests in 'p2000-sparse-operations.sh', the tests added for 'stash' are combination operations. This is done to ensure the stash/unstash is not blocked by the modification of '$SPARSE_CONE/a' performed as part of 'test_perf_on_all'. Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-14Revert "fetch: increase test coverage of fetches"Junio C Hamano
This reverts commit 2a0cafd464709cfa22fe7249290c644a2a26c520, as it expects a working "a ref deletion must produce a single transaction, not one for loose and another for packed" topic, which we do not have.
2022-04-14Revert "Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'"Junio C Hamano
This reverts commit 991b4d47f0accd3955d05927d5ce434e03ffbdb6, reversing changes made to bcd020f88e1e22f38422ac3f73ab06b34ec4bef1.
2022-04-14Sync with Git 2.35.3Junio C Hamano
2022-04-14Git 2.35.3v2.35.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-14Git 2.34.3v2.34.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-14Git 2.33.3v2.33.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-14Git 2.32.2v2.32.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-14Git 2.31.3v2.31.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13setup: opt-out of check with safe.directory=*Derrick Stolee
With the addition of the safe.directory in 8959555ce (setup_git_directory(): add an owner check for the top-level directory, 2022-03-02) released in v2.35.2, we are receiving feedback from a variety of users about the feature. Some users have a very large list of shared repositories and find it cumbersome to add this config for every one of them. In a more difficult case, certain workflows involve running Git commands within containers. The container boundary prevents any global or system config from communicating `safe.directory` values from the host into the container. Further, the container almost always runs as a different user than the owner of the directory in the host. To simplify the reactions necessary for these users, extend the definition of the safe.directory config value to include a possible '*' value. This value implies that all directories are safe, providing a single setting to opt-out of this protection. Note that an empty assignment of safe.directory clears all previous values, and this is already the case with the "if (!value || !*value)" condition. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13setup: fix safe.directory key not being checkedMatheus Valadares
It seems that nothing is ever checking to make sure the safe directories in the configs actually have the key safe.directory, so some unrelated config that has a value with a certain directory would also make it a safe directory. Signed-off-by: Matheus Valadares <me@m28.io> Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-13t0033: add tests for safe.directoryDerrick Stolee
It is difficult to change the ownership on a directory in our test suite, so insert a new GIT_TEST_ASSUME_DIFFERENT_OWNER environment variable to trick Git into thinking we are in a differently-owned directory. This allows us to test that the config is parsed correctly. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-12Merge tag 'v2.35.2'Junio C Hamano
2022-04-08Merge branch 'ld/sparse-index-bash-completion'Junio C Hamano
Test regression fix. * ld/sparse-index-bash-completion: t9902: split test to run on appropriate systems
2022-04-08t9902: split test to run on appropriate systemsAdam Dinwoodie
The "FUNNYNAMES" test prerequisite passes on Cygwin, as the Cygwin file system interface has a workaround for the underlying operating system's lack of support for tabs, newlines or quotes. However, it does not add support for backslash, which is treated as a directory separator, meaning one of the tests added by 48803821b1 ("completion: handle unusual characters for sparse-checkout", 2022-02-07) will fail on Cygwin. To avoid this failure while still getting maximal test coverage, split that test into two: test handling of paths that include tabs on anything that has the FUNNYNAMES prerequisite, but skip testing handling of paths that include backslashes unless both FUNNYNAMES is set and the system is not Cygwin. It might be nice to have more granularity than "FUNNYNAMES" and its sibling "FUNNIERNAMES" provide, so that tests could be run based on specific individual characters supported by the file system being tested, but that seems like it would make the prerequisite checks in this area much more verbose for very little gain. Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-04Merge branch 'pw/worktree-list-with-z'Junio C Hamano
"git worktree list --porcelain" did not c-quote pathnames and lock reasons with unsafe bytes correctly, which is worked around by introducing NUL terminated output format with "-z". * pw/worktree-list-with-z: worktree: add -z option for list subcommand
2022-04-04Merge branch 'vd/mv-refresh-stat'Junio C Hamano
"git mv" failed to refresh the cached stat information for the entry it moved. * vd/mv-refresh-stat: mv: refresh stat info for moved entry
2022-04-04Merge branch 'jh/builtin-fsmonitor-part2'Junio C Hamano
Built-in fsmonitor (part 2). * jh/builtin-fsmonitor-part2: (30 commits) t7527: test status with untracked-cache and fsmonitor--daemon fsmonitor: force update index after large responses fsmonitor--daemon: use a cookie file to sync with file system fsmonitor--daemon: periodically truncate list of modified files t/perf/p7519: add fsmonitor--daemon test cases t/perf/p7519: speed up test on Windows t/perf/p7519: fix coding style t/helper/test-chmtime: skip directories on Windows t/perf: avoid copying builtin fsmonitor files into test repo t7527: create test for fsmonitor--daemon t/helper/fsmonitor-client: create IPC client to talk to FSMonitor Daemon help: include fsmonitor--daemon feature flag in version info fsmonitor--daemon: implement handle_client callback compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener on MacOS compat/fsmonitor/fsm-listen-darwin: add MacOS header files for FSEvent compat/fsmonitor/fsm-listen-win32: implement FSMonitor backend on Windows fsmonitor--daemon: create token-based changed path cache fsmonitor--daemon: define token-ids fsmonitor--daemon: add pathname classification fsmonitor--daemon: implement 'start' command ...
2022-04-04Merge branch 'tk/ambiguous-fetch-refspec'Junio C Hamano
Give hint when branch tracking cannot be established because fetch refspecs from multiple remote repositories overlap. * tk/ambiguous-fetch-refspec: tracking branches: add advice to ambiguous refspec error
2022-04-04Merge branch 'rc/fetch-refetch'Junio C Hamano
"git fetch --refetch" learned to fetch everything without telling the other side what we already have, which is useful when you cannot trust what you have in the local object store. * rc/fetch-refetch: docs: mention --refetch fetch option fetch: after refetch, encourage auto gc repacking t5615-partial-clone: add test for fetch --refetch fetch: add --refetch option builtin/fetch-pack: add --refetch option fetch-pack: add refetch fetch-negotiator: add specific noop initializer
2022-04-04Merge branch 'ns/trace2-fsync-stat'Junio C Hamano
Trace2 code has been taught to report stats for fsync operations. * ns/trace2-fsync-stat: trace2: add stats for fsync operations
2022-04-04Merge branch 'gc/branch-recurse-submodules-fix'Junio C Hamano
A handful of obvious clean-ups around a topic that is already in 'master'. * gc/branch-recurse-submodules-fix: branch.c: simplify advice-and-die sequence branch: rework comments for future developers branch: remove negative exit code branch --set-upstream-to: be consistent when advising branch: give submodule updating advice before exit branch: support more tracking modes when recursing
2022-04-04Merge branch 'ds/t7700-kept-pack-test'Junio C Hamano
Test clean-up. * ds/t7700-kept-pack-test: test-lib-functions: remove test_subcommand_inexact t7700: check post-condition in kept-pack test
2022-04-04Merge branch 'ds/partial-bundle-more'Junio C Hamano
Code clean-up. * ds/partial-bundle-more: pack-objects: lazily set up "struct rev_info", don't leak bundle: output hash information in 'verify' bundle: move capabilities to end of 'verify' pack-objects: parse --filter directly into revs.filter pack-objects: move revs out of get_object_list() list-objects-filter: remove CL_ARG__FILTER
2022-04-04Merge branch 'tl/ls-tree-oid-only'Junio C Hamano
"git ls-tree" learns "--oid-only" option, similar to "--name-only", and more generalized "--format" option. * tl/ls-tree-oid-only: ls-tree: split up "fast path" callbacks ls-tree: detect and error on --name-only --name-status ls-tree: support --object-only option for "git-ls-tree" ls-tree: introduce "--format" option cocci: allow padding with `strbuf_addf()` ls-tree: introduce struct "show_tree_data" ls-tree: slightly refactor `show_tree()` ls-tree: fix "--name-only" and "--long" combined use bug ls-tree: simplify nesting if/else logic in "show_tree()" ls-tree: rename "retval" to "recurse" in "show_tree()" ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" ls-tree: use "enum object_type", not {blob,tree,commit}_type ls-tree: add missing braces to "else" arms ls-tree: remove commented-out code ls-tree tests: add tests for --name-status
2022-04-04Merge branch 'ab/reflog-parse-options'Junio C Hamano
"git reflog" command now uses parse-options API to parse its command line options. * ab/reflog-parse-options: reflog: fix 'show' subcommand's argv reflog [show]: display sensible -h output reflog: convert to parse_options() API reflog exists: use parse_options() API git reflog [expire|delete]: make -h output consistent with SYNOPSIS reflog: move "usage" variables and use macros reflog tests: add missing "git reflog exists" tests reflog: refactor cmd_reflog() to "if" branches reflog.c: indent argument lists
2022-04-01tracking branches: add advice to ambiguous refspec errorTao Klerks
The error "not tracking: ambiguous information for ref" is raised when we are evaluating what tracking information to set on a branch, and find that the ref to be added as tracking branch is mapped under multiple remotes' fetch refspecs. This can easily happen when a user copy-pastes a remote definition in their git config, and forgets to change the tracking path. Add advice in this situation, explicitly highlighting which remotes are involved and suggesting how to correct the situation. Also update a test to explicitly expect that advice. Signed-off-by: Tao Klerks <tao@klerks.biz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-31worktree: add -z option for list subcommandPhillip Wood
Add a -z option to be used in conjunction with --porcelain that gives NUL-terminated output. As 'worktree list --porcelain' does not quote worktree paths this enables it to handle worktree paths that contain newlines. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-31Merge branch 'ab/test-tap-fix-for-immediate'Junio C Hamano
Fix test framework a bit. * ab/test-tap-fix-for-immediate: test-lib: have --immediate emit valid TAP on failure
2022-03-31Merge branch 'ab/hook-tests-updates'Junio C Hamano
Update tests around the use of hook scripts. * ab/hook-tests-updates: http tests: use "test_hook" for "smart" and "dumb" http tests proc-receive hook tests: use "test_hook" instead of "write_script" tests: extend "test_hook" for "rm" and "chmod -x", convert "$HOOK" tests: use "test_hook" for misc "mkdir -p" and "chmod" cases tests: change "mkdir -p && write_script" to use "test_hook" tests: change "cat && chmod +x" to use "test_hook" gc + p4 tests: use "test_hook", remove sub-shells fetch+push tests: use "test_hook" and "test_when_finished" pattern bugreport tests: tighten up "git bugreport -s hooks" test tests: assume the hooks are disabled by default http tests: don't rely on "hook/post-update.sample" hook tests: turn exit code assertions into a loop test-lib-functions: add and use a "test_hook" wrapper
2022-03-31Merge branch 'vd/stash-silence-reset'Junio C Hamano
"git stash" does not allow subcommands it internally runs as its implementation detail, except for "git reset", to emit messages; now "git reset" part has also been squelched. * vd/stash-silence-reset: reset: show --no-refresh in the short-help reset: remove 'reset.refresh' config option reset: remove 'reset.quiet' config option reset: do not make '--quiet' disable index refresh stash: make internal resets quiet and refresh index reset: suppress '--no-refresh' advice if logging is silenced reset: replace '--quiet' with '--no-refresh' in performance advice reset: introduce --[no-]refresh option to --mixed reset: revise index refresh advice
2022-03-30branch: support more tracking modes when recursingGlen Choo
"git branch --recurse-submodules" does not propagate "--track=inherit" or "--no-track" to submodules, which causes submodule branches to use the wrong tracking mode [1]. To fix this, pass the correct options to the "submodule--helper create-branch" child process and test for it. While we are refactoring the same code, replace "--track" with the synonymous, but more consistent-looking "--track=direct" option (introduced at the same time as "--track=inherit", d3115660b4 (branch: add flags and config to inherit tracking, 2021-12-20)). [1] This bug is partially a timing issue: "branch --recurse-submodules" was introduced around the same time as "--track=inherit", and even though I rebased "branch --recurse-submodules" on top of that, I had neglected to support the new tracking mode. Omitting "--no-track" was just a plain old mistake, though. Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-30trace2: add stats for fsync operationsNeeraj Singh
Add some global trace2 statistics for the number of fsyncs performed during the lifetime of a Git process. These stats are printed as part of trace2_cmd_exit_fl, which is presumably where we might want to print any other cross-cutting statistics. Signed-off-by: Neeraj Singh <neerajsi@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-29Merge branch 'jc/rebase-detach-fix'Junio C Hamano
"git rebase $base $non_branch_commit", when $base is an ancestor or the $non_branch_commit, modified the current branch, which has been corrected. * jc/rebase-detach-fix: rebase: set REF_HEAD_DETACH in checkout_up_to_date() rebase: use test_commit helper in setup
2022-03-29Merge branch 'jt/reset-grafts-when-resetting-shallow'Junio C Hamano
When "shallow" information is updated, we forgot to update the in-core equivalent, which has been corrected. * jt/reset-grafts-when-resetting-shallow: shallow: reset commit grafts when shallow is reset
2022-03-29Merge branch 'vd/cache-bottom-fix'Junio C Hamano
Correct a bug in unpack-trees introduced earlier. * vd/cache-bottom-fix: Revert "unpack-trees: improve performance of next_cache_entry" unpack-trees: increment cache_bottom for sparse directories t1092: add sparse directory before cone in test repo
2022-03-29mv: refresh stat info for moved entryVictoria Dye
Update the stat info of the moved index entry in 'rename_index_entry_at()' if the entry is up-to-date with the index. Internally, 'git mv' uses 'rename_index_entry_at()' to move the source index entry to the destination. However, it directly copies the stat info of the original cache entry, which will not reflect the 'ctime' of the file renaming operation that happened as part of the move. If a file is otherwise up-to-date with the index, that difference in 'ctime' will make the entry appear out-of-date until the next index-refreshing operation (e.g., 'git status'). Some commands, such as 'git reset', use the cached stat information to determine whether a file is up-to-date; if this information is incorrect, the command will fail when it should pass. In order to ensure a moved entry is evaluated as 'up-to-date' when appropriate, refresh the destination index entry's stat info in 'git mv' if and only if the file is up-to-date. Note that the test added in 't7001-mv.sh' requires a "sleep 1" to ensure the 'ctime' of the file creation will be definitively older than the 'ctime' of the renamed file in 'git mv'. Reported-by: Maximilian Reichel <reichemn@icloud.com> Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-28fetch: after refetch, encourage auto gc repackingRobert Coup
After invoking `fetch --refetch`, the object db will likely contain many duplicate objects. If auto-maintenance is enabled, invoke it with appropriate settings to encourage repacking/consolidation. * gc.autoPackLimit: unless this is set to 0 (disabled), override the value to 1 to force pack consolidation. * maintenance.incremental-repack.auto: unless this is set to 0, override the value to -1 to force incremental repacking. Signed-off-by: Robert Coup <robert@coup.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-28t5615-partial-clone: add test for fetch --refetchRobert Coup
Add a test for doing a refetch to apply a changed partial clone filter under protocol v0 and v2. Signed-off-by: Robert Coup <robert@coup.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-26Merge branch 'gc/recursive-fetch-with-unused-submodules'Junio C Hamano
When "git fetch --recurse-submodules" grabbed submodule commits that would be needed to recursively check out newly fetched commits in the superproject, it only paid attention to submodules that are in the current checkout of the superproject. We now do so for all submodules that have been run "git submodule init" on. * gc/recursive-fetch-with-unused-submodules: submodule: fix latent check_has_commit() bug fetch: fetch unpopulated, changed submodules submodule: move logic into fetch_task_create() submodule: extract get_fetch_task() submodule: store new submodule commits oid_array in a struct submodule: inline submodule_commits() into caller submodule: make static functions read submodules from commits t5526: create superproject commits with test helper t5526: stop asserting on stderr literally t5526: introduce test helper to assert on fetches
2022-03-26t7527: test status with untracked-cache and fsmonitor--daemonJeff Hostetler
Create 2x2 test matrix with the untracked-cache and fsmonitor--daemon features and a series of edits and verify that status output is identical. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-26t/perf/p7519: add fsmonitor--daemon test casesJeff Hostetler
Repeat all of the fsmonitor perf tests using `git fsmonitor--daemon` and the "Simple IPC" interface. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-26t/perf/p7519: speed up test on WindowsJeff Hostetler
Change p7519 to use `test_seq` and `xargs` rather than a `for` loop to touch thousands of files. This takes minutes off of test runs on Windows because of process creation overhead. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-26t/perf/p7519: fix coding styleJeff Hostetler
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-26t/helper/test-chmtime: skip directories on WindowsJeff Hostetler
Teach `test-tool.exe chmtime` to ignore errors when setting the mtime on a directory on Windows. NEEDSWORK: The Windows version of `utime()` (aka `mingw_utime()`) does not properly handle directories because it uses `_wopen()`. It should be converted to using `CreateFileW()` and backup semantics at a minimum. Since I'm already in the middle of a large patch series, I did not want to destabilize other callers of `utime()` right now. The problem has only been observed in the t/perf/p7519 test when the test repo contains an empty directory on disk. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-26t/perf: avoid copying builtin fsmonitor files into test repoJeff Hostetler
Do not copy any of the various fsmonitor--daemon files from the .git directory of the (GIT_PREF_REPO or GIT_PERF_LARGE_REPO) source repo into the test's trash directory. When perf tests start, they copy the contents of the source repo into the test's trash directory. If fsmonitor is running in the source repo, there may be control files, such as the IPC socket and/or fsmonitor cookie files. These should not be copied into the test repo. Unix domain sockets cannot be copied in the manner used by the test setup, so if present, the test setup fails. Cookie files are harmless, but we should avoid them. The builtin fsmonitor keeps all such control files/sockets in .git/fsmonitor--daemon*, so it is simple to exclude them. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-26t7527: create test for fsmonitor--daemonJeff Hostetler
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-26t/helper/fsmonitor-client: create IPC client to talk to FSMonitor DaemonJeff Hostetler
Create an IPC client to send query and flush commands to the daemon. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-26help: include fsmonitor--daemon feature flag in version infoJeff Hostetler
Add the "feature: fsmonitor--daemon" message to the output of `git version --build-options`. The builtin FSMonitor is only available on certain platforms and even then only when certain Makefile flags are enabled, so print a message in the verbose version output when it is available. This can be used by test scripts for prereq testing. Granted, tests could just try `git fsmonitor--daemon status` and look for a 128 exit code or grep for a "not supported" message on stderr, but these methods are rather obscure. The main advantage is that the feature message will automatically appear in bug reports and other support requests. This concept was also used during the development of Scalar for similar reasons. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>