summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-01-21Merge branch 'tl/ls-tree-code-clean-up'Junio C Hamano
Code clean-up. * tl/ls-tree-code-clean-up: t3104: remove shift code in 'test_ls_tree_format' ls-tree: cleanup the redundant SPACE ls-tree: make "line_termination" less generic ls-tree: fold "show_tree_data" into "cb" struct ls-tree: use a "struct options" ls-tree: don't use "show_tree_data" for "fast" callbacks
2023-01-21Merge branch 'ph/parse-date-reduced-precision'Junio C Hamano
Loosen date parsing heuristics. * ph/parse-date-reduced-precision: date.c: allow ISO 8601 reduced precision times
2023-01-21Merge branch 'pw/rebase-exec-cleanup'Junio C Hamano
Code clean-up. * pw/rebase-exec-cleanup: rebase: cleanup "--exec" option handling
2023-01-21Merge branch 'pb/doc-orig-head'Junio C Hamano
Document ORIG_HEAD a bit more. * pb/doc-orig-head: git-rebase.txt: add a note about 'ORIG_HEAD' being overwritten revisions.txt: be explicit about commands writing 'ORIG_HEAD' git-merge.txt: mention 'ORIG_HEAD' in the Description git-reset.txt: mention 'ORIG_HEAD' in the Description git-cherry-pick.txt: do not use 'ORIG_HEAD' in example
2023-01-21Merge branch 'yo/doc-use-more-switch-c'Junio C Hamano
Doc update. * yo/doc-use-more-switch-c: doc: add "git switch -c" as another option on detached HEAD
2023-01-21Merge branch 'sk/merge-filtering-strategies-micro-optim'Junio C Hamano
Micro optimization. * sk/merge-filtering-strategies-micro-optim: merge: break out of all_strategy loop when strategy is found
2023-01-21Merge branch 'jk/interop-error'Junio C Hamano
Test helper improvement. * jk/interop-error: t/interop: report which vanilla git command failed
2023-01-21Merge branch 'ar/bisect-doc-update'Junio C Hamano
Doc update. * ar/bisect-doc-update: git-bisect-lk2009: update nist report link git-bisect-lk2009: update java code conventions link
2023-01-21Merge branch 'ar/test-cleanup'Junio C Hamano
Test clean-up. * ar/test-cleanup: t7527: use test_when_finished in 'case insensitive+preserving' t6422: drop commented out code t6003: uncomment test '--max-age=c3, --topo-order'
2023-01-21Merge branch 'jc/doc-diff-patch.txt'Junio C Hamano
Doc update. * jc/doc-diff-patch.txt: docs: link generating patch sections
2023-01-21Merge branch 'es/hooks-and-local-env'Junio C Hamano
Doc update for environment variables set when hooks are invoked. * es/hooks-and-local-env: githooks: discuss Git operations in foreign repositories
2023-01-21Merge branch 'rs/dup-array'Junio C Hamano
Code cleaning. * rs/dup-array: use DUP_ARRAY add DUP_ARRAY do full type check in BARF_UNLESS_COPYABLE factor out BARF_UNLESS_COPYABLE mingw: make argv2 in try_shell_exec() non-const
2023-01-21Merge branch 'jx/t1301-updates'Junio C Hamano
Test updates. * jx/t1301-updates: t1301: do not change $CWD in "shared=all" test case t1301: use test_when_finished for cleanup t1301: fix wrong template dir for git-init
2023-01-20The eighth batchJunio C Hamano
The cURL one hasn't cooked for a week in 'next', but let's fast track it so that linux-musl CI job would be happy. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-20Merge branch 'jk/read-object-cleanup'Junio C Hamano
Code clean-up. * jk/read-object-cleanup: object-file: fix indent-with-space packfile: inline custom read_object() repo_read_object_file(): stop wrapping read_object_file_extended() read_object_file_extended(): drop lookup_replace option streaming: inline call to read_object_file_extended() object-file: inline calls to read_object()
2023-01-20Merge branch 'jk/curl-avoid-deprecated-api'Junio C Hamano
Deal with a few deprecation warning from cURL library. * jk/curl-avoid-deprecated-api: http: support CURLOPT_PROTOCOLS_STR http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
2023-01-19Sync with 'maint'Junio C Hamano
2023-01-19Sync with maint-2.38Junio C Hamano
* maint-2.38: attr: adjust a mismatched data type
2023-01-19Sync with maint-2.37Junio C Hamano
* maint-2.37: attr: adjust a mismatched data type
2023-01-19Sync with maint-2.36Junio C Hamano
* maint-2.36: attr: adjust a mismatched data type
2023-01-19Sync with maint-2.35Junio C Hamano
* maint-2.35: attr: adjust a mismatched data type
2023-01-19Sync with maint-2.34Junio C Hamano
* maint-2.34: attr: adjust a mismatched data type
2023-01-19Sync with maint-2.33Junio C Hamano
* maint-2.33: attr: adjust a mismatched data type
2023-01-19Sync with maint-2.32Junio C Hamano
* maint-2.32: attr: adjust a mismatched data type
2023-01-19Sync with maint-2.31Junio C Hamano
* maint-2.31: attr: adjust a mismatched data type
2023-01-19Sync with maint-2.30Junio C Hamano
* maint-2.30: attr: adjust a mismatched data type
2023-01-19attr: adjust a mismatched data typeJohannes Schindelin
On platforms where `size_t` does not have the same width as `unsigned long`, passing a pointer to the former when a pointer to the latter is expected can lead to problems. Windows and 32-bit Linux are among the affected platforms. In this instance, we want to store the size of the blob that was read in that variable. However, `read_blob_data_from_index()` passes that pointer to `read_object_file()` which expects an `unsigned long *`. Which means that on affected platforms, the variable is not fully populated and part of its value is left uninitialized. (On Big-Endian platforms, this problem would be even worse.) The consequence is that depending on the uninitialized memory's contents, we may erroneously reject perfectly fine attributes. Let's address this by passing a pointer to a variable of the expected data type. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-17http: support CURLOPT_PROTOCOLS_STRJeff King
The CURLOPT_PROTOCOLS (and matching CURLOPT_REDIR_PROTOCOLS) flag was deprecated in curl 7.85.0, and using it generate compiler warnings as of curl 7.87.0. The path forward is to use CURLOPT_PROTOCOLS_STR, but we can't just do so unilaterally, as it was only introduced less than a year ago in 7.85.0. Until that version becomes ubiquitous, we have to either disable the deprecation warning or conditionally use the "STR" variant on newer versions of libcurl. This patch switches to the new variant, which is nice for two reasons: - we don't have to worry that silencing curl's deprecation warnings might cause us to miss other more useful ones - we'd eventually want to move to the new variant anyway, so this gets us set up (albeit with some extra ugly boilerplate for the conditional) There are a lot of ways to split up the two cases. One way would be to abstract the storage type (strbuf versus a long), how to append (strbuf_addstr vs bitwise OR), how to initialize, which CURLOPT to use, and so on. But the resulting code looks pretty magical: GIT_CURL_PROTOCOL_TYPE allowed = GIT_CURL_PROTOCOL_TYPE_INIT; if (...http is allowed...) GIT_CURL_PROTOCOL_APPEND(&allowed, "http", CURLOPT_HTTP); and you end up with more "#define GIT_CURL_PROTOCOL_TYPE" macros than actual code. On the other end of the spectrum, we could just implement two separate functions, one that handles a string list and one that handles bits. But then we end up repeating our list of protocols (http, https, ftp, ftp). This patch takes the middle ground. The run-time code is always there to handle both types, and we just choose which one to feed to curl. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-17http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTIONJeff King
The IOCTLFUNCTION option has been deprecated, and generates a compiler warning in recent versions of curl. We can switch to using SEEKFUNCTION instead. It was added in 2008 via curl 7.18.0; our INSTALL file already indicates we require at least curl 7.19.4. But there's one catch: curl says we should use CURL_SEEKFUNC_{OK,FAIL}, and those didn't arrive until 7.19.5. One workaround would be to use a bare 0/1 here (or define our own macros). But let's just bump the minimum required version to 7.19.5. That version is only a minor version bump from our existing requirement, and is only a 2 month time bump for versions that are almost 13 years old. So it's not likely that anybody cares about the distinction. Switching means we have to rewrite the ioctl functions into seek functions. In some ways they are simpler (seeking is the only operation), but in some ways more complex (the ioctl allowed only a full rewind, but now we can seek to arbitrary offsets). Curl will only ever use SEEK_SET (per their documentation), so I didn't bother implementing anything else, since it would naturally be completely untested. This seems unlikely to change, but I added an assertion just in case. Likewise, I doubt curl will ever try to seek outside of the buffer sizes we've told it, but I erred on the defensive side here, rather than do an out-of-bounds read. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-17http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUTJeff King
The two options do exactly the same thing, but the latter has been deprecated and in recent versions of curl may produce a compiler warning. Since the UPLOAD form is available everywhere (it was introduced in the year 2000 by curl 7.1), we can just switch to it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-17Sync with 'maint'Junio C Hamano
2023-01-17attr: adjust a mismatched data typeJohannes Schindelin
On platforms where `size_t` does not have the same width as `unsigned long`, passing a pointer to the former when a pointer to the latter is expected can lead to problems. Windows and 32-bit Linux are among the affected platforms. In this instance, we want to store the size of the blob that was read in that variable. However, `read_blob_data_from_index()` passes that pointer to `read_object_file()` which expects an `unsigned long *`. Which means that on affected platforms, the variable is not fully populated and part of its value is left uninitialized. (On Big-Endian platforms, this problem would be even worse.) The consequence is that depending on the uninitialized memory's contents, we may erroneously reject perfectly fine attributes. Let's address this by passing a pointer to a variable of the expected data type. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-16Sync with 2.39.1Junio C Hamano
2023-01-16The seventh batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-16Merge branch 'jk/strncmp-to-api-funcs'Junio C Hamano
Code clean-up. * jk/strncmp-to-api-funcs: convert trivial uses of strncmp() to skip_prefix() convert trivial uses of strncmp() to starts_with()
2023-01-16Merge branch 'ar/dup-words-fixes'Junio C Hamano
Typofixes. * ar/dup-words-fixes: *: fix typos which duplicate a word
2023-01-16Merge branch 'ds/omit-trailing-hash-in-index'Junio C Hamano
Introduce an optional configuration to allow the trailing hash that protects the index file from bit flipping. * ds/omit-trailing-hash-in-index: features: feature.manyFiles implies fast index writes test-lib-functions: add helper for trailing hash read-cache: add index.skipHash config option hashfile: allow skipping the hash function
2023-01-16Merge branch 'ws/single-file-cone'Junio C Hamano
The logic to see if we are using the "cone" mode by checking the sparsity patterns has been tightened to avoid mistaking a pattern that names a single file as specifying a cone. * ws/single-file-cone: dir: check for single file cone patterns
2023-01-16Merge branch 'jk/ext-diff-with-relative'Junio C Hamano
"git diff --relative" did not mix well with "git diff --ext-diff", which has been corrected. * jk/ext-diff-with-relative: diff: drop "name" parameter from prepare_temp_file() diff: clean up external-diff argv setup diff: use filespec path to set up tempfiles for ext-diff
2023-01-16Merge branch 'ds/bundle-uri-4'Junio C Hamano
Code clean-up. * ds/bundle-uri-4: test-bundle-uri: drop unused variables
2023-01-16Merge branch 'tr/am--no-verify'Junio C Hamano
Conditionally skip the pre-applypatch and applypatch-msg hooks when applying patches with 'git am'. * tr/am--no-verify: am: allow passing --no-verify flag
2023-01-16Merge branch 'tb/ci-concurrency'Junio C Hamano
Avoid unnecessary builds in CI, with settings configured in ci-config. * tb/ci-concurrency: ci: avoid unnecessary builds
2023-01-16Merge branch 'pw/ci-print-failure-name-fix'Junio C Hamano
(cosmetic) CI regression fix. * pw/ci-print-failure-name-fix: ci(github): restore "print test failures" step name
2023-01-16Merge branch 'es/t1509-root-fixes'Junio C Hamano
Test fixes. * es/t1509-root-fixes: t1509: facilitate repeated script invocations t1509: make "setup" test more robust t1509: fix failing "root work tree" test due to owner-check
2023-01-16fsck: document the new `gitattributes` message IDsJohannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-13t3104: remove shift code in 'test_ls_tree_format'Teng Long
In t3104-ls-tree-format.sh, There is a legacy 'shift 2' code and the relevant code block no longer depends on it anymore, so let's remove it for a small cleanup. Signed-off-by: Teng Long <dyroneteng@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-13ls-tree: cleanup the redundant SPACETeng Long
An redundant space was found in ls-tree.c, which is no doubt a small change, but it might be OK to make a commit on its own. Signed-off-by: Teng Long <dyroneteng@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-13ls-tree: make "line_termination" less genericÆvar Arnfjörð Bjarmason
The "ls-tree" command isn't capable of ending "lines" with anything except '\n' or '\0', and in the latter case we can avoid calling write_name_quoted_relative() entirely. Let's do that, less for optimization and more for clarity, the write_name_quoted_relative() API itself does much the same thing. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Teng Long <dyroneteng@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-13ls-tree: fold "show_tree_data" into "cb" structÆvar Arnfjörð Bjarmason
After the the preceding two commits the only user of the "show_tree_data" struct needed it along with the "options" member, let's instead fold all of that into a "show_tree_data" struct that we'll use only for that callback. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Teng Long <dyroneteng@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-13ls-tree: use a "struct options"Ævar Arnfjörð Bjarmason
As a first step towards being able to turn this code into an API some day let's change the "static" options in builtin/ls-tree.c into a "struct ls_tree_options" that can be constructed dynamically without the help of parse_options(). Because we're now using non-static variables for this we'll need to clear_pathspec() at the end of cmd_ls_tree(), least various tests start failing under SANITIZE=leak. The memory leak was already there before, now it's just being brought to the surface. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Teng Long <dyroneteng@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>