summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-04-06git-compat-util: really support openssl as a source of entropyCarlo Marcelo Arenas Belón3-1/+6
05cd988dce5 (wrapper: add a helper to generate numbers from a CSPRNG, 2022-01-17), configure openssl as the source for entropy in NON-STOP but doesn't add the needed header or link options. Since the only system that is configured to use openssl as a source of entropy is NON-STOP, add the header unconditionally, and -lcrypto to the list of external libraries. An additional change is required to make sure a NO_OPENSSL=1 build will be able to work as well (tested on Linux with a modified value of CSPRNG_METHOD = openssl), and the more complex logic that allows for compatibility with APPLE_COMMON_CRYPTO or allowing for simpler ways to link (without libssl) has been punted for now. Reported-by: Randall Becker <rsbecker@nexbridge.com> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-06submodule.h: use a named enum for RECURSE_SUBMODULES_*Philippe Blain2-2/+2
Using a named enum allows casting an integer to the enum type in both GDB and LLDB: $ gdb -q -ex 'b wt-status.c:44' -ex r --args ./git status (gdb) p (enum color_wt_status) slot $1 = WT_STATUS_ONBRANCH $ lldb -o 'b wt-status.c:44' -o r -- ./git status (lldb) p (color_wt_status) slot (color_wt_status) $0 = WT_STATUS_ONBRANCH In LLDB, it's also required to cast in the reversed direction, i.e. cast an enum constant into its corresponding integer: (lldb) p (int) color_wt_status::WT_STATUS_ONBRANCH (int) $1 = 8 Name the enum listing the different RECURSE_SUBMODULES_* modes, to make debugging easier. For example, when stepping through a part of the code where an int is compared with a constant in this enum, it allows casting the int to the enum type or vice-versa, after quickly checking where the enum constant is declared and learning the enum name. As to not make this patch a debug-only change, convert the 'fetch_recurse' member of 'struct submodule' to use the newly named enum. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Reviewed-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-06ls-tree: `-l` should not imply recursive listingJosh Steadmon1-1/+1
In 9c4d58ff2c (ls-tree: split up "fast path" callbacks, 2022-03-23), a refactoring of the various read_tree_at() callbacks caused us to unconditionally recurse into directories if `-l` (long format) was passed on the command line, regardless of whether or not we also pass the `-r` (recursive) flag. Fix this by making show_tree_long() return the value of `recurse`, rather than always returning 1. This value is interpreted by read_tree_at() to be a signal on whether or not to recurse. Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-06t3501: remove test -f and stop ignoring git <cmd> exit codeKhalid Masum1-5/+4
In the test 'cherry-pick after renaming branch', stop checking for the presence of a file (opos) because we are going to "grep" in it in the same test and the lack of it will be noticed as a failure anyway. In the test 'revert after renaming branch', instead of allowing any random contents as long as a known phrase is not there in it, we can expect the exact outcome---after the successful revert of "added", the contents of file "spoo" should become identical to what was in file "oops" in the "initial" commit. This test also contains 'test -f' that verifies presence of a file, but we have a helper function to do the same thing. Replace it with appropriate helper function 'test_path_is_file' for better readability and better error messages. In both tests, we will not notice when "git rev-parse" starts segfaulting without emitting any output. The 'test' command will end up being just "test =", which yields success. Use the 'test_cmp_rev' helper to make sure we will notice such a breakage. Signed-off-by: Khalid Masum <khalid.masum.92@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-06commit, sequencer: turn off break_opt for commit summaryRené Scharfe2-1/+31
dc6b1d92ca (wt-status: use settings from git_diff_ui_config, 2018-05-04) disabled diffopt.break_opt for diffstats shown by git status and in commit templates. For git status there isn't even a way to enable it. Make the commit summary (shown after the commit) consistent by disabling it there as well. Reported-by: Laurent Lyaudet <laurent.lyaudet@gmail.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-06l10n: tr: v2.36.0 round 1Emir SARI1-3958/+4479
Signed-off-by: Emir SARI <emir_sari@icloud.com>
2022-04-06l10n: git.pot: v2.36.0 round 1 (192 new, 106 removed)Jiang Xin1-3828/+4320
Generate po/git.pot from v2.36.0-rc0 for git v2.36.0 l10n round 1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2022-04-06Merge branch 'master' of github.com:git-l10n/git-poJiang Xin2-4268/+4152
* 'master' of github.com:git-l10n/git-po: l10n: pt_PT: update TEAMS file l10n: pt_PT: update Portuguese translation
2022-04-04Git 2.36-rc0v2.36.0-rc0Junio C Hamano2-1/+33
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-04Merge branch 'pw/worktree-list-with-z'Junio C Hamano3-20/+55
"git worktree list --porcelain" did not c-quote pathnames and lock reasons with unsafe bytes correctly, which is worked around by introducing NUL terminated output format with "-z". * pw/worktree-list-with-z: worktree: add -z option for list subcommand
2022-04-04Merge branch 'jc/coding-guidelines-decl-in-for-loop'Junio C Hamano1-1/+4
Coding Guidelines clarification. * jc/coding-guidelines-decl-in-for-loop: CodingGuidelines: give deadline for "for (int i = 0; ..."
2022-04-04Merge branch 'vd/mv-refresh-stat'Junio C Hamano2-2/+34
"git mv" failed to refresh the cached stat information for the entry it moved. * vd/mv-refresh-stat: mv: refresh stat info for moved entry
2022-04-04Merge branch 'jh/builtin-fsmonitor-part2'Junio C Hamano38-106/+4326
Built-in fsmonitor (part 2). * jh/builtin-fsmonitor-part2: (30 commits) t7527: test status with untracked-cache and fsmonitor--daemon fsmonitor: force update index after large responses fsmonitor--daemon: use a cookie file to sync with file system fsmonitor--daemon: periodically truncate list of modified files t/perf/p7519: add fsmonitor--daemon test cases t/perf/p7519: speed up test on Windows t/perf/p7519: fix coding style t/helper/test-chmtime: skip directories on Windows t/perf: avoid copying builtin fsmonitor files into test repo t7527: create test for fsmonitor--daemon t/helper/fsmonitor-client: create IPC client to talk to FSMonitor Daemon help: include fsmonitor--daemon feature flag in version info fsmonitor--daemon: implement handle_client callback compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener on MacOS compat/fsmonitor/fsm-listen-darwin: add MacOS header files for FSEvent compat/fsmonitor/fsm-listen-win32: implement FSMonitor backend on Windows fsmonitor--daemon: create token-based changed path cache fsmonitor--daemon: define token-ids fsmonitor--daemon: add pathname classification fsmonitor--daemon: implement 'start' command ...
2022-04-04Merge branch 'tk/ambiguous-fetch-refspec'Junio C Hamano5-9/+78
Give hint when branch tracking cannot be established because fetch refspecs from multiple remote repositories overlap. * tk/ambiguous-fetch-refspec: tracking branches: add advice to ambiguous refspec error
2022-04-04Merge branch 'rc/fetch-refetch'Junio C Hamano15-22/+197
"git fetch --refetch" learned to fetch everything without telling the other side what we already have, which is useful when you cannot trust what you have in the local object store. * rc/fetch-refetch: docs: mention --refetch fetch option fetch: after refetch, encourage auto gc repacking t5615-partial-clone: add test for fetch --refetch fetch: add --refetch option builtin/fetch-pack: add --refetch option fetch-pack: add refetch fetch-negotiator: add specific noop initializer
2022-04-04Merge branch 'jc/mailsplit-warn-on-tty'Junio C Hamano1-0/+3
"git am" can read from the standard input when no mailbox is given on the command line, but the end-user gets no indication when it happens, making Git appear stuck. * jc/mailsplit-warn-on-tty: am/apply: warn if we end up reading patches from terminal
2022-04-04Merge branch 'ns/trace2-fsync-stat'Junio C Hamano4-0/+22
Trace2 code has been taught to report stats for fsync operations. * ns/trace2-fsync-stat: trace2: add stats for fsync operations
2022-04-04Merge branch 'gc/branch-recurse-submodules-fix'Junio C Hamano3-16/+76
A handful of obvious clean-ups around a topic that is already in 'master'. * gc/branch-recurse-submodules-fix: branch.c: simplify advice-and-die sequence branch: rework comments for future developers branch: remove negative exit code branch --set-upstream-to: be consistent when advising branch: give submodule updating advice before exit branch: support more tracking modes when recursing
2022-04-04Merge branch 'ns/fsync-or-die-message-fix'Junio C Hamano1-4/+4
When creating a loose object file, we didn't report the exact filename of the file we failed to fsync, even though the information was readily available, which has been corrected. * ns/fsync-or-die-message-fix: object-file: pass filename to fsync_or_die
2022-04-04Merge branch 'ns/core-fsyncmethod'Junio C Hamano2-3/+3
A couple of fix-up to a topic that is now in 'master'. * ns/core-fsyncmethod: core.fsyncmethod: correctly camel-case warning message core.fsync: fix incorrect expression for default configuration
2022-04-04Merge branch 'dp/worktree-repair-in-usage'Junio C Hamano1-0/+1
Usage string fix. * dp/worktree-repair-in-usage: worktree: include repair cmd in usage
2022-04-04Merge branch 'ab/reftable-aix-xlc-12'Junio C Hamano3-6/+18
Work around AIX C compiler that does not seem to grok initialization of a union member of a struct. * ab/reftable-aix-xlc-12: reftable: make assignments portable to AIX xlc v12.01
2022-04-04Merge branch 'gc/submodule-update-part2'Junio C Hamano2-435/+361
Move more "git submodule update" to C. * gc/submodule-update-part2: submodule--helper: remove forward declaration submodule: move core cmd_update() logic to C submodule--helper: reduce logic in run_update_procedure() submodule--helper: teach update_data more options builtin/submodule--helper.c: rename option struct to "opt" submodule update: use die_message() submodule--helper: run update using child process struct
2022-04-04Merge branch 'ds/t7700-kept-pack-test'Junio C Hamano2-37/+54
Test clean-up. * ds/t7700-kept-pack-test: test-lib-functions: remove test_subcommand_inexact t7700: check post-condition in kept-pack test
2022-04-04Merge branch 'ds/partial-bundle-more'Junio C Hamano8-47/+94
Code clean-up. * ds/partial-bundle-more: pack-objects: lazily set up "struct rev_info", don't leak bundle: output hash information in 'verify' bundle: move capabilities to end of 'verify' pack-objects: parse --filter directly into revs.filter pack-objects: move revs out of get_object_list() list-objects-filter: remove CL_ARG__FILTER
2022-04-04Merge branch 'tl/ls-tree-oid-only'Junio C Hamano6-92/+490
"git ls-tree" learns "--oid-only" option, similar to "--name-only", and more generalized "--format" option. * tl/ls-tree-oid-only: ls-tree: split up "fast path" callbacks ls-tree: detect and error on --name-only --name-status ls-tree: support --object-only option for "git-ls-tree" ls-tree: introduce "--format" option cocci: allow padding with `strbuf_addf()` ls-tree: introduce struct "show_tree_data" ls-tree: slightly refactor `show_tree()` ls-tree: fix "--name-only" and "--long" combined use bug ls-tree: simplify nesting if/else logic in "show_tree()" ls-tree: rename "retval" to "recurse" in "show_tree()" ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" ls-tree: use "enum object_type", not {blob,tree,commit}_type ls-tree: add missing braces to "else" arms ls-tree: remove commented-out code ls-tree tests: add tests for --name-status
2022-04-04Merge branch 'ab/reflog-parse-options'Junio C Hamano6-67/+165
"git reflog" command now uses parse-options API to parse its command line options. * ab/reflog-parse-options: reflog: fix 'show' subcommand's argv reflog [show]: display sensible -h output reflog: convert to parse_options() API reflog exists: use parse_options() API git reflog [expire|delete]: make -h output consistent with SYNOPSIS reflog: move "usage" variables and use macros reflog tests: add missing "git reflog exists" tests reflog: refactor cmd_reflog() to "if" branches reflog.c: indent argument lists
2022-04-03mergetools: add description to all diff/merge toolsFernando Ramos20-0/+160
The output of `git mergetool --tool-help` and `git difftool --tool-help` only showed the `alias` of each available merge/diff tool. It is not always obvious what tool these `aliases` end up using (ex: `opendiff` runs `FileMerge` and `bc` runs `Beyond Compare`). This commit adds a short description to each of them to help the user identify the `alias` they want. Signed-off-by: Fernando Ramos <greenfoo@u92.eu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-03vimdiff: add tool documentationFernando Ramos6-5/+277
Running 'git {merge,diff}tool --tool-help' now also prints usage information about the vimdiff tool (and its variants) instead of just its name. Two new functions ('diff_cmd_help()' and 'merge_cmd_help()') have been added to the set of functions that each merge tool (ie. scripts found inside "mergetools/") can overwrite to provided tool specific information. Right now, only 'mergetools/vimdiff' implements these functions, but other tools are encouraged to do so in the future, specially if they take configuration options not explained anywhere else (as it is the case with the 'vimdiff' tool and the new 'layout' option) Note that the function 'show_tool_names', used in the implementation of 'git mergetool --tool-help', is also used in Documentation/Makefile to generate the list of allowed values for the configuration variables '{diff,merge}.{gui,}tool'. Adjust the rule so its output is an Asciidoc "description list" instead of a plain list, with the tool name as the item and the newly added tool description as the description. In addition, a section has been added to "Documentation/git-mergetool.txt" to explain the new "layout" configuration option with examples. Helped-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Fernando Ramos <greenfoo@u92.eu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-03Merge branch 'ds/partial-bundle-more' into ab/plug-leak-in-revisionsJunio C Hamano8-47/+94
* ds/partial-bundle-more: pack-objects: lazily set up "struct rev_info", don't leak bundle: output hash information in 'verify' bundle: move capabilities to end of 'verify' pack-objects: parse --filter directly into revs.filter pack-objects: move revs out of get_object_list() list-objects-filter: remove CL_ARG__FILTER
2022-04-01git-p4: sort importsJoel Holdsworth1-8/+10
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: seperate multiple statements onto seperate linesJoel Holdsworth1-2/+5
PEP8 discourages the use of compound statements where there are multiple statements on a single line in the "Other Recommendations" section: https://www.python.org/dev/peps/pep-0008/#other-recommendations Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: move inline comments to line aboveJoel Holdsworth1-3/+7
PEP8 recommends that all inline comments should be separated from code by two spaces, in the "Inline Comments" section: https://www.python.org/dev/peps/pep-0008/#inline-comments However, because all instances of these inline comments extended to an excessive line length, they have been moved onto a seprate line. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: only seperate code blocks by a single empty lineJoel Holdsworth1-3/+0
PEP8 recommends that blank lines should be used sparingly to separate sections in the "Blank Lines" section: https://www.python.org/dev/peps/pep-0008/#blank-lines This patch replaces all double blank-line separations with a single blank line. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: compare to singletons with "is" and "is not"Joel Holdsworth1-3/+3
PEP8 recommends that comparisons with singletons such as None should be done with "is" and "is not", and never equality operators. This guideline is described here: https://www.python.org/dev/peps/pep-0008/#programming-recommendations Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: normalize indentation of lines in conditionalsJoel Holdsworth1-9/+7
PEP8 recommends that when wrapping the arguments of conditional statements, an extra level of indentation should be added to distinguish arguments from the body of the statement. This guideline is described here: https://www.python.org/dev/peps/pep-0008/#indentation This patch either adds the indentation, or removes unnecessary wrapping. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: ensure there is a single space around all operatorsJoel Holdsworth1-5/+5
PEP8 requires that binary operators such as assignment and comparison operators should always be surrounded by a pair of single spaces, and recommends that all other binary operators should typically be surround by single spaces. The recommendation is given here in the "Other Recommendations" section https://www.python.org/dev/peps/pep-0008/#other-recommendations Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: ensure every comment has a single #Joel Holdsworth1-6/+6
PEP8 recommends that every comment should begin with a single '#' character. This guideline is described here: https://www.python.org/dev/peps/pep-0008/#comments Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: remove spaces between dictionary keys and colonsJoel Holdsworth1-7/+7
PEP8 makes no specific recommendation about spaces preceding colons in dictionary declarations, but all the code examples contained with it declare dictionaries with a single space after the colon, and none before. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: remove redundant backslash-continuations inside bracketsJoel Holdsworth1-9/+9
PEP8 recommends that backslash line continuations should only be used for line-breaks outside parentheses. This recommendation is described in the "Maximum Line Length" section: https://www.python.org/dev/peps/pep-0008/#maximum-line-length Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: remove extraneous spaces before function argumentsJoel Holdsworth1-11/+11
PEP8 recommends that there should be no spaces before function arguments in the in the "Pet Peeves" section: https://www.python.org/dev/peps/pep-0008/#pet-peeves Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: place a single space after every commaJoel Holdsworth1-9/+9
This patch improves consistency across git-p4 by ensuring all command separated arguments to function invocations, tuples and lists are separated by commas with a single space following. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: removed brackets when assigning multiple return valuesJoel Holdsworth1-19/+19
In several places, git-p4 contains code of the form: (a, b) = foo() In each case, multiple values are returned through a tuple or a list and bound into multiple values. The brackets around the assigned variables are redundant and can be removed: a, b = foo() Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: remove spaces around default argumentsJoel Holdsworth1-6/+6
PEP8 recommends that there should be no spaces around the = sign of default argument values of functions. This guideline is described here: https://www.python.org/dev/peps/pep-0008/#other-recommendations Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: remove padding from lists, tuples and function argumentsJoel Holdsworth1-18/+18
PEP8 discourages use of extraneous padding inside any parenthesis, brackets or braces in the "Pet Peeves" section: https://www.python.org/dev/peps/pep-0008/#pet-peeves This patch removes all cases of these. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: sort and de-duplcate pylint disable listJoel Holdsworth1-7/+22
git-p4 contains configuration commands for pylint embedded in the header comment. Previously, these were combined onto single lines and not alphabetically sorted. This patch breaks each disable command onto a separate line to give cleaner diffs, removed duplicate entries, and sorts the list alphabetically. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: remove commented codeJoel Holdsworth1-7/+0
Previously, the script contained commented code including Python 2 print statements. Presumably, these were used as a developer aid at some point in history. However, the commented code is generally undesirable, and this commented code serves no useful purpose. Therefore this patch removes it. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: convert descriptive class and function comments into docstringsJoel Holdsworth1-70/+94
Previously, a small number of functions, methods and classes were documented using comments. This patch improves consistency by converting these into docstrings similar to those that already exist in the script. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: improve consistency of docstring formattingJoel Holdsworth1-129/+154
This patch attempts to improve the consistency of the docstrings by making the following changes: - Rewraps all docstrings to a 79-character column limit. - Adds a full stop at the end of every docstring. - Removes any spaces after the opening triple-quotes of all docstrings. - Sets the hanging indent of multi-line docstrings to 3-spaces. - Ensures that the closing triple-quotes of multi-line docstrings are always on a new line indented by a 3-space indent. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-04-01git-p4: indent with 4-spacesJoel Holdsworth1-9/+9
PEP8 recommends that all code should be indented in 4-space units. This guideline is described here: https://www.python.org/dev/peps/pep-0008/#indentation Previously git-p4 had multiple cases where code was indented with a non-multiple of 4-spaces. This patch fixes each of these. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>