summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-12-16Merge branch 'sg/t9300-robustify'Libravatar Junio C Hamano1-4/+16
The test on "fast-import" used to get stuck when "fast-import" died in the middle. * sg/t9300-robustify: t9300-fast-import: don't hang if background fast-import exits too early t9300-fast-import: store the PID in a variable instead of pidfile
2019-12-16Merge branch 'js/add-i-a-bit-more-tests'Libravatar Junio C Hamano3-11/+97
Test coverage update in preparation for further work on "git add -i". * js/add-i-a-bit-more-tests: apply --allow-overlap: fix a corner case git add -p: use non-zero exit code when the diff generation failed t3701: verify that the diff.algorithm config setting is handled t3701: verify the shown messages when nothing can be added t3701: add a test for the different `add -p` prompts t3701: avoid depending on the TTY prerequisite t3701: add a test for advanced split-hunk editing
2019-12-16Merge branch 'dl/range-diff-with-notes'Libravatar Junio C Hamano4-6/+7
Code clean-up. * dl/range-diff-with-notes: range-diff: clear `other_arg` at end of function range-diff: mark pointers as const t3206: fix incorrect test name
2019-12-16Merge branch 'hw/doc-in-header'Libravatar Junio C Hamano48-2452/+1931
* hw/doc-in-header: trace2: move doc to trace2.h submodule-config: move doc to submodule-config.h tree-walk: move doc to tree-walk.h trace: move doc to trace.h run-command: move doc to run-command.h parse-options: add link to doc file in parse-options.h credential: move doc to credential.h argv-array: move doc to argv-array.h cache: move doc to cache.h sigchain: move doc to sigchain.h pathspec: move doc to pathspec.h revision: move doc to revision.h attr: move doc to attr.h refs: move doc to refs.h remote: move doc to remote.h and refspec.h sha1-array: move doc to sha1-array.h merge: move doc to ll-merge.h graph: move doc to graph.h and graph.c dir: move doc to dir.h diff: move doc to diff.h and diffcore.h
2019-12-16Merge branch 'rs/xdiff-ignore-ws-w-func-context'Libravatar Junio C Hamano2-5/+18
The "diff" machinery learned not to lose added/removed blank lines in the context when --ignore-blank-lines and --function-context are used at the same time. * rs/xdiff-ignore-ws-w-func-context: xdiff: unignore changes in function context
2019-12-16Merge branch 'dl/rebase-with-autobase'Libravatar Junio C Hamano5-11/+26
"git rebase" did not work well when format.useAutoBase configuration variable is set, which has been corrected. * dl/rebase-with-autobase: rebase: fix format.useAutoBase breakage format-patch: teach --no-base t4014: use test_config() format-patch: fix indentation t3400: demonstrate failure with format.useAutoBase
2019-12-16Merge branch 'dl/test-cleanup'Libravatar Junio C Hamano12-323/+425
Test cleanup. * dl/test-cleanup: (26 commits) t7700: stop losing return codes of git commands t7700: make references to SHA-1 generic t7700: replace egrep with grep t7700: consolidate code into test_has_duplicate_object() t7700: consolidate code into test_no_missing_in_packs() t7700: s/test -f/test_path_is_file/ t7700: move keywords onto their own line t7700: remove spaces after redirect operators t7700: drop redirections to /dev/null t7501: stop losing return codes of git commands t7501: remove spaces after redirect operators t5703: stop losing return codes of git commands t5703: simplify one-time-sed generation logic t5317: use ! grep to check for no matching lines t5317: stop losing return codes of git commands t4138: stop losing return codes of git commands t4015: use test_write_lines() t4015: stop losing return codes of git commands t3600: comment on inducing SIGPIPE in `git rm` t3600: stop losing return codes of git commands ...
2019-12-16Merge branch 'cs/store-packfiles-in-hashmap'Libravatar Junio C Hamano4-9/+52
In a repository with many packfiles, the cost of the procedure that avoids registering the same packfile twice was unnecessarily high by using an inefficient search algorithm, which has been corrected. * cs/store-packfiles-in-hashmap: packfile.c: speed up loading lots of packfiles
2019-12-16Merge branch 'js/builtin-add-i-cmds'Libravatar Junio C Hamano1-59/+560
"git add -i" that is getting rewritten in C has been extended to cover subcommands other than the "patch". * js/builtin-add-i-cmds: built-in add -i: offer the `quit` command built-in add -i: re-implement the `diff` command built-in add -i: implement the `patch` command built-in add -i: re-implement `add-untracked` in C built-in add -i: re-implement `revert` in C built-in add -i: implement the `update` command built-in add -i: prepare for multi-selection commands built-in add -i: allow filtering the modified files list add-interactive: make sure to release `rev.prune_data`
2019-12-16Merge branch 'dd/time-reentrancy'Libravatar Junio C Hamano3-19/+21
Avoid gmtime() and localtime() and prefer their reentrant counterparts. * dd/time-reentrancy: mingw: use {gm,local}time_s as backend for {gm,local}time_r archive-zip.c: switch to reentrant localtime_r date.c: switch to reentrant {gm,local}time_r
2019-12-16Merge branch 'ag/sequencer-todo-updates'Libravatar Junio C Hamano2-9/+29
Reduce unnecessary reading of state variables back from the disk during sequencer operation. * ag/sequencer-todo-updates: sequencer: directly call pick_commits() from complete_action() rebase: fill `squash_onto' in get_replay_opts() sequencer: move the code writing total_nr on the disk to a new function sequencer: update `done_nr' when skipping commands in a todo list sequencer: update `total_nr' when adding an item to a todo list
2019-12-16fix-typo: consecutive-word duplicationsLibravatar ryenus5-5/+5
Correct unintentional duplication(s) of words, such as "the the", and "can can" etc. The changes are only applied to cases where it's fixing what is clearly wrong or prone to misunderstanding, as suggested by the reviewers. Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de> Helped-by: Denton Liu <liu.denton@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: ryenus <ryenus@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-10The fifth batchLibravatar Junio C Hamano1-0/+36
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-10Merge branch 'ag/sequencer-continue-leakfix'Libravatar Junio C Hamano1-2/+4
Leakfix. * ag/sequencer-continue-leakfix: sequencer: fix a memory leak in sequencer_continue()
2019-12-10Merge branch 'em/test-skip-regex-illseq'Libravatar Junio C Hamano2-3/+9
Test portability fix. * em/test-skip-regex-illseq: t4210: skip i18n tests that don't work on FreeBSD
2019-12-10Merge branch 'hi/gpg-use-check-signature'Libravatar Junio C Hamano4-75/+72
Hide lower-level verify_signed-buffer() API as a pure helper to implement the public check_signature() function, in order to encourage new callers to use the correct and more strict validation. * hi/gpg-use-check-signature: gpg-interface: prefer check_signature() for GPG verification
2019-12-10Merge branch 'bc/t9001-zsh-in-posix-emulation-mode'Libravatar Junio C Hamano1-1/+1
Test portability fix. * bc/t9001-zsh-in-posix-emulation-mode: t9001: avoid including non-trailing NUL bytes in variables
2019-12-10Merge branch 'sg/test-squelch-noise-in-commit-bulk'Libravatar Junio C Hamano1-1/+1
Code cleanup. * sg/test-squelch-noise-in-commit-bulk: test-lib-functions: suppress a 'git rev-parse' error in 'test_commit_bulk'
2019-12-10Merge branch 'jk/perf-wo-git-dot-pm'Libravatar Junio C Hamano1-2/+7
Test cleanup. * jk/perf-wo-git-dot-pm: t/perf: don't depend on Git.pm
2019-12-10Merge branch 'ds/commit-graph-delay-gen-progress'Libravatar Junio C Hamano5-8/+23
One kind of progress messages were always given during commit-graph generation, instead of following the "if it takes more than two seconds, show progress" pattern, which has been corrected. * ds/commit-graph-delay-gen-progress: commit-graph: use start_delayed_progress() progress: create GIT_PROGRESS_DELAY
2019-12-10Merge branch 'jt/clone-recursesub-ref-advise'Libravatar Junio C Hamano5-1/+19
The interaction between "git clone --recurse-submodules" and alternate object store was ill-designed. The documentation and code have been taught to make more clear recommendations when the users see failures. * jt/clone-recursesub-ref-advise: submodule--helper: advise on fatal alternate error Doc: explain submodule.alternateErrorStrategy
2019-12-10Merge branch 'as/t7812-missing-redirects-fix'Libravatar Junio C Hamano1-4/+7
Test fix. * as/t7812-missing-redirects-fix: t7812: expect failure for grep -i with invalid UTF-8 data t7812: add missing redirects
2019-12-10Merge branch 'dl/pretty-reference'Libravatar Junio C Hamano9-26/+134
"git log" family learned "--pretty=reference" that gives the name of a commit in the format that is often used to refer to it in log messages. * dl/pretty-reference: SubmittingPatches: use `--pretty=reference` pretty: implement 'reference' format pretty: add struct cmt_fmt_map::default_date_mode_type pretty: provide short date format t4205: cover `git log --reflog -z` blindspot pretty.c: inline initalize format_context revision: make get_revision_mark() return const pointer completion: complete `tformat:` pretty format SubmittingPatches: remove dq from commit reference pretty-formats.txt: use generic terms for hash SubmittingPatches: use generic terms for hash
2019-12-10Merge branch 'dl/submodule-set-url'Libravatar Junio C Hamano4-2/+113
"git submodule" learned a subcommand "set-url". * dl/submodule-set-url: submodule: teach set-url subcommand
2019-12-10Merge branch 'js/mingw-inherit-only-std-handles'Libravatar Junio C Hamano5-12/+199
Work around a issue where a FD that is left open when spawning a child process and is kept open in the child can interfere with the operation in the parent process on Windows. * js/mingw-inherit-only-std-handles: mingw: forbid translating ERROR_SUCCESS to an errno value mingw: do set `errno` correctly when trying to restrict handle inheritance mingw: restrict file handle inheritance only on Windows 7 and later mingw: spawned processes need to inherit only standard handles mingw: work around incorrect standard handles mingw: demonstrate that all file handles are inherited by child processes
2019-12-10Merge branch 'po/bundle-doc-clonable'Libravatar Junio C Hamano2-6/+20
Doc update. * po/bundle-doc-clonable: Doc: Bundle file usage
2019-12-10Merge branch 'ra/rebase-i-more-options'Libravatar Junio C Hamano6-28/+323
"git rebase -i" learned a few options that are known by "git rebase" proper. * ra/rebase-i-more-options: rebase -i: finishing touches to --reset-author-date rebase: add --reset-author-date rebase -i: support --ignore-date sequencer: rename amend_author to author_to_rename rebase -i: support --committer-date-is-author-date sequencer: allow callers of read_author_script() to ignore fields rebase -i: add --ignore-whitespace flag
2019-12-10Merge branch 'am/pathspec-from-file'Libravatar Junio C Hamano9-28/+434
A few commands learned to take the pathspec from the standard input or a named file, instead of taking it as the command line arguments. * am/pathspec-from-file: commit: support the --pathspec-from-file option doc: commit: synchronize <pathspec> description reset: support the `--pathspec-from-file` option doc: reset: synchronize <pathspec> description pathspec: add new function to parse file parse-options.h: add new options `--pathspec-from-file`, `--pathspec-file-nul`
2019-12-09Sync with Git 2.24.1Libravatar Junio C Hamano47-87/+991
2019-12-06The fourth batchLibravatar Junio C Hamano1-0/+18
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06Merge branch 'dl/lore-is-the-archive'Libravatar Junio C Hamano14-17/+18
Publicize lore.kernel.org mailing list archive and use URLs pointing into it to refer to notable messages in the documentation. * dl/lore-is-the-archive: doc: replace LKML link with lore.kernel.org RelNotes: replace Gmane with real Message-IDs doc: replace MARC links with lore.kernel.org
2019-12-06Merge branch 'jk/lore-is-the-archive'Libravatar Junio C Hamano13-30/+30
Doc update for the mailing list archiving and nntp service. * jk/lore-is-the-archive: doc: replace public-inbox links with lore.kernel.org doc: recommend lore.kernel.org over public-inbox.org
2019-12-06Merge branch 'tg/perf-remove-stale-result'Libravatar Junio C Hamano2-11/+5
PerfTest fix to avoid stale result mixed up with the latest round of test results. * tg/perf-remove-stale-result: perf-lib: use a single filename for all measurement types
2019-12-06Merge branch 'jk/send-pack-check-negative-with-quick'Libravatar Junio C Hamano1-1/+3
Performance tweak on "git push" into a repository with many refs that point at objects we have never heard of. * jk/send-pack-check-negative-with-quick: send-pack: use OBJECT_INFO_QUICK to check negative objects
2019-12-06Merge branch 'hi/grep-do-not-return-void'Libravatar Junio C Hamano1-1/+1
Code cleanup. * hi/grep-do-not-return-void: grep: don't return an expression from pcre2_free()
2019-12-06Merge branch 'rs/use-skip-prefix-more'Libravatar Junio C Hamano5-22/+16
Code cleanup. * rs/use-skip-prefix-more: name-rev: use skip_prefix() instead of starts_with() push: use skip_prefix() instead of starts_with() shell: use skip_prefix() instead of starts_with() fmt-merge-msg: use skip_prefix() instead of starts_with() fetch: use skip_prefix() instead of starts_with()
2019-12-06Merge branch 'rs/simplify-prepare-cmd'Libravatar Junio C Hamano1-2/+1
Code cleanup. * rs/simplify-prepare-cmd: run-command: use prepare_git_cmd() in prepare_cmd()
2019-12-06Merge branch 'rs/test-cleanup'Libravatar Junio C Hamano10-23/+16
Test cleanup. * rs/test-cleanup: t7811: don't create unused file t9300: don't create unused file test: use test_must_be_empty F instead of test_cmp empty F test: use test_must_be_empty F instead of test -z $(cat F) t1400: use test_must_be_empty t1410: use test_line_count t1512: use test_line_count
2019-12-06Merge branch 'sg/assume-no-todo-update-in-cherry-pick'Libravatar Junio C Hamano2-1/+31
While running "revert" or "cherry-pick --edit" for multiple commits, a recent regression incorrectly detected "nothing to commit, working tree clean", instead of replaying the commits, which has been corrected. * sg/assume-no-todo-update-in-cherry-pick: sequencer: don't re-read todo for revert and cherry-pick
2019-12-06Merge branch 'sg/osx-force-gcc-9'Libravatar Junio C Hamano2-4/+5
TravisCI update. * sg/osx-force-gcc-9: ci: build Git with GCC 9 in the 'osx-gcc' build job
2019-12-06range-diff: clear `other_arg` at end of functionLibravatar Denton Liu1-0/+1
We were leaking memory by not clearing `other_arg` after we were done using it. Clear it after we've finished using it. Note that this isn't strictly necessary since the memory will be reclaimed once the command exits. However, since we are releasing the strbufs, we should also clear `other_arg` for consistency. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06range-diff: mark pointers as constLibravatar Denton Liu2-5/+5
The contents pointed to by `diffopt` and `other_arg` should not be modified. Mark these as `const` to indicate this. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06t3206: fix incorrect test nameLibravatar Denton Liu1-1/+1
The name of the test used to indicate that it was testing the `--notes` option but it was really testing the `format.notes` configuration. Correct the test name to reflect this. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06t9300-fast-import: don't hang if background fast-import exits too earlyLibravatar SZEDER Gábor1-2/+14
The five tests checking 'git fast-import's checkpoint handling in 't9300-fast-import.sh', all with the prefix "V:" in their test description, can hang indefinitely if 'git fast-import' unexpectedly dies early in any of these tests. These five tests run 'git fast-import' in the background, while feeding instructions to its standard input through a fifo (fd 8) from a background subshell, and reading and verifying its standard output through another fifo (fd 9) in the test script's main shell process. This "reading and verifying" is basically a 'while read ...' shell loop iterating until 'git fast-import' outputs the expected line, ignoring any other output. This doesn't work very well when 'git fast-import' dies before printing that particular line, because the 'read' builtin doesn't get EOF after the death of 'git fast-import', as their input and output are not connected directly but through a fifo. Consequently, that 'read' hangs waiting for the next line from the already dead 'git fast-import', leaving the test script and in turn the whole test suite hanging. Avoid this hang by checking whether the background 'git fast-import' process exited unexpectedly early, and interrupt the 'while read' loop if it did. We have to jump through some hoops to achive that, though: - Start the background 'git fast-import' in another background subshell, which then: - prints the PID of that 'git fast-import' process to the fifo, to be read by the main shell process, so it will know which process to kill when the test is finished. - waits until that 'git fast-import' process exits. If it does exit, then report its exit code, and write a message to the fifo used for 'git fast-import's standard output, thus un-block the 'read' builtin in the main shell process. - Modify that 'while read' loop to break the loop upon seeing that message, and fail the test in the usual way. - Once the test is finished kill that background subshell as well, and do so before killing the background 'git fast-import'. Otherwise the background 'git fast-import' and subshell processes would die racily, and if 'git fast-import' were to die sooner, then we might get some undesired and potentially confusing messages in the test's output. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06t9300-fast-import: store the PID in a variable instead of pidfileLibravatar SZEDER Gábor1-3/+3
The five tests running 'git fast-import' in the background in 't9300-fast-import.sh' store the PID of that background process in a pidfile, to be used to check whether that background process survived each test and then to kill it in test_when_finished commands. To achieve this all these five tests run three $(cat <pidfile>) command substitutions each. Store the PID of the background 'git fast-import' in a variable to avoid those extra processes. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06apply --allow-overlap: fix a corner caseLibravatar Johannes Schindelin1-0/+10
Yes, yes, this is supposed to be only a band-aid option for `git add -p` not Doing The Right Thing. But as long as we carry the `--allow-overlap` option, we might just as well get it right. This fixes the case where one hunk inserts a line before the first line, and is followed by a hunk whose context overlaps with the first one's and which appends a line at the end. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06git add -p: use non-zero exit code when the diff generation failedLibravatar Johannes Schindelin2-4/+6
The first thing `git add -p` does is to generate a diff. If this diff cannot be generated, `git add -p` should not continue as if nothing happened, but instead fail. What we *actually* do here is much broader: we now verify for *every* `run_cmd_pipe()` call that the spawned process actually succeeded. Note that we have to change two callers in this patch, as we need to store the spawned process' output in a local variable, which means that the callers can no longer decide whether to interpret the `return <$fh>` in array or in scalar context. This bug was noticed while writing a test case for the diff.algorithm feature, and we let that test case double as a regression test for this fixed bug, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06t3701: verify that the diff.algorithm config setting is handledLibravatar Johannes Schindelin1-0/+10
Without this patch, there is actually no test in Git's test suite that covers the diff.algorithm feature. Let's add one. We do this by passing a bogus value and then expecting `git diff-files` to produce the appropriate error message. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06t3701: verify the shown messages when nothing can be addedLibravatar Johannes Schindelin1-0/+11
In preparation for re-implementing `git add -p` in pure C (where we will purposefully keep the implementation of `git add -p` separate from the implementation of `git add -i`), let's verify that the user is told the same things as in the Perl version when the diff file is either empty or contains only entries about binary files. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-12-06t3701: add a test for the different `add -p` promptsLibravatar Johannes Schindelin1-1/+18
The `git add -p` command offers different prompts for regular diff hunks vs mode change pseudo hunks vs diffs deleting files. Let's cover this in the regresion test suite, in preparation for re-implementing `git add -p` in C. For the mode change prompt, we use a trick that lets this test case pass even on systems without executable bit, i.e. where `core.filemode = false` (such as Windows): we first add the file to the index with `git add --chmod=+x`, and then call `git add -p` with `core.filemode` forced to `true`. The file on disk has no executable bit set, therefore we will see a mode change. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>