summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-12-04t7700: make references to SHA-1 genericLibravatar Denton Liu1-19/+19
Make the test more hash-agnostic by renaming variables from "sha1" to some variation of "oid" or "packid". Also, replace the regex, `[0-9a-f]\{40\}` with `$OID_REGEX`. A better name for "incrpackid" (incremental pack-id) might have been just "packid". However, later in the test suite, we have other uses of "packid". Although the scopes of these variables don't conflict, a future developer may think that commit_and_pack() and test_has_duplicate_object() are semantically related somehow since they share the same variable name. Give them distinct names so that it's clear these uses are unrelated. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-04t7700: replace egrep with grepLibravatar Denton Liu1-3/+3
The egrep expressions in this test suite were of the form `^$variable`. Although egrep works just fine, it's overkill since we're not using any extended regex. Replace egrep invocations with grep so that we aren't swatting flies with a sledgehammer. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-04t7700: consolidate code into test_has_duplicate_object()Libravatar Denton Liu1-48/+23
The code to test that objects were not duplicated from the packfile was duplicated many times. Extract the duplicated code into test_has_duplicate_object() and use that instead. Refactor the resulting extraction so that if the git command fails, the return code is not silently lost. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-04t7700: consolidate code into test_no_missing_in_packs()Libravatar Denton Liu1-40/+15
The code to test that objects were not missing from the packfile was duplicated many times. Extract the duplicated code into test_no_missing_in_packs() and use that instead. Refactor the resulting extraction so that if any git commands fail, their return codes are not silently lost. Instead of verifying each file of `alt_objects/pack/*.idx` individually in a for-loop, batch them together into one verification step. The original testing construct was O(n^2): it used a grep in a loop to test whether any objects were missing in the packfile. Rewrite this to extract the hash using sed or cut, sort the files, then use `comm -23` so that finding missing lines from the original file is done more efficiently. While we're at it, add a space to `commit_and_pack ()` for style. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t7700: s/test -f/test_path_is_file/Libravatar Denton Liu1-4/+4
Since we have debugging-friendly alternatives to `test -f`, replace instances of `test -f` with `test_path_is_file` so that if a command ever fails, we get better debugging information. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t7700: move keywords onto their own lineLibravatar Denton Liu1-17/+34
The code style for tests is to have statements on their own line if possible. Move keywords onto their own line so that they conform with the test style. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t7700: remove spaces after redirect operatorsLibravatar Denton Liu1-9/+9
For shell scripts, the usual convention is for there to be no space after redirection operators, (e.g. `>file`, not `> file`). Remove these spaces wherever they appear. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t7700: drop redirections to /dev/nullLibravatar Denton Liu1-3/+3
Since output is silenced when running without `-v` and debugging output is useful with `-v`, remove redirections to /dev/null as it is not useful. In one case where the output of stdout is consumed, redirect the output of test_commit to stderr. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t7501: stop losing return codes of git commandsLibravatar Denton Liu1-30/+39
In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream so that we will know if a command fails. In the 'interactive add' test case, we prepend a `test_must_fail` to `git commit --interactive`. When there are no changes to commit, `git commit` will exit with status code 1. Following along with the rest of the file, we use `test_must_fail` to test for this case. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t7501: remove spaces after redirect operatorsLibravatar Denton Liu1-11/+11
For shell scripts, the usual convention is for there to be no space after redirection operators, (e.g. `>file`, not `> file`). Remove these spaces wherever they appear. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t5703: stop losing return codes of git commandsLibravatar Denton Liu1-17/+29
Currently, there are two ways where the return codes of git commands are lost. The first way is when a command is in the upstream of a pipe. In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream. The other way is when a command is in a non-assignment command substitution. The return code will be lost in favour of the surrounding command's. Rewrite instances of this such that git commands are in an assignment-only command substitution. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t5703: simplify one-time-sed generation logicLibravatar Denton Liu1-4/+3
In inconsistency(), we had two `git rev-parse` invocations in the upstream of a pipe within a command substitution. In case this invocation ever failed, its exit code would be swallowed up and we would not know about it. Pull the command substitutions out into variable assignments so that their return codes are not lost. Drop the pipe into `tr` because the $(...) substitution already takes care of stripping out newlines, so the `tr` invocations in the code are superfluous. Finally, given the way the tests actually employ "one-time-sed" via $(cat one-time-sed) in t/lib-httpd/apply-one-time-sed.sh, convert the `printf` into an `echo`. This makes it consistent with the final "server loses a ref - ref in want" test, which does use `echo` rather than `printf`. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t5317: use ! grep to check for no matching linesLibravatar Denton Liu1-18/+3
Several times in t5317, we would use `wc -l` to ensure that a grep result is empty. However, grep already has a way to do that... Its return code! Use `! grep` in the cases where we are ensuring that there are no matching lines. While at it, drop unnecessary invocations of `awk` and `sort` in each affected test since those commands do not influence the outcome. It's not clear why that extra work was being done in the first place, and the code's history doesn't shed any light on the matter since these tests were simply born this way[1], likely due to copy-paste programming. The unnecessary work wasn't noticed even when the code was later touched for various cleanups[2][3]. [1]: 9535ce7337 (pack-objects: add list-objects filtering, 2017-11-21) [2]: bdbc17e86a (tests: standardize pipe placement, 2018-10-05) [3]: 61de0ff695 (tests: don't swallow Git errors upstream of pipes, 2018-10-05) Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t5317: stop losing return codes of git commandsLibravatar Denton Liu1-6/+7
Currently, there are two ways where the return codes of git commands are lost. The first way is when a command is in the upstream of a pipe. In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream. The other way is when a command is in a non-assignment command substitution. The return code will be lost in favour of the surrounding command's. Rewrite instances of this such that git commands output to a file and surrounding commands only call command substitutions with non-git commands. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t4138: stop losing return codes of git commandsLibravatar Denton Liu1-8/+8
In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream so that we will know if a command fails. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t4015: use test_write_lines()Libravatar Denton Liu1-2/+2
Instead of rolling our own method to write out some lines into a file, use the existing test_write_lines(). Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t4015: stop losing return codes of git commandsLibravatar Denton Liu1-47/+72
Currently, there are two ways where the return codes of git commands are lost. The first way is when a command is in the upstream of a pipe. In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream. The other way is when a command is in a non-assignment command substitution. The return code will be lost in favour of the surrounding command's. Rewrite instances of this so that git commands are either run on their own or in an assignment-only command substitution. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t3600: comment on inducing SIGPIPE in `git rm`Libravatar Denton Liu1-0/+1
Add a comment about intentionally inducing SIGPIPE since this is unusual and future developers should be aware. Also, even though we are trying to refactor git commands out of the upstream of pipes, we cannot do it here since we rely on it being upstream to induce SIGPIPE. Comment on that as well so that future developers do not try to change it. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t3600: stop losing return codes of git commandsLibravatar Denton Liu1-2/+4
When a command is in a non-assignment command substitution, the return code will be lost in favour of the surrounding command's. As a result, if a git command fails, we won't know about it. Rewrite instances of this so that git commands are either run in an assignment-only command substitution so that their return codes aren't lost. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t3600: use test_line_count() where possibleLibravatar Denton Liu1-3/+4
Since we have a helper function that can test the number of lines in a file that gives better debugging information on failure, use test_line_count() to test the number of lines. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t3301: stop losing return codes of git commandsLibravatar Denton Liu1-67/+163
Currently, there are two ways where the return codes of git commands are lost. The first way is when a command is in the upstream of a pipe. In a pipe, only the return code of the last command is used. Thus, all other commands will have their return codes masked. Rewrite pipes so that there are no git commands upstream. The other way is when a command is in a non-assignment command substitution. The return code will be lost in favour of the surrounding command's. Rewrite instances of this so that git commands are either run on their own or in an assignment-only command substitution. This patch fixes a real buggy test: in 'copy note with "git notes copy"', `git notes` was mistyped as `git note`. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t0090: stop losing return codes of git commandsLibravatar Denton Liu1-2/+3
In generate_expected_cache_tree_rec(), there are currently two instances of `git ls-files` in the upstream of a pipe. In the case where the upstream git command fails, its return code will be lost. Extract the `git ls-files` into its own call so that if it ever fails, its return code is not lost. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29t0014: remove git command upstream of pipeLibravatar Denton Liu1-2/+2
Before, the `git frotz` command would fail but its return code was hidden since it was in the upstream of a pipe. Break the pipeline into two commands so that the return code is no longer lost. Also, mark `git frotz` with test_must_fail since it's supposed to fail. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-29apply-one-time-sed.sh: modernize styleLibravatar Denton Liu1-3/+5
Convert `[ ... ]` to use `test` and test for the existence of a regular file (`-f`) instead of any file (`-e`). Move the `then`s onto their own lines so that it conforms with the general test style. Instead of redirecting input into sed, allow it to open its own input. Use `cmp -s` instead of `diff` since we only care about whether the two files are equal and `diff` is overkill for this. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-21lib-bash.sh: move `then` onto its own lineLibravatar Denton Liu1-2/+4
The code style for tests is to have statements on their own line if possible. Move the `then` onto its own line so that it conforms with the test style. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-10The first batch post 2.24 cycleLibravatar Junio C Hamano3-2/+70
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-10Merge branch 'bc/hash-independent-tests-part-6'Libravatar Junio C Hamano16-155/+277
Test updates to prepare for SHA-2 transition continues. * bc/hash-independent-tests-part-6: t4048: abstract away SHA-1-specific constants t4045: make hash-size independent t4044: update test to work with SHA-256 t4039: abstract away SHA-1-specific constants t4038: abstract away SHA-1 specific constants t4034: abstract away SHA-1-specific constants t4027: make hash-size independent t4015: abstract away SHA-1-specific constants t4011: abstract away SHA-1-specific constants t4010: abstract away SHA-1-specific constants t3429: remove SHA1 annotation t1305: avoid comparing extensions rev-parse: add a --show-object-format option t/oid-info: add empty tree and empty blob values t/oid-info: allow looking up hash algorithm name
2019-11-10Merge branch 'js/update-index-ignore-removal-for-skip-worktree'Libravatar Junio C Hamano6-4/+42
"git stash save" in a working tree that is sparsely checked out mistakenly removed paths that are outside the area of interest. * js/update-index-ignore-removal-for-skip-worktree: stash: handle staged changes in skip-worktree files correctly update-index: optionally leave skip-worktree entries alone
2019-11-10Merge branch 'pb/pretty-email-without-domain-part'Libravatar Junio C Hamano5-62/+111
The custom format for "git log --format=<format>" learned the l/L placeholder that is similar to e/E that fills in the e-mail address, but only the local part on the left side of '@'. * pb/pretty-email-without-domain-part: pretty: add "%aL" etc. to show local-part of email addresses t4203: use test-lib.sh definitions t6006: use test-lib.sh definitions
2019-11-10Merge branch 'hw/remove-api-docs-placeholder'Libravatar Junio C Hamano4-40/+0
Docfix. * hw/remove-api-docs-placeholder: documentation: remove empty doc files
2019-11-10Merge branch 'sg/commit-graph-usage-fix'Libravatar Junio C Hamano1-1/+0
Message fix. * sg/commit-graph-usage-fix: builtin/commit-graph.c: remove subcommand-less usage string
2019-11-10Merge branch 'dl/apply-3way-diff3'Libravatar Junio C Hamano2-27/+30
"git apply --3way" learned to honor merge.conflictStyle configuration variable, like merges would. * dl/apply-3way-diff3: apply: respect merge.conflictStyle in --3way t4108: demonstrate bug in apply t4108: use `test_config` instead of `git config` t4108: remove git command upstream of pipe t4108: replace create_file with test_write_lines
2019-11-10Merge branch 'sg/dir-trie-fixes'Libravatar Junio C Hamano3-60/+74
Code clean-up and a bugfix in the logic used to tell worktree local and repository global refs apart. * sg/dir-trie-fixes: path.c: don't call the match function without value in trie_find() path.c: clarify two field names in 'struct common_dir' path.c: mark 'logs/HEAD' in 'common_list' as file path.c: clarify trie_find()'s in-code comment Documentation: mention more worktree-specific exceptions
2019-11-10Merge branch 'jc/am-show-current-patch-docfix'Libravatar Junio C Hamano1-1/+1
Doc update. * jc/am-show-current-patch-docfix: doc: am --show-current-patch gives an entire e-mail message
2019-11-10Merge branch 'wb/midx-progress'Libravatar Junio C Hamano6-27/+149
The code to generate multi-pack index learned to show (or not to show) progress indicators. * wb/midx-progress: multi-pack-index: add [--[no-]progress] option. midx: honor the MIDX_PROGRESS flag in midx_repack midx: honor the MIDX_PROGRESS flag in verify_midx_file midx: add progress to expire_midx_packs midx: add progress to write_midx_file midx: add MIDX_PROGRESS flag
2019-11-10Merge branch 'en/merge-recursive-directory-rename-fixes'Libravatar Junio C Hamano4-336/+582
When all files from some subdirectory were renamed to the root directory, the directory rename heuristics would fail to detect that as a rename/merge of the subdirectory to the root directory, which has been corrected. * en/merge-recursive-directory-rename-fixes: t604[236]: do not run setup in separate tests merge-recursive: fix merging a subdirectory into the root directory merge-recursive: clean up get_renamed_dir_portion()
2019-11-10Merge branch 'js/rebase-deprecate-preserve-merges'Libravatar Junio C Hamano1-3/+4
"git rebase --preserve-merges" has been marked as deprecated; this release stops advertising it in the "git rebase -h" output. * js/rebase-deprecate-preserve-merges: rebase: hide --preserve-merges option
2019-11-10Merge branch 'hv/bitshift-constants-in-blame'Libravatar Junio C Hamano1-12/+12
Move the definition of a set of bitmask constants from 0ctal literal to (1U<<count) notation. * hv/bitshift-constants-in-blame: builtin/blame.c: constants into bit shift format
2019-11-10Merge branch 'dd/notes-copy-default-dst-to-head'Libravatar Junio C Hamano3-8/+46
"git notes copy $original" ought to copy the notes attached to the original object to HEAD, but a mistaken tightening to command line parameter validation made earlier disabled that feature by mistake. * dd/notes-copy-default-dst-to-head: notes: fix minimum number of parameters to "copy" subcommand t3301: test diagnose messages for too few/many paramters
2019-11-10Merge branch 'pw/post-commit-from-sequencer'Libravatar Junio C Hamano6-265/+432
"rebase -i" ceased to run post-commit hook by mistake in an earlier update, which has been corrected. * pw/post-commit-from-sequencer: sequencer: run post-commit hook move run_commit_hook() to libgit and use it there sequencer.h fix placement of #endif t3404: remove uneeded calls to set_fake_editor t3404: set $EDITOR in subshell t3404: remove unnecessary subshell
2019-11-10Merge branch 'dl/format-patch-cover-from-desc'Libravatar Junio C Hamano5-34/+296
The branch description ("git branch --edit-description") has been used to fill the body of the cover letters by the format-patch command; this has been enhanced so that the subject can also be filled. * dl/format-patch-cover-from-desc: format-patch: teach --cover-from-description option format-patch: use enum variables format-patch: replace erroneous and condition
2019-11-10Merge branch 'es/walken-tutorial'Libravatar Junio C Hamano2-0/+907
A tutorial on object enumeration. * es/walken-tutorial: documentation: add tutorial for object walking
2019-11-10Merge branch 'jt/fetch-pack-record-refs-in-the-dot-promisor'Libravatar Junio C Hamano3-4/+58
Debugging support for lazy cloning has been a bit improved. * jt/fetch-pack-record-refs-in-the-dot-promisor: fetch-pack: write fetched refs to .promisor
2019-11-04Git 2.24Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-11-04Merge branch 'bc/doc-use-docbook-5'Libravatar Junio C Hamano1-1/+2
Finishing touches to the recent update to the build procedure for the documentation. * bc/doc-use-docbook-5: manpage-bold-literal.xsl: match for namespaced "d:literal" in template
2019-11-04Merge branch 'ds/commit-graph-on-fetch'Libravatar Junio C Hamano4-6/+25
Regression fix. * ds/commit-graph-on-fetch: commit-graph: fix writing first commit-graph during fetch t5510-fetch.sh: demonstrate fetch.writeCommitGraph bug
2019-11-04Merge branch 'jt/delay-fetch-if-missing'Libravatar Junio C Hamano1-2/+2
Work-around a lazy fetch glitch. * jt/delay-fetch-if-missing: fetch: delay fetch_if_missing=0 until after config
2019-11-04Merge https://github.com/prati0100/git-guiLibravatar Junio C Hamano4-21/+210
* https://github.com/prati0100/git-gui: git-gui: improve Japanese translation git-gui: add a readme git-gui: support for diff3 conflict style git-gui: use existing interface to query a path's attribute git-gui (Windows): use git-bash.exe if it is available treewide: correct several "up-to-date" to "up to date" Fix build with core.autocrlf=true
2019-11-04Merge tag 'l10n-2.24.0-rnd2' of https://github.com/git-l10n/git-poLibravatar Junio C Hamano10-22221/+23300
l10n-2.24.0-rnd2 * tag 'l10n-2.24.0-rnd2' of https://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.24.0 l10n round 1~2 l10n: de.po: Update German translation l10n: sv.po: Update Swedish translation (4695t0f0u) l10n: bg.po: Updated Bulgarian translation (4694) l10n: vi(4694t): Updated translation for v2.24.0 l10n: es: 2.24.0 round 2 l10n: it.po: update the Italian translation for Git 2.24.0 round #2 l10n: fr v2.24.0 rnd2 l10n: git.pot: v2.24.0 round 2 (1 new) l10n: it.po: update the Italian translation for Git 2.24.0 l10n: fr 2.24.0 rnd 1 l10n: git.pot: v2.24.0 round 1 (35 new, 16 removed) l10n: bg.po: Updated Bulgarian translation (4693) l10n: sv.po: Update Swedish translation (4674t0f0u) l10n: Update Catalan translation
2019-11-02l10n: zh_CN: for git v2.24.0 l10n round 1~2Libravatar Jiang Xin1-2439/+2539
Translate 36 new messages (4694t0f0u) for git 2.24.0. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>