summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-03-31CodingGuidelines: give deadline for "for (int i = 0; ..."Libravatar Junio C Hamano1-1/+4
We raised the weather balloon to see if we can allow the construct in 44ba10d6 (revision: use C99 declaration of variable in for() loop, 2021-11-14), which was shipped as a part of Git v2.35. Document that fact in the coding guidelines, and more importantly, give ourselves a deadline to revisit and update. Let's declare that we will officially adopt the variable declaration in the initializaiton part of "for ()" statement this winter, unless we find that a platform we care about does not grok it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-30The 17th batchLibravatar Junio C Hamano1-0/+4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-30Merge branch 'ab/test-tap-fix-for-immediate'Libravatar Junio C Hamano2-1/+18
Fix test framework a bit. * ab/test-tap-fix-for-immediate: test-lib: have --immediate emit valid TAP on failure
2022-03-30Merge branch 'ab/hook-tests-updates'Libravatar Junio C Hamano67-606/+575
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-30Merge branch 'jd/prompt-upstream-mark'Libravatar Junio C Hamano1-29/+30
Tweaks in the command line prompt (in contrib/) code around its GIT_PS1_SHOWUPSTREAM feature. * jd/prompt-upstream-mark: git-prompt: put upstream comments together git-prompt: make long upstream state indicator consistent git-prompt: make upstream state indicator location consistent git-prompt: rename `upstream` to `upstream_type`
2022-03-30Merge branch 'pw/add-p-single-key'Libravatar Junio C Hamano2-36/+211
Finishing touches to C rewrite of "git add -i" in single-key interactive mode. * pw/add-p-single-key: terminal: restore settings on SIGTSTP terminal: work around macos poll() bug terminal: don't assume stdin is /dev/tty terminal: use flags for save_term()
2022-03-30Merge branch 'ab/make-optim-noop'Libravatar Junio C Hamano1-1/+1
A micro fix to a topic earlier merged to 'master' * ab/make-optim-noop: Makefile: use ' ', not non-existing $(wspfx_SQ)
2022-03-30Merge branch 'vd/stash-silence-reset'Libravatar Junio C Hamano11-30/+87
"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-30Merge branch 'ab/racy-hooks'Libravatar Junio C Hamano1-0/+1
Regression fix. * ab/racy-hooks: hooks: fix "invoked hook" regression in a8cc5943338
2022-03-30branch: remove negative exit codeLibravatar Glen Choo1-1/+1
Replace an instance of "exit(-1)" with "exit(1)". We don't use negative exit codes - they are misleading because Unix machines will coerce them to 8-bit unsigned values, losing the sign. Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-30object-file: pass filename to fsync_or_dieLibravatar Neeraj Singh1-4/+4
If we die while trying to fsync a loose object file, pass the actual filename we're trying to sync. This is likely to be more helpful for a user trying to diagnose the cause of the failure than the former 'loose object file' string. It also sidesteps any concerns about translating the die message differently for loose objects versus something else that has a real path. Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Neeraj Singh <neerajsi@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-30core.fsyncmethod: correctly camel-case warning messageLibravatar Neeraj Singh1-1/+1
The warning for an unrecognized fsyncMethod was not camel-cased. Reported-by: Jiang Xin <worldhello.net@gmail.com> Signed-off-by: Neeraj Singh <neerajsi@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-30branch --set-upstream-to: be consistent when advisingLibravatar Glen Choo1-2/+3
"git branch --set-upstream-to" behaves differently when advice is enabled/disabled: | | error prefix | exit code | |-----------------+--------------+-----------| | advice enabled | error: | 1 | | advice disabled | fatal: | 128 | Make both cases consistent by using die_message() when advice is enabled (this was first proposed in [1]). [1] https://lore.kernel.org/git/211210.86ee6ldwlc.gmgdl@evledraar.gmail.com Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-30branch: give submodule updating advice before exitLibravatar Glen Choo1-2/+4
Fix a bug where "hint:" was printed _before_ "fatal:" (instead of the other way around). Signed-off-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-30branch: support more tracking modes when recursingLibravatar Glen Choo3-7/+67
"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 operationsLibravatar Neeraj Singh4-0/+22
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-29core.fsync: fix incorrect expression for default configurationLibravatar Neeraj Singh1-2/+2
Commit b9f5d035 (core.fsync: documentation and user-friendly aggregate options, 2022-03-15) introduced an incorrect value for FSYNC_COMPONENTS_DEFAULT. We need an AND-NOT rather than OR-NOT. Signed-off-by: Neeraj Singh <neerajsi@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-29The 16th batchLibravatar Junio C Hamano1-0/+7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-29Merge branch 'jc/rebase-detach-fix'Libravatar Junio C Hamano2-7/+13
"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'Libravatar Junio C Hamano5-0/+22
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'Libravatar Junio C Hamano2-26/+20
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-29Merge branch 'ab/refs-various-fixes'Libravatar Junio C Hamano9-188/+135
Code clean-up. * ab/refs-various-fixes: refs debug: add a wrapper for "read_symbolic_ref" packed-backend: remove stub BUG(...) functions misc *.c: use designated initializers for struct assignments refs: use designated initializers for "struct ref_iterator_vtable" refs: use designated initializers for "struct ref_storage_be"
2022-03-29worktree: include repair cmd in usageLibravatar Des Preston1-0/+1
The worktree repair command was not added to the usage menu for the worktree command. This commit adds the usage of 'worktree repair' according to the existing docs. Signed-off-by: Des Preston <despreston@gmail.com> Acked-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-29mv: refresh stat info for moved entryLibravatar Victoria Dye2-2/+34
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-28reflog: fix 'show' subcommand's argvLibravatar SZEDER Gábor1-2/+2
cmd_reflog() invokes parse_options() with PARSE_OPT_KEEP_ARGV0, but it doesn't account for the retained argv[0] before invoking cmd_reflog_show() to handle the 'git reflog show' subcommand. Consequently, cmd_reflog_show() always gets an 'argv' array starting with elements argv[0]="reflog" and argv[1]="show". Strip the name of the git command from the 'argv' array before passing it to the function handling the 'show' subcommand. There is no user-visible bug here, because cmd_reflog_show() doesn't have any options or parameters of its own. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-28reftable: make assignments portable to AIX xlc v12.01Libravatar Ævar Arnfjörð Bjarmason3-6/+18
Change the assignment syntax introduced in 66c0dabab5e (reftable: make reftable_record a tagged union, 2022-01-20) to be portable to AIX xlc v12.1: avar@gcc111:[/home/avar]xlc -qversion IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72) Version: 12.01.0000.0000 The error emitted before this was e.g.: "reftable/generic.c", line 133.26: 1506-196 (S) Initialization between types "char*" and "struct reftable_ref_record" is not allowed. The syntax in the pre-image is supported by e.g. xlc 13.01 on a newer AIX version: avar@gcc119:[/home/avar]xlc -qversion IBM XL C/C++ for AIX, V13.1.3 (5725-C72, 5765-J07) Version: 13.01.0003.0006 But as we've otherwise supported this compiler let's not break it entirely if it's easy to work around it. Suggested-by: René Scharfe <l.s.r@web.de> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-28docs: mention --refetch fetch optionLibravatar Robert Coup2-2/+7
Document it for partial clones as a means to apply a new filter, and reference it from the remote.<name>.partialclonefilter config parameter. Signed-off-by: Robert Coup <robert@coup.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-28fetch: after refetch, encourage auto gc repackingLibravatar Robert Coup3-2/+49
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 --refetchLibravatar Robert Coup1-1/+51
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-28fetch: add --refetch optionLibravatar Robert Coup5-1/+34
Teach fetch and transports the --refetch option to force a full fetch without negotiating common commits with the remote. Use when applying a new partial clone filter to refetch all matching objects. Signed-off-by: Robert Coup <robert@coup.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-28builtin/fetch-pack: add --refetch optionLibravatar Robert Coup3-0/+14
Add a refetch option to fetch-pack to force a full fetch. Use when applying a new partial clone filter to refetch all matching objects. Signed-off-by: Robert Coup <robert@coup.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-28fetch-pack: add refetchLibravatar Robert Coup2-17/+30
Allow a "refetch" where the contents of the local object store are ignored and a full fetch is performed, not attempting to find or negotiate common commits with the remote. A key use case is to apply a new partial clone blob/tree filter and refetch all the associated matching content, which would otherwise not be transferred when the commit objects are already present locally. Signed-off-by: Robert Coup <robert@coup.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-28fetch-negotiator: add specific noop initializerLibravatar Robert Coup2-0/+13
Add a specific initializer for the noop fetch negotiator. This is introduced to support allowing partial clones to skip commit negotiation when performing a "refetch". Signed-off-by: Robert Coup <robert@coup.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-28pack-objects: lazily set up "struct rev_info", don't leakLibravatar Ævar Arnfjörð Bjarmason3-8/+48
In the preceding [1] (pack-objects: move revs out of get_object_list(), 2022-03-22) the "repo_init_revisions()" was moved to cmd_pack_objects() so that it unconditionally took place for all invocations of "git pack-objects". We'd thus start leaking memory, which is easily reproduced in e.g. git.git by feeding e83c5163316 (Initial revision of "git", the information manager from hell, 2005-04-07) to "git pack-objects"; $ echo e83c5163316f89bfbde7d9ab23ca2e25604af290 | ./git pack-objects initial [...] ==19130==ERROR: LeakSanitizer: detected memory leaks Direct leak of 7120 byte(s) in 1 object(s) allocated from: #0 0x455308 in __interceptor_malloc (/home/avar/g/git/git+0x455308) #1 0x75b399 in do_xmalloc /home/avar/g/git/wrapper.c:41:8 #2 0x75b356 in xmalloc /home/avar/g/git/wrapper.c:62:9 #3 0x5d7609 in prep_parse_options /home/avar/g/git/diff.c:5647:2 #4 0x5d415a in repo_diff_setup /home/avar/g/git/diff.c:4621:2 #5 0x6dffbb in repo_init_revisions /home/avar/g/git/revision.c:1853:2 #6 0x4f599d in cmd_pack_objects /home/avar/g/git/builtin/pack-objects.c:3980:2 #7 0x4592ca in run_builtin /home/avar/g/git/git.c:465:11 #8 0x457d81 in handle_builtin /home/avar/g/git/git.c:718:3 #9 0x458ca5 in run_argv /home/avar/g/git/git.c:785:4 #10 0x457b40 in cmd_main /home/avar/g/git/git.c:916:19 #11 0x562259 in main /home/avar/g/git/common-main.c:56:11 #12 0x7fce792ac7ec in __libc_start_main csu/../csu/libc-start.c:332:16 #13 0x4300f9 in _start (/home/avar/g/git/git+0x4300f9) SUMMARY: LeakSanitizer: 7120 byte(s) leaked in 1 allocation(s). Aborted Narrowly fixing that commit would have been easy, just add call repo_init_revisions() right before get_object_list(), which is effectively what was done before that commit. But an unstated constraint when setting it up early is that it was needed for the subsequent [2] (pack-objects: parse --filter directly into revs.filter, 2022-03-22), i.e. we might have a --filter command-line option, and need to either have the "struct rev_info" setup when we encounter that option, or later. Let's just change the control flow so that we'll instead set up the "struct rev_info" only when we need it. Doing so leads to a bit more verbosity, but it's a lot clearer what we're doing and why. An earlier version of this commit[3] went behind opt_parse_list_objects_filter()'s back by faking up a "struct option" before calling it. Let's avoid that and instead create a blessed API for this pattern. We could furthermore combine the two get_object_list() invocations here by having repo_init_revisions() invoked on &pfd.revs, but I think clearly separating the two makes the flow clearer. Likewise redundantly but explicitly (i.e. redundant v.s. a "{ 0 }") "0" to "have_revs" early in cmd_pack_objects(). While we're at it add parentheses around the arguments to the OPT_* macros in in list-objects-filter-options.h, as we need to change those lines anyway. It doesn't matter in this case, but is good general practice. 1. https://lore.kernel.org/git/619b757d98465dbc4995bdc11a5282fbfcbd3daa.1647970119.git.gitgitgadget@gmail.com 2. https://lore.kernel.org/git/97de926904988b89b5663bd4c59c011a1723a8f5.1647970119.git.gitgitgadget@gmail.com 3. https://lore.kernel.org/git/patch-1.1-193534b0f07-20220325T121715Z-avarab@gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-25The 15th batchLibravatar Junio C Hamano1-0/+12
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-25Merge branch 'gc/recursive-fetch-with-unused-submodules'Libravatar Junio C Hamano6-312/+761
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-25Merge branch 'ps/fsync-refs'Libravatar Junio C Hamano5-3/+10
Updates to refs traditionally weren't fsync'ed, but we can configure using core.fsync variable to do so. * ps/fsync-refs: core.fsync: new option to harden references
2022-03-25Merge branch 'ns/core-fsyncmethod'Libravatar Junio C Hamano26-60/+444
Replace core.fsyncObjectFiles with two new configuration variables, core.fsync and core.fsyncMethod. * ns/core-fsyncmethod: core.fsync: documentation and user-friendly aggregate options core.fsync: new option to harden the index core.fsync: add configuration parsing core.fsync: introduce granular fsync control infrastructure core.fsyncmethod: add writeout-only mode wrapper: make inclusion of Windows csprng header tightly scoped
2022-03-25t7527: test status with untracked-cache and fsmonitor--daemonLibravatar Jeff Hostetler1-0/+115
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-25fsmonitor: force update index after large responsesLibravatar Jeff Hostetler1-1/+54
Measure the time taken to apply the FSMonitor query result to the index and the untracked-cache. Set the `FSMONITOR_CHANGED` bit on `istate->cache_changed` when FSMonitor returns a very large repsonse to ensure that the index is written to disk. Normally, when the FSMonitor response includes a tracked file, the index is always updated. Similarly, the index might be updated when the response alters the untracked-cache (when enabled). However, in cases where neither of those cause the index to be considered changed, the FSMonitor response is wasted. Subsequent Git commands will make requests with the same token and receive the same response. If that response is very large, performance may suffer. It would be more efficient to force update the index now (and the token in the index extension) in order to reduce the size of the response received by future commands. This was observed on Windows after a large checkout. On Windows, the kernel emits events for the files that are changed as they are changed. However, it might delay events for the containing directories until the system is more idle (or someone scans the directory (so it seems)). The first status following a checkout would get the list of files. The subsequent status commands would get the list of directories as the events trickled out. But they would never catch up because the token was not advanced because the index wasn't updated. This list of directories caused `wt_status_collect_untracked()` to unnecessarily spend time actually scanning them during each command. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-25fsmonitor--daemon: use a cookie file to sync with file systemLibravatar Jeff Hostetler2-1/+241
Teach fsmonitor--daemon client threads to create a cookie file inside the .git directory and then wait until FS events for the cookie are observed by the FS listener thread. This helps address the racy nature of file system events by blocking the client response until the kernel has drained any event backlog. This is especially important on MacOS where kernel events are only issued with a limited frequency. See the `latency` argument of `FSeventStreamCreate()`. The kernel only signals every `latency` seconds, but does not guarantee that the kernel queue is completely drained, so we may have to wait more than one interval. If we increase the latency, the system is more likely to drop events. We avoid these issues by having each client thread create a unique cookie file and then wait until it is seen in the event stream. Co-authored-by: Kevin Willford <Kevin.Willford@microsoft.com> Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-25fsmonitor--daemon: periodically truncate list of modified filesLibravatar Jeff Hostetler1-0/+88
Teach fsmonitor--daemon to periodically truncate the list of modified files to save some memory. Clients will ask for the set of changes relative to a token that they found in the FSMN index extension in the index. (This token is like a point in time, but different). Clients will then update the index to contain the response token (so that subsequent commands will be relative to this new token). Therefore, the daemon can gradually truncate the in-memory list of changed paths as they become obsolete (older than the previous token). Since we may have multiple clients making concurrent requests with a skew of tokens and clients may be racing to the talk to the daemon, we lazily truncate the list. We introduce a 5 minute delay and truncate batches 5 minutes after they are considered obsolete. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-25t/perf/p7519: add fsmonitor--daemon test casesLibravatar Jeff Hostetler1-4/+34
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-25t/perf/p7519: speed up test on WindowsLibravatar Jeff Hostetler1-8/+16
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-25t/perf/p7519: fix coding styleLibravatar Jeff Hostetler1-4/+4
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-25t/helper/test-chmtime: skip directories on WindowsLibravatar Jeff Hostetler1-0/+15
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-25t/perf: avoid copying builtin fsmonitor files into test repoLibravatar Jeff Hostetler1-1/+1
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-25t7527: create test for fsmonitor--daemonLibravatar Jeff Hostetler1-0/+494
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-25t/helper/fsmonitor-client: create IPC client to talk to FSMonitor DaemonLibravatar Jeff Hostetler4-0/+119
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-25help: include fsmonitor--daemon feature flag in version infoLibravatar Jeff Hostetler2-0/+11
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>