summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2019-04-22Merge branch 'js/spell-out-options-in-tests'Libravatar Junio C Hamano11-43/+66
The tests have been updated not to rely on the abbreviated option names the parse-options API offers, to protect us from an abbreviated form of an option that used to be unique within the command getting non-unique when a new option that share the same prefix is added. * js/spell-out-options-in-tests: tests: disallow the use of abbreviated options (by default) tests (pack-objects): use the full, unabbreviated `--revs` option tests (status): spell out the `--find-renames` option in full tests (push): do not abbreviate the `--follow-tags` option t5531: avoid using an abbreviated option t7810: do not abbreviate `--no-exclude-standard` nor `--invert-match` tests (rebase): spell out the `--force-rebase` option tests (rebase): spell out the `--keep-empty` option
2019-04-22Merge branch 'nd/include-if-wildmatch'Libravatar Junio C Hamano1-0/+13
A buglet in configuration parser has been fixed. * nd/include-if-wildmatch: config: correct '**' matching in includeIf patterns
2019-04-22Merge branch 'tg/stash-in-c-show-default-to-p-fix'Libravatar Junio C Hamano1-0/+18
A regression fix. * tg/stash-in-c-show-default-to-p-fix: stash: setup default diff output format if necessary
2019-04-22Merge branch 'js/stash-in-c-pathspec-fix'Libravatar Junio C Hamano1-0/+6
Further fixes to "git stash" reimplemented in C. * js/stash-in-c-pathspec-fix: stash: pass pathspec as pointer built-in stash: handle :(glob) pathspecs again legacy stash: fix "rudimentary backport of -q"
2019-04-22Merge branch 'ps/stash-in-c'Libravatar Junio C Hamano3-66/+227
"git stash" rewritten in C. * ps/stash-in-c: (28 commits) tests: add a special setup where stash.useBuiltin is off stash: optionally use the scripted version again stash: add back the original, scripted `git stash` stash: convert `stash--helper.c` into `stash.c` stash: replace all `write-tree` child processes with API calls stash: optimize `get_untracked_files()` and `check_changes()` stash: convert save to builtin stash: make push -q quiet stash: convert push to builtin stash: convert create to builtin stash: convert store to builtin stash: convert show to builtin stash: convert list to builtin stash: convert pop to builtin stash: convert branch to builtin stash: convert drop and clear to builtin stash: convert apply to builtin stash: mention options in `show` synopsis stash: add tests for `git stash show` config stash: rename test cases to be more descriptive ...
2019-04-16Merge branch 'sg/t5318-cleanup'Libravatar Junio C Hamano1-1/+1
Code cleanup. * sg/t5318-cleanup: t5318-commit-graph: remove unused variable
2019-04-16Merge branch 'jt/t5551-protocol-v2-does-not-have-half-auth'Libravatar Junio C Hamano1-1/+11
Test update. * jt/t5551-protocol-v2-does-not-have-half-auth: t5551: mark half-auth no-op fetch test as v0-only
2019-04-16Merge branch 'jk/http-walker-status-fix'Libravatar Junio C Hamano1-0/+16
dumb-http walker has been updated to share more error recovery strategy with the normal codepath. * jk/http-walker-status-fix: http: use normalize_curl_result() instead of manual conversion http: normalize curl results for dumb loose and alternates fetches http: factor out curl result code normalization
2019-04-16Merge branch 'jk/refs-double-abort'Libravatar Junio C Hamano1-0/+16
A corner case bug in the refs API has been corrected. * jk/refs-double-abort: refs/files-backend: don't look at an aborted transaction refs/files-backend: handle packed transaction prepare failure
2019-04-16Merge branch 'tz/completion'Libravatar Junio C Hamano1-0/+6
The completion helper code now pays attention to repository-local configuration (when available), which allows --list-cmds to honour a repository specific setting of completion.commands, for example. * tz/completion: completion: use __git when calling --list-cmds completion: fix multiple command removals t9902: test multiple removals via completion.commands git: read local config in --list-cmds
2019-04-16Merge branch 'tz/t4038-bash-redirect-target-workaround'Libravatar Junio C Hamano1-4/+4
Work-around extra warning from bash in our tests. * tz/t4038-bash-redirect-target-workaround: t4038-diff-combined: quote paths with whitespace
2019-04-16Merge branch 'ab/drop-scripted-rebase'Libravatar Junio C Hamano3-10/+19
Retire scripted "git rebase" implementation. * ab/drop-scripted-rebase: rebase: remove the rebase.useBuiltin setting
2019-04-16Merge branch 'jk/perf-lib-tee'Libravatar Junio C Hamano1-23/+11
Code cleanup in the test framework. * jk/perf-lib-tee: perf-lib.sh: rely on test-lib.sh for --tee handling
2019-04-16Merge branch 'nd/checkout-f-while-conflicted-fix'Libravatar Junio C Hamano1-0/+24
"git checkout -f <branch>" while the index has an unmerged path incorrectly left some paths in an unmerged state, which has been corrected. * nd/checkout-f-while-conflicted-fix: unpack-trees: fix oneway_merge accidentally carry over stage index
2019-04-16Merge branch 'jc/format-patch-error-check'Libravatar Junio C Hamano1-0/+6
"git format-patch" used overwrite an existing patch/cover-letter file. A new "--no-clobber" option stops it. * jc/format-patch-error-check: format-patch: notice failure to open cover letter for writing builtin/log: downcase the beginning of error messages
2019-04-16Merge branch 'js/get-short-oid-drop-cache'Libravatar Junio C Hamano1-0/+22
A corner-case object name ambiguity while the sequencer machinery is working (e.g. "rebase -i -x") has been (half) fixed. * js/get-short-oid-drop-cache: get_oid(): when an object was not found, try harder sequencer: move stale comment into correct location sequencer: improve error message when an OID could not be parsed rebase -i: demonstrate obscure loose object cache bug
2019-04-16Merge branch 'js/init-db-update-for-mingw'Libravatar Junio C Hamano1-0/+11
"git init" forgot to read platform-specific repository configuration, which made Windows port to ignore settings of core.hidedotfiles, for example. * js/init-db-update-for-mingw: mingw: respect core.hidedotfiles = false in git-init again
2019-04-16Merge branch 'jt/test-protocol-version'Libravatar Junio C Hamano14-37/+113
Help developers by making it easier to run most of the tests under different versions of over-the-wire protocols. * jt/test-protocol-version: t5552: compensate for v2 filtering ref adv. tests: fix protocol version for overspecifications t5700: only run with protocol version 1 t5512: compensate for v0 only sending HEAD symrefs t5503: fix overspecification of trace expectation tests: always test fetch of unreachable with v0 t5601: check ssh command only with protocol v0 tests: define GIT_TEST_PROTOCOL_VERSION
2019-04-15tests: disallow the use of abbreviated options (by default)Libravatar Johannes Schindelin3-1/+24
Git's command-line parsers support uniquely abbreviated options, e.g. `git init --ba` would automatically expand `--ba` to `--bare`. This is a very convenient feature in every day life for Git users, in particular when tab completion is not available. However, it is not a good idea to rely on that in Git's test suite, as something that is a unique abbreviation of a command line option today might no longer be a unique abbreviation tomorrow. For example, if a future contribution added a new mode `git init --babyproofing` and a previously-introduced test case used the fact that `git init --ba` expanded to `git init --bare`, that future contribution would now have to touch seemingly unrelated tests just to keep the test suite from failing. So let's disallow abbreviated options in the test suite by default. Note: for ease of implementation, this patch really only touches the `parse-options` machinery: more and more hand-rolled option parsers are converted to use that internal API, and more and more scripts are converted to built-ins (naturally using the parse-options API, too), so in practice this catches most issues, and is definitely the biggest bang for the buck. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-10Merge branch 'ar/t4150-remove-cruft'Libravatar Junio C Hamano1-3/+1
Test cleanup. * ar/t4150-remove-cruft: t4150: remove unused variable
2019-04-10Merge branch 'jk/line-log-with-patch'Libravatar Junio C Hamano1-0/+17
"git log -L<from>,<to>:<path>" with "-s" did not suppress the patch output as it should. This has been corrected. * jk/line-log-with-patch: line-log: detect unsupported formats line-log: suppress diff output with "-s"
2019-04-10Merge branch 'ra/t3600-test-path-funcs'Libravatar Junio C Hamano2-171/+187
A GSoC micro. * ra/t3600-test-path-funcs: t3600: use helpers to replace test -d/f/e/s <path> t3600: modernize style test functions: add function `test_file_not_empty`
2019-04-10Merge branch 'nd/rewritten-ref-is-per-worktree'Libravatar Junio C Hamano1-0/+35
"git rebase" uses the refs/rewritten/ hierarchy to store its intermediate states, which inherently makes the hierarchy per worktree, but it didn't quite work well. * nd/rewritten-ref-is-per-worktree: Make sure refs/rewritten/ is per-worktree files-backend.c: reduce duplication in add_per_worktree_entries_to_dir() files-backend.c: factor out per-worktree code in loose_fill_ref_dir()
2019-04-02tests (pack-objects): use the full, unabbreviated `--revs` optionLibravatar Johannes Schindelin1-22/+22
To use the singular form of a word, when the option wants the plural form (and quietly expands it because it thinks it was abbreviated), is an easy mistake to make, and t5317 contains almost two dozen of them. However, using abbreviated options in tests is a bit fragile, so we will disallow use of abbreviated options in our test suite. In preparation for this change, let's fix `t5317-pack-objects-filter-objects.sh`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-02tests (status): spell out the `--find-renames` option in fullLibravatar Johannes Schindelin1-4/+4
To avoid future ambiguities, we really want to use full option names in the test suite. `t7525-status-rename.sh` used an abbreviated form of the `--find-renames` option, though, so let's change that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-02tests (push): do not abbreviate the `--follow-tags` optionLibravatar Johannes Schindelin1-2/+2
We really want to spell out the option in the full form, to avoid any ambiguity that might be introduced by future patches. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-02t5531: avoid using an abbreviated optionLibravatar Johannes Schindelin1-1/+1
It was probably just an oversight: the `--recurse-submodules` option puts the term "submodules" in the plural form, not the singular one. To avoid future problems in case that another option is introduced that starts with the prefix `--recurse-submodule`, let's just fix this. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-02t7810: do not abbreviate `--no-exclude-standard` nor `--invert-match`Libravatar Johannes Schindelin1-8/+8
This script used abbreviated options, which is unnecessarily fragile. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-02tests (rebase): spell out the `--force-rebase` optionLibravatar Johannes Schindelin2-3/+3
In quite a few test cases, we were sloppy and used the abbreviation `--force`, but we really should be precise in what we want to test. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-02tests (rebase): spell out the `--keep-empty` optionLibravatar Johannes Schindelin1-2/+2
This test wants to run `git rebase` with the `--keep-empty` option, but it really only spelled out `--keep` and trusted Git's option parsing to determine that this was a unique abbreviation of the real option. However, Denton Liu contributed a patch series in https://public-inbox.org/git/cover.1553354374.git.liu.denton@gmail.com/ that introduces a new `git rebase` option called `--keep-base`, which makes this previously unique abbreviation non-unique. Whether this patch series is accepted or not, it is actually a bad practice to use abbreviated options in our test suite, because of the issue that those unique option names are not guaranteed to stay unique in the future. So let's just not use abbreviated options in the test suite. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-01config: correct '**' matching in includeIf patternsLibravatar Nguyễn Thái Ngọc Duy1-0/+13
The current wildmatch() call for includeIf's gitdir pattern does not pass the WM_PATHNAME flag. Without this flag, '*' is treated _almost_ the same as '**' (because '*' also matches slashes) with one exception: '/**/' can match a single slash. The pattern 'foo/**/bar' matches 'foo/bar'. But '/*/', which is essentially what wildmatch engine sees without WM_PATHNAME, has to match two slashes (and '*' matches nothing). Which means 'foo/*/bar' cannot match 'foo/bar'. It can only match 'foo//bar'. The result of this is the current wildmatch() call works most of the time until the user depends on '/**/' matching no path component. And also '*' matches slashes while it should not, but people probably haven't noticed this yet. The fix is straightforward. Reported-by: Jason Karns <jason.karns@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-24t5318-commit-graph: remove unused variableLibravatar SZEDER Gábor1-1/+1
This is a remnant from early versions of the commit-graph patch series [1], when 'git commit-graph --write' printed the hash of the created commit-graph file, and tests did look at the command's output, because the commit-graph file's name included that hash as well. [1] https://public-inbox.org/git/1517348383-112294-6-git-send-email-dstolee@microsoft.com/ Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-24t5551: mark half-auth no-op fetch test as v0-onlyLibravatar Jonathan Tan1-1/+11
When using protocol v0, upload-pack over HTTP permits a "half-auth" configuration in which, at the web server layer, the info/refs path is not protected by authentication but the git-upload-pack path is, so that a user can perform fetches that do not download any objects without authentication, but still needs authentication to download objects. But protocol v2 does not support this, because both ref and pack are obtained from the git-upload-pack path. Mark the test verifying this behavior as protocol v0-only, with a description of what needs to be done to make v2 support this. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-24http: normalize curl results for dumb loose and alternates fetchesLibravatar Jeff King1-0/+16
If the dumb-http walker encounters a 404 when fetching a loose object, it then looks at any http-alternates for the object. The 404 check is implemented by missing_target(), which checks not only the http code, but also that we got an http error from the CURLcode. That broke when we stopped using CURLOPT_FAILONERROR in 17966c0a63 (http: avoid disconnecting on 404s for loose objects, 2016-07-11), since our CURLcode will now be CURLE_OK. As a result, fetching over dumb-http from a repository with alternates could result in Git printing "Unable to find abcd1234..." and aborting. We could probably fix this just by loosening missing_target(). However, there's other code which looks at the curl result, and it would have to be tweaked as well. Instead, let's just normalize the result the same way the smart-http code does. There's a similar case in processing the alternates (where we failover from "info/http-alternates" to "info/alternates"). We'll give it the same treatment. After this patch, we should be hitting all code paths that need this normalization (notably absent here is the http_pack_request path, but it does not use FAILONERROR, nor missing_target()). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-22refs/files-backend: handle packed transaction prepare failureLibravatar Jeff King1-0/+16
In files_transaction_prepare(), if we have to delete some refs, we use a subordinate packed_transaction to do so. It's rare for that sub-transaction's prepare step to fail, since we hold the packed-refs lock. But if it does, we trigger a BUG() due to these steps: - we've attached the packed transaction to the files transaction as backend_data->packed_transaction - when the prepare step fails, the packed transaction cleans itself up, putting itself into the CLOSED state - the error value from preparing the packed transaction lets us know in files_transaction_prepare() that we should also clean up and return an error. We call files_transaction_cleanup(), which tries to abort backend_data->packed_transaction. Since it's already CLOSED, that triggers an assertion in ref_transaction_abort(). We can fix that by disconnecting the packed transaction from the outer files transaction, and then free-ing (not aborting!) it ourselves. A few other options/alternatives I considered: - we could just make it a noop to abort a CLOSED transaction. But that seems less safe, since clearly this code expects (and enforces) a particular set of state transitions. - we could have files_transaction_cleanup() selectively call abort() vs free() based on the state of the on the packed transaction. That's basically a more restricted version of the above, but also potentially unsafe. - instead of disconnecting backend_data->packed_transaction on error, we could wait to install it until we successfully prepare. That might make the flow a little simpler, but it introduces a hassle. Earlier parts of files_transaction_prepare() that encounter an error will jump to the cleanup label, and expect that cleaning up the outer transaction will clean up the packed transaction, too. We'd have to adjust those sites to clean up the packed transaction. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21unpack-trees: fix oneway_merge accidentally carry over stage indexLibravatar Nguyễn Thái Ngọc Duy1-0/+24
Phillip found out that 'git checkout -f <branch>' does not restore conflict/unmerged files correctly. All tracked files should be taken from <branch> and all non-zero stages removed. Most of this is true, except that the final file could be in stage one instead of zero. "checkout -f" (among other commands) does this with one-way merge, which is supposed to take stat info from the index and everything else from the given tree. The add_entry(.., old, ...) call in oneway_merge() though will keep stage index from the index. This is normally not a problem if the entry from the index is normal (stage #0). But if there is a conflict, stage #0 does not exist and we'll get stage #1 entry as "old" variable, which gets recorded in the final index. Fix it by clearing stage mask. This bug probably comes from b5b425074e (git-read-tree: make one-way merge also honor the "update" flag, 2005-06-07). Before this commit, we may create the final ("dst") index entry from the one in index, but we do clear CE_STAGEMASK. I briefly checked two- and three-way merge functions. I think we don't have the same problem in those. Reported-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21completion: fix multiple command removalsLibravatar Jeff King1-1/+1
Commit 6532f3740b ("completion: allow to customize the completable command list", 2018-05-20) tried to allow multiple space-separated entries in completion.commands. To do this, it copies each parsed token into a strbuf so that the result is NUL-terminated. However, for tokens starting with "-", it accidentally passes the original non-terminated string, meaning that only the final one worked. Switch to using the strbuf. Reported-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21t9902: test multiple removals via completion.commandsLibravatar Todd Zullinger1-0/+6
6532f3740b ("completion: allow to customize the completable command list", 2018-05-20) added the completion.commands config variable. Multiple commands may be added or removed, separated by a space. Demonstrate the failure of multiple removals. Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-21stash: setup default diff output format if necessaryLibravatar Thomas Gummerer1-0/+18
In the scripted 'git stash show' when no arguments are passed, we just pass '--stat' to 'git diff'. When any argument is passed to 'stash show', we no longer pass '--stat' to 'git diff', and pass whatever flags are passed directly through to 'git diff'. By default 'git diff' shows the patch output. So when a user uses 'git stash show --patience', they would be shown the diff as expected, using the patience algorithm. '--patience' in this case only changes the diff algorithm, but does not cause 'git diff' to show the diff by itself. The diff is shown because that's the default behaviour of 'git diff'. In the C version of 'git stash show', we try to emulate that behaviour using the internal diff API. However we forgot to set up the default output format, in case it wasn't set by any of the flags that were passed through. So 'git stash show --patience' in the builtin version of stash would be completely silent, while it would show the diff in the scripted version. The same thing would happen for other flags that only affect the way a patch is displayed, rather than switching to a different output format than the default one. Fix this by setting up the default output format for 'git diff'. Reported-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-20Merge branch 'jk/virtual-objects-do-exist'Libravatar Junio C Hamano1-0/+10
A recent update broke "is this object available to us?" check for well-known objects like an empty tree (which should yield "yes", even when there is no on-disk object for an empty tree), which has been corrected. * jk/virtual-objects-do-exist: rev-list: allow cached objects in existence check
2019-03-20Merge branch 'jk/fsck-doc'Libravatar Junio C Hamano1-2/+17
"git fsck --connectivity-only" omits computation necessary to sift the objects that are not reachable from any of the refs into unreachable and dangling. This is now enabled when dangling objects are requested (which is done by default, but can be overridden with the "--no-dangling" option). * jk/fsck-doc: fsck: always compute USED flags for unreachable objects doc/fsck: clarify --connectivity-only behavior
2019-03-20Merge branch 'js/stress-test-ui-tweak'Libravatar Junio C Hamano2-4/+13
Dev support. * js/stress-test-ui-tweak: tests: introduce --stress-jobs=<N> tests: let --stress-limit=<N> imply --stress
2019-03-20Merge branch 'js/rebase-orig-head-fix'Libravatar Junio C Hamano1-0/+8
"git rebase" that was reimplemented in C did not set ORIG_HEAD correctly, which has been corrected. * js/rebase-orig-head-fix: built-in rebase: set ORIG_HEAD just once, before the rebase built-in rebase: demonstrate that ORIG_HEAD is not set correctly built-in rebase: use the correct reflog when switching branches built-in rebase: no need to check out `onto` twice
2019-03-20Merge branch 'jk/bisect-final-output'Libravatar Junio C Hamano1-3/+3
The final report from "git bisect" used to show the suspected culprit using a raw "diff-tree", with which there is no output for a merge commit. This has been updated to use a more modern and human readable output that still is concise enough. * jk/bisect-final-output: bisect: make diff-tree output prettier bisect: fix internal diff-tree config loading bisect: use string arguments to feed internal diff-tree
2019-03-20rebase: remove the rebase.useBuiltin settingLibravatar Ævar Arnfjörð Bjarmason3-10/+19
Remove the rebase.useBuiltin setting, which was added as an escape hatch to disable the builtin version of rebase first released with Git 2.20. See [1] for the initial implementation of rebase.useBuiltin, and [2] and [3] for the documentation and corresponding GIT_TEST_REBASE_USE_BUILTIN option. Carrying the legacy version is a maintenance burden as seen in 7e097e27d3 ("legacy-rebase: backport -C<n> and --whitespace=<option> checks", 2018-11-20) and 9aea5e9286 ("rebase: fix regression in rebase.useBuiltin=false test mode", 2019-02-13). Since the built-in version has been shown to be stable enough let's remove the legacy version. As noted in [3] having use_builtin_rebase() shell out to get its config doesn't make any sense anymore, that was done for the purposes of spawning the legacy rebase without having modified any global state. Let's instead handle this case in rebase_config(). There's still a bunch of references to git-legacy-rebase in po/*.po, but those will be dealt with in time by the i18n effort. Even though this configuration variable only existed two releases let's not entirely delete the entry from the docs, but note its absence. Individual versions of git tend to be around for a while due to distro packaging timelines, so e.g. if we're "lucky" a given version like 2.21 might be installed on say OSX for half a decade. That'll mean some people probably setting this in config, and then when they later wonder if it's needed they can Google search the config option name or check it in git-config. It also allows us to refer to the docs from the warning for details. 1. 55071ea248 ("rebase: start implementing it as a builtin", 2018-08-07) 2. d8d0a546f0 ("rebase doc: document rebase.useBuiltin", 2018-11-14) 3. 62c23938fa ("tests: add a special setup where rebase.useBuiltin is off", 2018-11-14) 3. https://public-inbox.org/git/nycvar.QRO.7.76.6.1903141544110.41@tvgsbejvaqbjf.bet/ Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-18t4038-diff-combined: quote paths with whitespaceLibravatar Todd Zullinger1-4/+4
d76ce4f734 ("log,diff-tree: add --combined-all-paths option", 2019-02-07) added tests for files containing tabs. When the tests are run with bash, the lack of quoting during the file setup causes 'ambiguous redirect' errors. Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-18perf-lib.sh: rely on test-lib.sh for --tee handlingLibravatar Jeff King1-23/+11
Since its inception, the perf-lib.sh script has manually handled the "--tee" option (and other options which imply it, like "--valgrind") with a cut-and-pasted block from test-lib.sh. That block has grown stale over the years, and has at least three problems: 1. It uses $SHELL to re-exec the script, whereas the version in test-lib.sh learned to use $TEST_SHELL_PATH. 2. It does an ad-hoc search of the "$*" string, whereas test-lib.sh learned to carefully parse the arguments left to right. 3. It never learned about --verbose-log (which also implies --tee), so it would not trigger for that option. This last one was especially annoying, because t/perf/run uses the GIT_TEST_OPTS from your config.mak to run the perf scripts. So if you've set, say, "-x --verbose-log" there, it will be passed as part of most perf runs. And while this script doesn't recognize the option, the test-lib.sh that we source _does_, and the behavior ends up being much more annoying: - as the comment at the top of the block says, we have to run this tee code early, before we start munging variables (it says GIT_BUILD_DIR, but the problematic variable is actually GIT_TEST_INSTALLED). - since we don't recognize --verbose-log, we don't trigger the block. We go on to munge GIT_TEST_INSTALLED, converting it from a relative to an absolute path. - then we source test-lib.sh, which _does_ recognize --verbose-log. It re-execs the script, which runs again. But this time with an absolute version of GIT_TEST_INSTALLED. - As a result, we copy the absolute version of GIT_TEST_INSTALLED into perf_results_prefix. Instead of writing our results to the expected "test-results/build_1234abcd.p1234-whatever.times", we instead write them to "test-results/_full_path_to_repo_t_perf_build_1234...". The aggregate.perl script doesn't expect this, and so it prints "<missing>" for each result (even though it spent considerable time running the tests!). We can solve all of these in one blow by just deleting our custom handling, and relying on the inclusion of test-lib.sh to handle --tee, --verbose-log, etc. There's one catch, though. We want to handle GIT_TEST_INSTALLED after we've included test-lib.sh, since we want it un-munged in the re-exec'd version of the script. But if we want to convert it from a relative to an absolute path, we must do so before we load test-lib.sh, since it will change our working directory. So we compute the absolute directory first, store it away, then include test-lib.sh, and finally assign to GIT_TEST_INSTALLED as appropriate. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-14get_oid(): when an object was not found, try harderLibravatar Johannes Schindelin1-1/+1
It is quite possible that the loose object cache gets stale when new objects are written. In that case, get_oid() would potentially say that it cannot find a given object, even if it should find it. Let's blow away the loose object cache as well as the read packs and try again in that case. Note: this does *not* affect the code path that was introduced to help avoid looking for the same non-existing objects (which made some operations really expensive via NFS): that code path is handled by the `OBJECT_INFO_QUICK` flag (which does not even apply to `get_oid()`, which has no equivalent flag, at least at the time this patch was written). This incidentally fixes the problem identified earlier where an interactive rebase wanted to re-read (and validate) the todo list after an `exec` command modified it. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-14rebase -i: demonstrate obscure loose object cache bugLibravatar Johannes Schindelin1-0/+22
We specifically support `exec` commands in `git rebase -i`'s todo lists to rewrite the very same todo list. Of course, we need to validate that todo list when re-reading it. It is also totally legitimate to extend the todo list by `pick` lines using short names of commits that were created only after the rebase started. And this is where the loose object cache interferes with this feature: if *some* loose object was read whose hash shares the same first two digits with a commit that was not yet created when that loose object was created, then we fail to find that new commit by its short name in `get_oid()`, and the interactive rebase fails with an obscure error message like: error: invalid line 1: pick 6568fef error: please fix this using 'git rebase --edit-todo'. Let's first demonstrate that this is actually a bug in a new regression test, in a separate commit so that other developers who do not believe me can cherry-pick it to confirm the problem. This new regression test generates two commits whose hashes share the first two hex digits (so that their corresponding loose objects live in the same subdirectory of .git/objects/, and are therefore supposed to be in the same loose object cache bin). It then picks the first, to make sure that the loose object cache is initialized and cached that object directory, then generates the second commit and picks it, too. Since the commit was generated in a different process than the sequencer that wants to pick it, the loose object cache had no chance of being updated in the meantime. Technically, we would need only one `exec` command in this regression test case, but for ease of implementation, it uses a pseudo-recursive call to the same script. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-13t4150: remove unused variableLibravatar Andrei Rybak1-3/+1
In commit 735285b403 ("am: fix signoff when other trailers are present", 2017-08-08) tests using variable $signoff were rewritten and it is no longer used, so just remove it from the test setup. Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>