summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-01-07hooks: convert non-worktree 'post-checkout' hook to hook libraryLibravatar Emily Shaffer3-3/+6
Move the running of the 'post-checkout' hook away from run-command.h to the new hook.h library, except in the case of builtin/worktree.c. That special-case will be handled in a subsequent commit. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-07merge: convert post-merge to use hook.hLibravatar Emily Shaffer1-1/+1
Teach post-merge to use the hook.h library instead of the run-command.h library to run hooks. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-07am: convert applypatch-msg to use hook.hLibravatar Emily Shaffer1-1/+1
Teach applypatch-msg to use the hook.h library instead of the run-command.h library. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-07rebase: convert pre-rebase to use hook.hLibravatar Emily Shaffer1-1/+2
Move the pre-rebase hook away from run-command.h to and over to the new hook.h library. Since this hook needs arguments introduce a run_hooksl() wrapper, like run_hooks(), but it takes varargs. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-07hook API: add a run_hooks_l() wrapperLibravatar Ævar Arnfjörð Bjarmason2-0/+24
Add a run_hooks_l() wrapper, we'll use it in subsequent commits for the simple cases of wanting to run a single hook under a given name along with a list of arguments. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-07am: convert {pre,post}-applypatch to use hook.hLibravatar Emily Shaffer1-2/+2
Teach pre-applypatch and post-applypatch to use the hook.h library instead of the run-command.h library. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-07gc: use hook library for pre-auto-gc hookLibravatar Emily Shaffer1-1/+2
Move the pre-auto-gc hook away from run-command.h to and over to the new hook.h library. This uses the new run_hooks() wrapper. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-07hook API: add a run_hooks() wrapperLibravatar Ævar Arnfjörð Bjarmason2-0/+13
Add a run_hooks() wrapper, we'll use it in subsequent commits for the simple cases of wanting to run a single hook under a given name, without providing options such as "env" or "args". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-01-07hook: add 'run' subcommandLibravatar Emily Shaffer11-0/+392
In order to enable hooks to be run as an external process, by a standalone Git command, or by tools which wrap Git, provide an external means to run all configured hook commands for a given hook event. Most of our hooks require more complex functionality than this, but let's start with the bare minimum required to support our simplest hooks. In terms of implementation the usage_with_options() and "goto usage" pattern here mirrors that of builtin/{commit-graph,multi-pack-index}.c. Some of the implementation here, such as a function being named run_hooks_opt() when it's tasked with running one hook, to using the run_processes_parallel_tr2() API to run with jobs=1 is somewhere between a bit odd and and an overkill for the current features of this "hook run" command and the hook.[ch] API. This code will eventually be able to run multiple hooks declared in config in parallel, by starting out with these names and APIs we reduce the later churn of renaming functions, switching from the run_command() to run_processes_parallel_tr2() API etc. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-21The fourth batchLibravatar Junio C Hamano1-1/+33
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-21Merge branch 'js/scalar'Libravatar Junio C Hamano8-0/+1275
Add pieces from "scalar" to contrib/. * js/scalar: scalar: implement the `version` command scalar: implement the `delete` command scalar: teach 'reconfigure' to optionally handle all registered enlistments scalar: allow reconfiguring an existing enlistment scalar: implement the `run` command scalar: teach 'clone' to support the --single-branch option scalar: implement the `clone` subcommand scalar: implement 'scalar list' scalar: let 'unregister' handle a deleted enlistment directory gracefully scalar: 'unregister' stops background maintenance scalar: 'register' sets recommended config and starts maintenance scalar: create test infrastructure scalar: start documenting the command scalar: create a rudimentary executable scalar: add a README with a roadmap
2021-12-21Merge branch 'ld/sparse-diff-blame'Libravatar Junio C Hamano7-37/+131
Teach diff and blame to work well with sparse index. * ld/sparse-diff-blame: blame: enable and test the sparse index diff: enable and test the sparse index diff: replace --staged with --cached in t1092 tests repo-settings: prepare_repo_settings only in git repos test-read-cache: set up repo after git directory commit-graph: return if there is no git directory git: ensure correct git directory setup with -h
2021-12-21Merge branch 'en/name-rev-shorter-output'Libravatar Junio C Hamano1-4/+13
"git name-rev" has been tweaked to give output that is shorter and easier to understand. * en/name-rev-shorter-output: name-rev: prefer shorter names over following merges
2021-12-21Merge branch 'ak/protect-any-current-branch'Libravatar Junio C Hamano11-131/+198
"git fetch" without the "--update-head-ok" option ought to protect a checked out branch from getting updated, to prevent the working tree that checks it out to go out of sync. The code was written before the use of "git worktree" got widespread, and only checked the branch that was checked out in the current worktree, which has been updated. (originally called ak/fetch-not-overwrite-any-current-branch) * ak/protect-any-current-branch: branch: protect branches checked out in all worktrees receive-pack: protect current branch for bare repository worktree receive-pack: clean dead code from update_worktree() fetch: protect branches checked out in all worktrees worktree: simplify find_shared_symref() memory ownership model branch: lowercase error messages receive-pack: lowercase error messages fetch: lowercase error messages
2021-12-21Merge branch 'fs/ssh-signing-other-keytypes'Libravatar Junio C Hamano5-17/+67
The cryptographic signing using ssh keys can specify literal keys for keytypes whose name do not begin with the "ssh-" prefix by using the "key::" prefix mechanism (e.g. "key::ecdsa-sha2-nistp256"). * fs/ssh-signing-other-keytypes: ssh signing: make sign/amend test more resilient ssh signing: support non ssh-* keytypes
2021-12-21Merge branch 'fs/ssh-signing-key-lifetime'Libravatar Junio C Hamano13-48/+351
Extend the signing of objects with SSH keys and learn to pay attention to the key validity time range when verifying. * fs/ssh-signing-key-lifetime: ssh signing: verify ssh-keygen in test prereq ssh signing: make fmt-merge-msg consider key lifetime ssh signing: make verify-tag consider key lifetime ssh signing: make git log verify key lifetime ssh signing: make verify-commit consider key lifetime ssh signing: add key lifetime test prereqs ssh signing: use sigc struct to pass payload t/fmt-merge-msg: make gpgssh tests more specific t/fmt-merge-msg: do not redirect stderr
2021-12-21Merge branch 'jc/grep-patterntype-default-doc'Libravatar Junio C Hamano1-1/+2
Doc update. * jc/grep-patterntype-default-doc: grep: clarify what `grep.patternType=default` means
2021-12-21Merge branch 'jk/log-decorate-opts-with-implicit-decorate'Libravatar Junio C Hamano2-4/+56
When "git log" implicitly enabled the "decoration" processing without being explicitly asked with "--decorate" option, it failed to read and honor the settings given by the "--decorate-refs" option. * jk/log-decorate-opts-with-implicit-decorate: log: load decorations with --simplify-by-decoration log: handle --decorate-refs with userformat "%d"
2021-12-21Merge branch 'en/rebase-x-wo-git-dir-env'Libravatar Junio C Hamano2-8/+24
"git rebase -x" by mistake started exporting the GIT_DIR and GIT_WORK_TREE environment variables when the command was rewritten in C, which has been corrected. * en/rebase-x-wo-git-dir-env: sequencer: do not export GIT_DIR and GIT_WORK_TREE for 'exec'
2021-12-21Merge branch 'jc/c99-var-decl-in-for-loop'Libravatar Junio C Hamano2-3/+9
Weather balloon to find compilers that do not grok variable declaration in the for() loop. * jc/c99-var-decl-in-for-loop: revision: use C99 declaration of variable in for() loop
2021-12-21Merge branch 'pw/xdiff-classify-record-in-histogram'Libravatar Junio C Hamano3-42/+29
"diff --histogram" optimization. * pw/xdiff-classify-record-in-histogram: xdiff: drop unused flags parameter from recs_match xdiff: drop xpparam_t parameter from histogram cmp_recs() xdiff: drop CMP_ENV macro from xhistogram xdiff: simplify comparison xdiff: avoid unnecessary memory allocations diff histogram: intern strings
2021-12-15The third batchLibravatar Junio C Hamano1-0/+65
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-12-15Merge branch 'ab/die-with-bug'Libravatar Junio C Hamano5-7/+5
Code clean-up. * ab/die-with-bug: object.c: use BUG(...) no die("BUG: ...") in lookup_object_by_type() pathspec: use BUG(...) not die("BUG:%s:%d....", <file>, <line>) strbuf.h: use BUG(...) not die("BUG: ...") pack-objects: use BUG(...) not die("BUG: ...")
2021-12-15Merge branch 'hn/allow-bogus-oid-in-ref-tests'Libravatar Junio C Hamano8-90/+169
The test helper for refs subsystem learned to write bogus and/or nonexistent object name to refs to simulate error situations we want to test Git in. * hn/allow-bogus-oid-in-ref-tests: t1430: create valid symrefs using test-helper t1430: remove refs using test-tool refs: introduce REF_SKIP_REFNAME_VERIFICATION flag refs: introduce REF_SKIP_OID_VERIFICATION flag refs: update comment. test-ref-store: plug memory leak in cmd_delete_refs test-ref-store: parse symbolic flag constants test-ref-store: remove force-create argument for create-reflog
2021-12-15Merge branch 'ab/parse-options-cleanup'Libravatar Junio C Hamano1-3/+4
Change the type of an internal function to return an enum (instead of int) and replace -2 that was used to signal an error with -1. * ab/parse-options-cleanup: parse-options.c: use "enum parse_opt_result" for parse_nodash_opt()
2021-12-15Merge branch 're/color-default-reset'Libravatar Junio C Hamano4-13/+80
"default" and "reset" colors have been added to our palette. * re/color-default-reset: color: allow colors to be prefixed with "reset" color: support "default" to restore fg/bg color color: add missing GIT_COLOR_* white/black constants
2021-12-15Merge branch 'jc/reflog-iterator-callback-doc'Libravatar Junio C Hamano1-1/+23
Document the parameters given to the reflog entry iterator callback functions. * jc/reflog-iterator-callback-doc: refs: document callback for reflog-ent iterators
2021-12-15Merge branch 'ew/test-wo-fsync'Libravatar Junio C Hamano6-2/+48
Allow running our tests while disabling fsync. * ew/test-wo-fsync: tests: disable fsync everywhere
2021-12-15Merge branch 'ew/cbtree-remove-unused-and-broken-cb-unlink'Libravatar Junio C Hamano2-33/+0
Code clean-up. * ew/cbtree-remove-unused-and-broken-cb-unlink: cbtree: remove broken and unused cb_unlink
2021-12-15Merge branch 'ds/sparse-deep-pattern-checkout-fix'Libravatar Junio C Hamano2-7/+23
The sparse-index/sparse-checkout feature had a bug in its use of the matching code to determine which path is in or outside the sparse checkout patterns. * ds/sparse-deep-pattern-checkout-fix: unpack-trees: use traverse_path instead of name t1092: add deeper changes during a checkout
2021-12-15Merge branch 'tb/pack-revindex-on-disk-cleanup'Libravatar Junio C Hamano2-2/+2
Code clean-up. * tb/pack-revindex-on-disk-cleanup: packfile: make `close_pack_revindex()` static
2021-12-15Merge branch 'es/doc-stdout-vs-stderr'Libravatar Junio C Hamano1-0/+27
Coding guideline document has been updated to clarify what goes to standard error in our system. * es/doc-stdout-vs-stderr: CodingGuidelines: document which output goes to stdout vs. stderr
2021-12-15Merge branch 'js/test-initial-branch-override-cleanup'Libravatar Junio C Hamano17-50/+0
Many tests that used to need GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME mechanism to force "git" to use 'master' as the default name for the initial branch no longer need it; the use of the mechanism from them have been removed. * js/test-initial-branch-override-cleanup: tests: set GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME only when needed
2021-12-15Merge branch 'es/worktree-chatty-to-stderr'Libravatar Junio C Hamano5-34/+28
"git worktree add" showed "Preparing worktree" message to the standard output stream, but when it failed, the message from die() went to the standard error stream. Depending on the order the stdio streams are flushed at the program end, this resulted in confusing output. It has been corrected by sending all the chatty messages to the standard error stream. * es/worktree-chatty-to-stderr: git-worktree.txt: add missing `-v` to synopsis for `worktree list` worktree: send "chatty" messages to stderr
2021-12-15Merge branch 'ab/ci-updates'Libravatar Junio C Hamano10-165/+72
Drop support for TravisCI and update test workflows at GitHub. * ab/ci-updates: CI: don't run "make test" twice in one job CI: use "$runs_on_pool", not "$jobname" to select packages & config CI: rename the "Linux32" job to lower-case "linux32" CI: use shorter names that fit in UX tooltips CI: remove Travis CI support
2021-12-15Merge branch 'hn/reflog-tests'Libravatar Junio C Hamano7-19/+42
Prepare tests on ref API to help testing reftable backends. * hn/reflog-tests: refs/debug: trim trailing LF from reflog message test-ref-store: tweaks to for-each-reflog-ent format t1405: check for_each_reflog_ent_reverse() more thoroughly test-ref-store: don't add newline to reflog message show-branch: show reflog message
2021-12-15Merge branch 'rj/receive-pack-avoid-sigpipe-during-status-reporting'Libravatar Junio C Hamano1-0/+2
When the "git push" command is killed while the receiving end is trying to report what happened to the ref update proposals, the latter used to die, due to SIGPIPE. The code now ignores SIGPIPE to increase our chances to run the post-receive hook after it happens. * rj/receive-pack-avoid-sigpipe-during-status-reporting: receive-pack: ignore SIGPIPE while reporting status to client
2021-12-15Merge branch 'es/pretty-describe-more'Libravatar Junio C Hamano3-15/+75
Extend "git log --format=%(describe)" placeholder to allow passing selected command-line options to the underlying "git describe" command. * es/pretty-describe-more: pretty: add abbrev option to %(describe) pretty: add tag option to %(describe) pretty.c: rework describe options parsing for better extensibility
2021-12-15Merge branch 'ab/run-command'Libravatar Junio C Hamano33-223/+157
API clean-up. * ab/run-command: run-command API: remove "env" member, always use "env_array" difftool: use "env_array" to simplify memory management run-command API: remove "argv" member, always use "args" run-command API users: use strvec_push(), not argv construction run-command API users: use strvec_pushl(), not argv construction run-command tests: use strvec_pushv(), not argv assignment run-command API users: use strvec_pushv(), not argv assignment upload-archive: use regular "struct child_process" pattern worktree: stop being overly intimate with run_command() internals
2021-12-15Merge branch 'hn/t1404-df-limitation-is-ref-files-only'Libravatar Junio C Hamano1-16/+16
Test update. * hn/t1404-df-limitation-is-ref-files-only: t1404: mark directory/file conflict tests with REFFILES
2021-12-15Merge branch 'en/zdiff3'Libravatar Junio C Hamano15-30/+205
"Zealous diff3" style of merge conflict presentation has been added. * en/zdiff3: update documentation for new zdiff3 conflictStyle xdiff: implement a zealous diff3, or "zdiff3"
2021-12-15Merge branch 'ds/trace2-regions-in-tests'Libravatar Junio C Hamano6-9/+12
The default setting for trace2 event nesting was too low to cause test failures, which is worked around by bumping it up in the test framework. * ds/trace2-regions-in-tests: t/t*: remove custom GIT_TRACE2_EVENT_NESTING test-lib.sh: set GIT_TRACE2_EVENT_NESTING
2021-12-15Merge branch 'fs/test-prereq'Libravatar Junio C Hamano4-4/+55
The test framework learns to list unsatisfied test prerequisites, and optionally error out when prerequisites that are expected to be satisfied are not. * fs/test-prereq: test-lib: make BAIL_OUT() work in tests and prereq test-lib: introduce required prereq for test runs test-lib: show missing prereq summary
2021-12-15Merge branch 'ab/mark-leak-free-tests-even-more'Libravatar Junio C Hamano104-0/+152
More tests are marked as leak-free. * ab/mark-leak-free-tests-even-more: leak tests: mark some fast-import tests as passing with SANITIZE=leak leak tests: mark some config tests as passing with SANITIZE=leak leak tests: mark some status tests as passing with SANITIZE=leak leak tests: mark some clone tests as passing with SANITIZE=leak leak tests: mark some add tests as passing with SANITIZE=leak leak tests: mark some diff tests as passing with SANITIZE=leak leak tests: mark some apply tests as passing with SANITIZE=leak leak tests: mark some notes tests as passing with SANITIZE=leak leak tests: mark some update-index tests as passing with SANITIZE=leak leak tests: mark some rev-parse tests as passing with SANITIZE=leak leak tests: mark some rev-list tests as passing with SANITIZE=leak leak tests: mark some misc tests as passing with SANITIZE=leak leak tests: mark most gettext tests as passing with SANITIZE=leak leak tests: mark "sort" test as passing SANITIZE=leak leak tests: mark a read-tree test as passing SANITIZE=leak
2021-12-15Merge branch 'hn/reftable'Libravatar Junio C Hamano69-12/+11125
The "reftable" backend for the refs API, without integrating into the refs subsystem, has been added. * hn/reftable: Add "test-tool dump-reftable" command. reftable: add dump utility reftable: implement stack, a mutable database of reftable files. reftable: implement refname validation reftable: add merged table view reftable: add a heap-based priority queue for reftable records reftable: reftable file level tests reftable: read reftable files reftable: generic interface to tables reftable: write reftable files reftable: a generic binary tree implementation reftable: reading/writing blocks Provide zlib's uncompress2 from compat/zlib-compat.c reftable: (de)serialization for the polymorphic record type. reftable: add blocksource, an abstraction for random access reads reftable: utility functions reftable: add error related functionality reftable: add LICENSE hash.h: provide constants for the hash IDs
2021-12-10The second batchLibravatar Junio C Hamano1-0/+99
2021-12-10Merge branch 'en/rebase-x-fix'Libravatar Junio C Hamano2-2/+7
"git rebase -x" added an unnecessary 'exec' instructions before 'noop', which has been corrected. * en/rebase-x-fix: sequencer: avoid adding exec commands for non-commit creating commands
2021-12-10Merge branch 'cb/add-p-single-key-fix'Libravatar Junio C Hamano1-7/+9
The single-key-input mode in "git add -p" had some code to handle keys that generate a sequence of input via ReadKey(), which did not handle end-of-file correctly, which has been fixed. * cb/add-p-single-key-fix: add -p: avoid use of undefined $key when ReadKey -> EOF
2021-12-10Merge branch 'cb/mingw-gmtime-r'Libravatar Junio C Hamano2-1/+5
Build fix on Windows. * cb/mingw-gmtime-r: mingw: avoid fallback for {local,gm}time_r()
2021-12-10Merge branch 'yn/complete-date-format-options'Libravatar Junio C Hamano1-1/+1
The completion script (in contrib/) learns that the "--date" option of commands from the "git log" family takes "human" and "auto" as valid values. * yn/complete-date-format-options: completion: add human and auto: date format