summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-09-10ssh signing: test that gpg fails for unknown keysLibravatar Fabian Stelzer1-1/+28
Test that verify-commit/tag will fail when a gpg key is completely unknown. To do this we have to generate a key, use it for a signature and delete it from our keyring aferwards completely. Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-10ssh signing: tests for logs, tags & push certsLibravatar Fabian Stelzer3-0/+285
Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-10ssh signing: duplicate t7510 tests for commitsLibravatar Fabian Stelzer1-0/+398
Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-10ssh signing: verify signatures using ssh-keygenLibravatar Fabian Stelzer3-2/+252
To verify a ssh signature we first call ssh-keygen -Y find-principal to look up the signing principal by their public key from the allowedSignersFile. If the key is found then we do a verify. Otherwise we only validate the signature but can not verify the signers identity. Verification uses the gpg.ssh.allowedSignersFile (see ssh-keygen(1) "ALLOWED SIGNERS") which contains valid public keys and a principal (usually user@domain). Depending on the environment this file can be managed by the individual developer or for example generated by the central repository server from known ssh keys with push access. This file is usually stored outside the repository, but if the repository only allows signed commits/pushes, the user might choose to store it in the repository. To revoke a key put the public key without the principal prefix into gpg.ssh.revocationKeyring or generate a KRL (see ssh-keygen(1) "KEY REVOCATION LISTS"). The same considerations about who to trust for verification as with the allowedSignersFile apply. Using SSH CA Keys with these files is also possible. Add "cert-authority" as key option between the principal and the key to mark it as a CA and all keys signed by it as valid for this CA. See "CERTIFICATES" in ssh-keygen(1). Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-10ssh signing: provide a textual signing_key_idLibravatar Fabian Stelzer3-4/+66
For ssh the user.signingkey can be a filename/path or even a literal ssh pubkey. In push certs and textual output we prefer the ssh fingerprint instead. Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-10ssh signing: retrieve a default key from ssh-agentLibravatar Fabian Stelzer3-3/+77
If user.signingkey is not set and a ssh signature is requested we call gpg.ssh.defaultKeyCommand (typically "ssh-add -L") and use the first key we get Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-10ssh signing: add ssh key format and signing codeLibravatar Fabian Stelzer3-10/+137
Implements the actual sign_buffer_ssh operation and move some shared cleanup code into a strbuf function Set gpg.format = ssh and user.signingkey to either a ssh public key string (like from an authorized_keys file), or a ssh key file. If the key file or the config value itself contains only a public key then the private key needs to be available via ssh-agent. gpg.ssh.program can be set to an alternative location of ssh-keygen. A somewhat recent openssh version (8.2p1+) of ssh-keygen is needed for this feature. Since only ssh-keygen is needed it can this way be installed seperately without upgrading your system openssh packages. Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-10ssh signing: add test prereqsLibravatar Fabian Stelzer1-0/+28
Generate some ssh keys and a allowedSignersFile for testing Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-10ssh signing: preliminary refactoring and clean-upLibravatar Fabian Stelzer5-50/+74
Openssh v8.2p1 added some new options to ssh-keygen for signature creation and verification. These allow us to use ssh keys for git signatures easily. In our corporate environment we use PIV x509 Certs on Yubikeys for email signing/encryption and ssh keys which I think is quite common (at least for the email part). This way we can establish the correct trust for the SSH Keys without setting up a separate GPG Infrastructure (which is still quite painful for users) or implementing x509 signing support for git (which lacks good forwarding mechanisms). Using ssh agent forwarding makes this feature easily usable in todays development environments where code is often checked out in remote VMs / containers. In such a setup the keyring & revocationKeyring can be centrally generated from the x509 CA information and distributed to the users. To be able to implement new signing formats this commit: - makes the sigc structure more generic by renaming "gpg_output" to "output" - introduces function pointers in the gpg_format structure to call format specific signing and verification functions - moves format detection from verify_signed_buffer into the check_signature api function and calls the format specific verify - renames and wraps sign_buffer to handle format specific signing logic as well Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-07-16The fifth batchLibravatar Junio C Hamano1-0/+29
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-07-16Merge branch 'ds/gender-neutral-doc'Libravatar Junio C Hamano11-16/+14
Update the documentation not to assume users are of certain gender and adds to guidelines to do so. * ds/gender-neutral-doc: *: fix typos comments: avoid using the gender of our users doc: avoid using the gender of other people
2021-07-16Merge branch 'jt/partial-clone-submodule-1'Libravatar Junio C Hamano14-82/+196
Prepare the internals for lazily fetching objects in submodules from their promisor remotes. * jt/partial-clone-submodule-1: promisor-remote: teach lazy-fetch in any repo run-command: refactor subprocess env preparation submodule: refrain from filtering GIT_CONFIG_COUNT promisor-remote: support per-repository config repository: move global r_f_p_c to repo struct
2021-07-16Merge branch 'ab/struct-init'Libravatar Junio C Hamano29-64/+76
Code cleanup around struct_type_init() functions. * ab/struct-init: string-list.h users: change to use *_{nodup,dup}() string-list.[ch]: add a string_list_init_{nodup,dup}() dir.[ch]: replace dir_init() with DIR_INIT *.c *_init(): define in terms of corresponding *_INIT macro *.h: move some *_INIT to designated initializers
2021-07-16Merge branch 'dd/test-stdout-count-lines'Libravatar Junio C Hamano3-76/+98
Tiny test clean-up. * dd/test-stdout-count-lines: t6402: preserve git exit status code t6400: preserve git ls-files exit status code test-lib-functions: introduce test_stdout_line_count
2021-07-16Merge branch 'hn/refs-test-cleanup'Libravatar Junio C Hamano2-8/+6
Test clean-up. * hn/refs-test-cleanup: t7509: avoid direct file access for writing CHERRY_PICK_HEAD t1415: avoid direct filesystem access for writing refs
2021-07-16Merge branch 'rs/khash-alloc-cleanup'Libravatar Junio C Hamano1-9/+5
Code clean-up. * rs/khash-alloc-cleanup: khash: clarify that allocations never fail
2021-07-16Merge branch 'ar/help-micro-cleanup'Libravatar Junio C Hamano1-9/+8
Tiny code clean-up. * ar/help-micro-cleanup: help: convert git_cmd to page in one place
2021-07-16Merge branch 'ar/submodule-helper-include-cleanup'Libravatar Junio C Hamano1-1/+0
Code clean-up. * ar/submodule-helper-include-cleanup: submodule--helper: remove redundant include
2021-07-16Merge branch 'ab/bundle-updates'Libravatar Junio C Hamano4-65/+104
Code clean-up and leak plugging in "git bundle". * ab/bundle-updates: bundle: remove "ref_list" in favor of string-list.c API bundle.c: use a temporary variable for OIDs and names bundle cmd: stop leaking memory from parse_options_cmd_bundle()
2021-07-16Merge branch 'hn/refs-iterator-peel-returns-boolean'Libravatar Junio C Hamano4-3/+6
Tiny API tweak. * hn/refs-iterator-peel-returns-boolean: refs: make explicit that ref_iterator_peel returns boolean
2021-07-16Merge branch 'ab/mktag-tests'Libravatar Junio C Hamano1-15/+106
Fill test gaps. * ab/mktag-tests: mktag tests: test fast-export mktag tests: test for-each-ref mktag tests: test update-ref and reachable fsck mktag tests: test hash-object --literally and unreachable fsck mktag tests: invert --no-strict test mktag tests: parse out options in helper
2021-07-16Merge branch 'ab/show-branch-tests'Libravatar Junio C Hamano3-73/+155
Fill test gaps. * ab/show-branch-tests: show-branch tests: add missing tests show-branch: don't <COLOR></RESET> for space characters show-branch tests: modernize test code show-branch tests: rename the one "show-branch" test file
2021-07-16Merge branch 'ab/fetch-negotiate-segv-fix'Libravatar Junio C Hamano5-8/+38
Code recently added to support common ancestry negotiation during "git push" did not sanity check its arguments carefully enough. * ab/fetch-negotiate-segv-fix: fetch: fix segfault in --negotiate-only without --negotiation-tip=* fetch: document the --negotiate-only option send-pack.c: move "no refs in common" abort earlier
2021-07-16Merge branch 'ab/make-delete-on-error'Libravatar Junio C Hamano1-11/+18
Use ".DELETE_ON_ERROR" pseudo target to simplify our Makefile. * ab/make-delete-on-error: Makefile: add and use the ".DELETE_ON_ERROR" flag
2021-07-16Merge branch 'ew/mmap-failures'Libravatar Junio C Hamano5-5/+22
Error message update. * ew/mmap-failures: xmmap: inform Linux users of tuning knobs on ENOMEM
2021-07-16Merge branch 'js/config-mak-windows-pcre-fix'Libravatar Junio C Hamano1-1/+1
Whitespace fix. * js/config-mak-windows-pcre-fix: config.mak.uname: PCRE1 cleanup
2021-07-16Merge branch 'js/gfw-system-config-loc-fix'Libravatar Junio C Hamano3-7/+21
Update the location of system-side configuration file on Windows. * js/gfw-system-config-loc-fix: config: normalize the path of the system gitconfig cmake(windows): set correct path to the system Git config mingw: move Git for Windows' system config where users expect it
2021-07-16Merge branch 'ks/submodule-cleanup'Libravatar Junio C Hamano1-7/+7
Code cleanup. * ks/submodule-cleanup: submodule: remove unnecessary `prefix` based option logic
2021-07-16Merge branch 'tb/midx-use-checksum'Libravatar Junio C Hamano6-18/+52
When rebuilding the multi-pack index file reusing an existing one, we used to blindly trust the existing file and ended up carrying corrupted data into the updated file, which has been corrected. * tb/midx-use-checksum: midx: report checksum mismatches during 'verify' midx: don't reuse corrupt MIDXs when writing commit-graph: rewrite to use checksum_valid() csum-file: introduce checksum_valid()
2021-07-16Merge branch 'en/merge-dir-rename-corner-case-fix'Libravatar Junio C Hamano3-7/+193
The merge code had funny interactions between content based rename detection and directory rename detection. * en/merge-dir-rename-corner-case-fix: merge-recursive: handle rename-to-self case merge-ort: ensure we consult df_conflict and path_conflicts t6423: test directory renames causing rename-to-self
2021-07-16Merge branch 'en/ort-perf-batch-13'Libravatar Junio C Hamano4-34/+612
Performance tweaks of "git merge -sort" around lazy fetching of objects. * en/ort-perf-batch-13: merge-ort: add prefetching for content merges diffcore-rename: use a different prefetch for basename comparisons diffcore-rename: allow different missing_object_cb functions t6421: add tests checking for excessive object downloads during merge promisor-remote: output trace2 statistics for number of objects fetched
2021-07-16Merge branch 'en/ort-perf-batch-12'Libravatar Junio C Hamano3-26/+60
More fix-ups and optimization to "merge -sort". * en/ort-perf-batch-12: merge-ort: miscellaneous touch-ups Fix various issues found in comments diffcore-rename: avoid unnecessary strdup'ing in break_idx merge-ort: replace string_list_df_name_compare with faster alternative
2021-07-13The fourth batchLibravatar Junio C Hamano1-0/+26
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-07-13Merge branch 'rs/grep-parser-fix'Libravatar Junio C Hamano2-0/+11
"git grep --and -e foo" ought to have been diagnosed as an error but instead segfaulted, which has been corrected. * rs/grep-parser-fix: grep: report missing left operand of --and
2021-07-13Merge branch 'bk/doc-commit-typofix'Libravatar Junio C Hamano1-1/+1
Doc typo/grammo-fix. * bk/doc-commit-typofix: Documentation: fix typo in the --patch option of the commit command
2021-07-13Merge branch 'dc/p4-binary-submit-fix'Libravatar Junio C Hamano1-2/+5
Prevent "git p4" from failing to submit changes to binary file. * dc/p4-binary-submit-fix: git-p4: fix failed submit by skip non-text data files
2021-07-13Merge branch 'ab/pre-auto-gc-hook-test'Libravatar Junio C Hamano1-0/+46
Test fix. * ab/pre-auto-gc-hook-test: gc tests: add a test for the "pre-auto-gc" hook
2021-07-13Merge branch 'jk/union-merge-binary'Libravatar Junio C Hamano2-4/+24
The "union" conflict resolution variant misbehaved when used with binary merge driver. * jk/union-merge-binary: ll_union_merge(): rename path_unused parameter ll_union_merge(): pass name labels to ll_xdl_merge() ll_binary_merge(): handle XDL_MERGE_FAVOR_UNION
2021-07-13Merge branch 'mr/cmake'Libravatar Junio C Hamano1-9/+28
CMake update. * mr/cmake: cmake: add warning for ignored MSGFMT_EXE cmake: create compile_commands.json by default cmake: add knob to disable vcpkg
2021-07-13Merge branch 'ab/describe-tests-fix'Libravatar Junio C Hamano1-62/+72
Various updates to tests around "git describe" * ab/describe-tests-fix: describe tests: support -C in "check_describe" describe tests: fix nested "test_expect_success" call describe tests: don't rely on err.actual from "check_describe" describe tests: refactor away from glob matching describe tests: improve test for --work-tree & --dirty
2021-07-13Merge branch 'ab/pickaxe-pcre2'Libravatar Junio C Hamano14-107/+312
Rewrite the backend for "diff -G/-S" to use pcre2 engine when available. * ab/pickaxe-pcre2: (22 commits) xdiff-interface: replace discard_hunk_line() with a flag xdiff users: use designated initializers for out_line pickaxe -G: don't special-case create/delete pickaxe -G: terminate early on matching lines xdiff-interface: allow early return from xdiff_emit_line_fn xdiff-interface: prepare for allowing early return pickaxe -S: slightly optimize contains() pickaxe: rename variables in has_changes() for brevity pickaxe -S: support content with NULs under --pickaxe-regex pickaxe: assert that we must have a needle under -G or -S pickaxe: refactor function selection in diffcore-pickaxe() perf: add performance test for pickaxe pickaxe/style: consolidate declarations and assignments diff.h: move pickaxe fields together again pickaxe: die when --find-object and --pickaxe-all are combined pickaxe: die when -G and --pickaxe-regex are combined pickaxe tests: add missing test for --no-pickaxe-regex being an error pickaxe tests: test for -G, -S and --find-object incompatibility pickaxe tests: add test for "log -S" not being a regex pickaxe tests: add test for diffgrep_consume() internals ...
2021-07-13Merge branch 'hn/prep-tests-for-reftable'Libravatar Junio C Hamano18-159/+170
Preliminary clean-up of tests before the main reftable changes hits the codebase. * hn/prep-tests-for-reftable: (22 commits) t1415: set REFFILES for test specific to storage format t4202: mark bogus head hash test with REFFILES t7003: check reflog existence only for REFFILES t7900: stop checking for loose refs t1404: mark tests that muck with .git directly as REFFILES. t2017: mark --orphan/logAllRefUpdates=false test as REFFILES t1414: mark corruption test with REFFILES t1407: require REFFILES for for_each_reflog test test-lib: provide test prereq REFFILES t5304: use "reflog expire --all" to clear the reflog t5304: restyle: trim empty lines, drop ':' before > t7003: use rev-parse rather than FS inspection t5000: inspect HEAD using git-rev-parse t5000: reformat indentation to the latest fashion t1301: fix typo in error message t1413: use tar to save and restore entire .git directory t1401-symbolic-ref: avoid direct filesystem access t1401: use tar to snapshot and restore repo state t5601: read HEAD using rev-parse t9300: check ref existence using test-helper rather than a file system check ...
2021-07-13Merge branch 'fc/push-simple-updates-cleanup'Libravatar Junio C Hamano1-59/+34
Some more code and doc clarification around "git push". * fc/push-simple-updates-cleanup: push: don't get a full remote object push: only check same_remote when needed push: remove trivial function push: remove redundant check push: factor out the typical case push: get rid of all the setup_push_* functions push: trivial simplifications push: make setup_push_* return the dst push: only get the branch when needed push: factor out null branch check push: split switch cases push: return immediately in trivial switch case push: create new get_upstream_ref() helper
2021-07-13Merge branch 'fc/push-simple-updates'Libravatar Junio C Hamano2-23/+38
Some code and doc clarification around "git push". * fc/push-simple-updates: doc: push: explain default=simple correctly push: remove unused code in setup_push_upstream() push: simplify setup_push_simple() push: reorganize setup_push_simple() push: copy code to setup_push_simple() push: hedge code of default=simple push: rename !triangular to same_remote
2021-07-13Merge branch 'zh/cat-file-batch-fix'Libravatar Junio C Hamano2-6/+26
"git cat-file --batch-all-objects"" misbehaved when "--batch" is in use and did not ask for certain object traits. * zh/cat-file-batch-fix: cat-file: merge two block into one cat-file: handle trivial --batch format with --batch-all-objects
2021-07-08The third batchLibravatar Junio C Hamano1-0/+77
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-07-08Merge branch 'js/stop-exporting-bogus-columns'Libravatar Junio C Hamano1-3/+13
When we cannot figure out how wide the terminal is, we use a fallback value of 80 ourselves (which cannot be avoided), but when we run the pager, we export it in COLUMNS, which forces the pager to use the hardcoded value, even when the pager is perfectly capable to figure it out itself. Stop exporting COLUMNS when we fall back on the hardcoded default value for our own use. * js/stop-exporting-bogus-columns: pager: avoid setting COLUMNS when we're guessing its value
2021-07-08Merge branch 'dd/document-log-decorate-default'Libravatar Junio C Hamano1-1/+3
Doc clean-up. * dd/document-log-decorate-default: doc/log: correct default for --decorate
2021-07-08Merge branch 'ar/test-code-cleanup'Libravatar Junio C Hamano7-8/+8
Test code clean-up. * ar/test-code-cleanup: t: fix whitespace around &&
2021-07-08Merge branch 'ba/object-info'Libravatar Junio C Hamano1-1/+1
Code clean-up. * ba/object-info: protocol-caps.h: add newline at end of file