]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
15 months agoMerge branch 'kf/t5000-modernise'
Junio C Hamano [Thu, 16 Feb 2023 01:11:53 +0000 (17:11 -0800)] 
Merge branch 'kf/t5000-modernise'

Test clean-up.

* kf/t5000-modernise:
  t5000: modernise archive and :(glob) test

15 months agoMerge branch 'wl/new-command-doc'
Junio C Hamano [Thu, 16 Feb 2023 01:11:53 +0000 (17:11 -0800)] 
Merge branch 'wl/new-command-doc'

Comment fix.

* wl/new-command-doc:
  new-command.txt: update reference to builtin docs

15 months agoMerge branch 'ar/userdiff-java-update'
Junio C Hamano [Thu, 16 Feb 2023 01:11:52 +0000 (17:11 -0800)] 
Merge branch 'ar/userdiff-java-update'

Userdiff regexp update for Java language.

* ar/userdiff-java-update:
  userdiff: support Java sealed classes
  userdiff: support Java record types
  userdiff: support Java type parameters

15 months agoMerge branch 'po/attributes-text'
Junio C Hamano [Thu, 16 Feb 2023 01:11:52 +0000 (17:11 -0800)] 
Merge branch 'po/attributes-text'

In-tree .gitattributes update to match the way we recommend our
users to mark a file as text.

* po/attributes-text:
  .gitattributes: include `text` attribute for eol attributes

15 months agoMerge branch 'ab/sequencer-unleak'
Junio C Hamano [Thu, 16 Feb 2023 01:11:52 +0000 (17:11 -0800)] 
Merge branch 'ab/sequencer-unleak'

Plug leaks in sequencer subsystem and its users.

* ab/sequencer-unleak:
  commit.c: free() revs.commit in get_fork_point()
  builtin/rebase.c: free() "options.strategy_opts"
  sequencer.c: always free() the "msgbuf" in do_pick_commit()
  builtin/rebase.c: fix "options.onto_name" leak
  builtin/revert.c: move free-ing of "revs" to replay_opts_release()
  sequencer API users: fix get_replay_opts() leaks
  sequencer.c: split up sequencer_remove_state()
  rebase: use "cleanup" pattern in do_interactive_rebase()

15 months agoMerge branch 'ds/bundle-uri-5'
Junio C Hamano [Thu, 16 Feb 2023 01:11:52 +0000 (17:11 -0800)] 
Merge branch 'ds/bundle-uri-5'

The bundle-URI subsystem adds support for creation-token heuristics
to help incremental fetches.

* ds/bundle-uri-5:
  bundle-uri: test missing bundles with heuristic
  bundle-uri: store fetch.bundleCreationToken
  fetch: fetch from an external bundle URI
  bundle-uri: drop bundle.flag from design doc
  clone: set fetch.bundleURI if appropriate
  bundle-uri: download in creationToken order
  bundle-uri: parse bundle.<id>.creationToken values
  bundle-uri: parse bundle.heuristic=creationToken
  t5558: add tests for creationToken heuristic
  bundle: verify using check_connected()
  bundle: test unbundling with incomplete history

15 months agoMerge branch 'cb/grep-fallback-failing-jit'
Junio C Hamano [Thu, 16 Feb 2023 01:11:51 +0000 (17:11 -0800)] 
Merge branch 'cb/grep-fallback-failing-jit'

In an environment where dynamically generated code is prohibited to
run (e.g. SELinux), failure to JIT pcre patterns is expected.  Fall
back to interpreted execution in such a case.

* cb/grep-fallback-failing-jit:
  grep: fall back to interpreter if JIT memory allocation fails

15 months agoSync with 'maint'
Junio C Hamano [Tue, 14 Feb 2023 22:17:35 +0000 (14:17 -0800)] 
Sync with 'maint'

15 months agoPrepare for 2.39.3 just in case
Junio C Hamano [Tue, 14 Feb 2023 22:15:23 +0000 (14:15 -0800)] 
Prepare for 2.39.3 just in case

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agoMerge branch 'sk/remove-duplicate-includes' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:57 +0000 (14:15 -0800)] 
Merge branch 'sk/remove-duplicate-includes' into maint-2.39

Code clean-up.

* sk/remove-duplicate-includes:
  git: remove duplicate includes

15 months agoMerge branch 'rs/clarify-error-in-write-loose-object' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:57 +0000 (14:15 -0800)] 
Merge branch 'rs/clarify-error-in-write-loose-object' into maint-2.39

Code clean-up.

* rs/clarify-error-in-write-loose-object:
  object-file: inline write_buffer()

15 months agoMerge branch 'rs/reflog-expiry-cleanup' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:56 +0000 (14:15 -0800)] 
Merge branch 'rs/reflog-expiry-cleanup' into maint-2.39

Code clean-up.

* rs/reflog-expiry-cleanup:
  reflog: clear leftovers in reflog_expiry_cleanup()

15 months agoMerge branch 'rs/clear-commit-marks-cleanup' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:56 +0000 (14:15 -0800)] 
Merge branch 'rs/clear-commit-marks-cleanup' into maint-2.39

Code clean-up.

* rs/clear-commit-marks-cleanup:
  commit: skip already cleared parents in clear_commit_marks_1()

15 months agoMerge branch 'rs/am-parse-options-cleanup' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:56 +0000 (14:15 -0800)] 
Merge branch 'rs/am-parse-options-cleanup' into maint-2.39

Code clean-up.

* rs/am-parse-options-cleanup:
  am: don't pass strvec to apply_parse_options()

15 months agoMerge branch 'jk/server-supports-v2-cleanup' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:55 +0000 (14:15 -0800)] 
Merge branch 'jk/server-supports-v2-cleanup' into maint-2.39

Code clean-up.

* jk/server-supports-v2-cleanup:
  server_supports_v2(): use a separate function for die_on_error

15 months agoMerge branch 'jk/unused-post-2.39' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:55 +0000 (14:15 -0800)] 
Merge branch 'jk/unused-post-2.39' into maint-2.39

Code clean-up around unused function parameters.

* jk/unused-post-2.39:
  userdiff: mark unused parameter in internal callback
  list-objects-filter: mark unused parameters in virtual functions
  diff: mark unused parameters in callbacks
  xdiff: mark unused parameter in xdl_call_hunk_func()
  xdiff: drop unused parameter in def_ff()
  ws: drop unused parameter from ws_blank_line()
  list-objects: drop process_gitlink() function
  blob: drop unused parts of parse_blob_buffer()
  ls-refs: use repository parameter to iterate refs

15 months agoMerge branch 'rj/branch-copy-and-rename' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:55 +0000 (14:15 -0800)] 
Merge branch 'rj/branch-copy-and-rename' into maint-2.39

Fix a pair of bugs in 'git branch'.

* rj/branch-copy-and-rename:
  branch: force-copy a branch to itself via @{-1} is a no-op

15 months agoMerge branch 'rs/t3920-crlf-eating-grep-fix' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:54 +0000 (14:15 -0800)] 
Merge branch 'rs/t3920-crlf-eating-grep-fix' into maint-2.39

Test fix.

* rs/t3920-crlf-eating-grep-fix:
  t3920: support CR-eating grep

15 months agoMerge branch 'js/t3920-shell-and-or-fix' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:54 +0000 (14:15 -0800)] 
Merge branch 'js/t3920-shell-and-or-fix' into maint-2.39

Test fix.

* js/t3920-shell-and-or-fix:
  t3920: don't ignore errors of more than one command with `|| true`

15 months agoMerge branch 'ab/t4023-avoid-losing-exit-status-of-diff' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:54 +0000 (14:15 -0800)] 
Merge branch 'ab/t4023-avoid-losing-exit-status-of-diff' into maint-2.39

Test fix.

* ab/t4023-avoid-losing-exit-status-of-diff:
  t4023: fix ignored exit codes of git

15 months agoMerge branch 'ab/t7600-avoid-losing-exit-status-of-git' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:53 +0000 (14:15 -0800)] 
Merge branch 'ab/t7600-avoid-losing-exit-status-of-git' into maint-2.39

Test fix.

* ab/t7600-avoid-losing-exit-status-of-git:
  t7600: don't ignore "rev-parse" exit code in helper

15 months agoMerge branch 'ab/t5314-avoid-losing-exit-status' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:53 +0000 (14:15 -0800)] 
Merge branch 'ab/t5314-avoid-losing-exit-status' into maint-2.39

Test fix.

* ab/t5314-avoid-losing-exit-status:
  t5314: check exit code of "git"

15 months agoMerge branch 'rs/plug-pattern-list-leak-in-lof' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:53 +0000 (14:15 -0800)] 
Merge branch 'rs/plug-pattern-list-leak-in-lof' into maint-2.39

Leak fix.

* rs/plug-pattern-list-leak-in-lof:
  list-objects-filter: plug pattern_list leak

15 months agoMerge branch 'rs/t4205-do-not-exit-in-test-script' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:53 +0000 (14:15 -0800)] 
Merge branch 'rs/t4205-do-not-exit-in-test-script' into maint-2.39

Test fix.

* rs/t4205-do-not-exit-in-test-script:
  t4205: don't exit test script on failure

15 months agoMerge branch 'jc/doc-checkout-b' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:52 +0000 (14:15 -0800)] 
Merge branch 'jc/doc-checkout-b' into maint-2.39

Clarify how "checkout -b/-B" and "git branch [-f]" are similar but
different in the documentation.

* jc/doc-checkout-b:
  checkout: document -b/-B to highlight the differences from "git branch"

15 months agoMerge branch 'jc/doc-branch-update-checked-out-branch' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:52 +0000 (14:15 -0800)] 
Merge branch 'jc/doc-branch-update-checked-out-branch' into maint-2.39

Document that "branch -f <branch>" disables only the safety to
avoid recreating an existing branch.

* jc/doc-branch-update-checked-out-branch:
  branch: document `-f` and linked worktree behaviour

15 months agoMerge branch 'rs/ls-tree-path-expansion-fix' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:52 +0000 (14:15 -0800)] 
Merge branch 'rs/ls-tree-path-expansion-fix' into maint-2.39

"git ls-tree --format='%(path) %(path)' $tree $path" showed the
path three times, which has been corrected.

* rs/ls-tree-path-expansion-fix:
  ls-tree: remove dead store and strbuf for quote_c_style()
  ls-tree: fix expansion of repeated %(path)

15 months agoMerge branch 'pb/doc-orig-head' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:51 +0000 (14:15 -0800)] 
Merge branch 'pb/doc-orig-head' into maint-2.39

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

15 months agoMerge branch 'es/hooks-and-local-env' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:51 +0000 (14:15 -0800)] 
Merge branch 'es/hooks-and-local-env' into maint-2.39

Doc update for environment variables set when hooks are invoked.

* es/hooks-and-local-env:
  githooks: discuss Git operations in foreign repositories

15 months agoMerge branch 'ws/single-file-cone' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:51 +0000 (14:15 -0800)] 
Merge branch 'ws/single-file-cone' into maint-2.39

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

15 months agoMerge branch 'jk/ext-diff-with-relative' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:50 +0000 (14:15 -0800)] 
Merge branch 'jk/ext-diff-with-relative' into maint-2.39

"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

15 months agoMerge branch 'ab/bundle-wo-args' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:50 +0000 (14:15 -0800)] 
Merge branch 'ab/bundle-wo-args' into maint-2.39

Fix to a small regression in 2.38 days.

* ab/bundle-wo-args:
  bundle <cmd>: have usage_msg_opt() note the missing "<file>"
  builtin/bundle.c: remove superfluous "newargc" variable
  bundle: don't segfault on "git bundle <subcmd>"

15 months agoMerge branch 'ps/fsync-refs-fix' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:50 +0000 (14:15 -0800)] 
Merge branch 'ps/fsync-refs-fix' into maint-2.39

Fix the sequence to fsync $GIT_DIR/packed-refs file that forgot to
flush its output to the disk..

* ps/fsync-refs-fix:
  refs: fix corruption by not correctly syncing packed-refs to disk

15 months agoMerge branch 'lk/line-range-parsing-fix' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:49 +0000 (14:15 -0800)] 
Merge branch 'lk/line-range-parsing-fix' into maint-2.39

When given a pattern that matches an empty string at the end of a
line, the code to parse the "git diff" line-ranges fell into an
infinite loop, which has been corrected.

* lk/line-range-parsing-fix:
  line-range: fix infinite loop bug with '$' regex

15 months agoMerge branch 'rs/use-enhanced-bre-on-macos' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:49 +0000 (14:15 -0800)] 
Merge branch 'rs/use-enhanced-bre-on-macos' into maint-2.39

Newer regex library macOS stopped enabling GNU-like enhanced BRE,
where '\(A\|B\)' works as alternation, unless explicitly asked with
the REG_ENHANCED flag.  "git grep" now can be compiled to do so, to
retain the old behaviour.

* rs/use-enhanced-bre-on-macos:
  use enhanced basic regular expressions on macOS

15 months agoMerge branch 'jk/curl-avoid-deprecated-api' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:49 +0000 (14:15 -0800)] 
Merge branch 'jk/curl-avoid-deprecated-api' into maint-2.39

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

15 months agoMerge branch 'jk/avoid-redef-system-functions' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:49 +0000 (14:15 -0800)] 
Merge branch 'jk/avoid-redef-system-functions' into maint-2.39

The jk/avoid-redef-system-functions-2.30 topic pre-merged for more
recent codebase.

* jk/avoid-redef-system-functions:

15 months agoMerge branch 'jk/avoid-redef-system-functions-2.30' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:47 +0000 (14:15 -0800)] 
Merge branch 'jk/avoid-redef-system-functions-2.30' into maint-2.39

Redefining system functions for a few functions did not follow our
usual "implement git_foo() and #define foo(args) git_foo(args)"
pattern, which has broken build for some folks.

* jk/avoid-redef-system-functions-2.30:
  git-compat-util: undefine system names before redeclaring them
  git-compat-util: avoid redefining system function names

15 months agoMerge branch 'tb/ci-concurrency' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:46 +0000 (14:15 -0800)] 
Merge branch 'tb/ci-concurrency' into maint-2.39

Avoid unnecessary builds in CI, with settings configured in
ci-config.

* tb/ci-concurrency:
  ci: avoid unnecessary builds

15 months agoMerge branch 'cw/ci-whitespace' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:45 +0000 (14:15 -0800)] 
Merge branch 'cw/ci-whitespace' into maint-2.39

CI updates.  We probably want a clean-up to move the long shell
script embedded in yaml file into a separate file, but that can
come later.

* cw/ci-whitespace:
  ci (check-whitespace): move to actions/checkout@v3
  ci (check-whitespace): add links to job output
  ci (check-whitespace): suggest fixes for errors

15 months agoMerge branch 'js/ci-disable-cmake-by-default' into maint-2.39
Junio C Hamano [Tue, 14 Feb 2023 22:15:45 +0000 (14:15 -0800)] 
Merge branch 'js/ci-disable-cmake-by-default' into maint-2.39

Stop running win+VS build by default.

* js/ci-disable-cmake-by-default:
  ci: only run win+VS build & tests in Git for Windows' fork

15 months agoSync with Git 2.39.2
Junio C Hamano [Tue, 14 Feb 2023 01:03:24 +0000 (17:03 -0800)] 
Sync with Git 2.39.2

15 months agoThe fifteenth batch
Junio C Hamano [Thu, 9 Feb 2023 22:40:34 +0000 (14:40 -0800)] 
The fifteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agoMerge branch 'ew/free-island-marks'
Junio C Hamano [Thu, 9 Feb 2023 22:40:47 +0000 (14:40 -0800)] 
Merge branch 'ew/free-island-marks'

"git pack-objects" learned to release delta-island bitmap data when
it is done using it, saving peak heap memory usage.

* ew/free-island-marks:
  delta-islands: free island_marks and bitmaps

15 months agoMerge branch 'sk/winansi-createthread-fix'
Junio C Hamano [Thu, 9 Feb 2023 22:40:47 +0000 (14:40 -0800)] 
Merge branch 'sk/winansi-createthread-fix'

Fix use of CreateThread() API call made early in the windows
start-up code.

* sk/winansi-createthread-fix:
  compat/winansi: check for errors of CreateThread() correctly

15 months agoMerge branch 'hj/remove-msys-support'
Junio C Hamano [Thu, 9 Feb 2023 22:40:47 +0000 (14:40 -0800)] 
Merge branch 'hj/remove-msys-support'

Remove support for MSys, which now lags way behind MSys2.

* hj/remove-msys-support:
  mingw: remove msysGit/MSYS1 support
  mingw: remove duplicate `USE_NED_ALLOCATOR` directive

15 months agoMerge branch 'jk/httpd-test-updates'
Junio C Hamano [Thu, 9 Feb 2023 22:40:46 +0000 (14:40 -0800)] 
Merge branch 'jk/httpd-test-updates'

Test update.

* jk/httpd-test-updates:
  t/lib-httpd: increase ssl key size to 2048 bits
  t/lib-httpd: drop SSLMutex config
  t/lib-httpd: bump required apache version to 2.4
  t/lib-httpd: bump required apache version to 2.2

15 months agoMerge branch 'gc/index-format-doc'
Junio C Hamano [Thu, 9 Feb 2023 22:40:46 +0000 (14:40 -0800)] 
Merge branch 'gc/index-format-doc'

Doc update.

* gc/index-format-doc:
  docs: document zero bits in index "mode"

15 months agouserdiff: support Java sealed classes
Andrei Rybak [Tue, 7 Feb 2023 23:42:59 +0000 (00:42 +0100)] 
userdiff: support Java sealed classes

A new kind of class was added in Java 17 -- sealed classes.[1]  This
feature includes several new keywords that may appear in a declaration
of a class.  New modifiers before name of the class: "sealed" and
"non-sealed", and a clause after name of the class marked by keyword
"permits".

The current set of regular expressions in userdiff.c already allows the
modifier "sealed" and the "permits" clause, but not the modifier
"non-sealed", which is the first hyphenated keyword in Java.[2]  Allow
hyphen in the words that precede the name of type to match the
"non-sealed" modifier.

In new input file "java-sealed" for the test t4018-diff-funcname.sh, use
a Java code comment for the marker "RIGHT".  This workaround is needed,
because the name of the sealed class appears on the line of code that
has the "ChangeMe" marker.

[1] Detailed description in "JEP 409: Sealed Classes"
    https://openjdk.org/jeps/409
[2] "JEP draft: Keyword Management for the Java Language"
    https://openjdk.org/jeps/8223002

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agouserdiff: support Java record types
Andrei Rybak [Tue, 7 Feb 2023 23:42:58 +0000 (00:42 +0100)] 
userdiff: support Java record types

A new kind of class was added in Java 16 -- records.[1]  The syntax of
records is similar to regular classes with one important distinction:
the name of the record class is followed by a mandatory list of
components.  The list is enclosed in parentheses, it may be empty, and
it may immediately follow the name of the class or type parameters, if
any, with or without separating whitespace.  For example:

    public record Example(int i, String s) {
    }

    public record WithTypeParameters<A, B>(A a, B b, String s) {
    }

    record SpaceBeforeComponents (String comp1, int comp2) {
    }

Support records in the builtin userdiff pattern for Java.  Add "record"
to the alternatives of keywords for kinds of class.

Allowing matching various possibilities for the type parameters and/or
list of the components of a record has already been covered by the
preceding patch.

[1] detailed description is available in "JEP 395: Records"
    https://openjdk.org/jeps/395

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agouserdiff: support Java type parameters
Andrei Rybak [Tue, 7 Feb 2023 23:42:57 +0000 (00:42 +0100)] 
userdiff: support Java type parameters

A class or interface in Java can have type parameters following the name
in the declared type, surrounded by angle brackets (paired less than and
greater than signs).[2]   The type parameters -- `A` and `B` in the
examples -- may follow the class name immediately:

    public class ParameterizedClass<A, B> {
    }

or may be separated by whitespace:

    public class SpaceBeforeTypeParameters <A, B> {
    }

A part of the builtin userdiff pattern for Java matches declarations of
classes, enums, and interfaces.  The regular expression requires at
least one whitespace character after the name of the declared type.
This disallows matching for opening angle bracket of type parameters
immediately after the name of the type.  Mandatory whitespace after the
name of the type also disallows using the pattern in repositories with a
fairly common code style that puts braces for the body of a class on
separate lines:

    class WithLineBreakBeforeOpeningBrace
    {
    }

Support matching Java code in more diverse code styles and declarations
of classes and interfaces with type parameters immediately following the
name of the type in the builtin userdiff pattern for Java.  Do so by
just matching anything until the end of the line after the keywords for
the kind of type being declared.

[1] Since Java 5 released in 2004.
[2] Detailed description is available in the Java Language
    Specification, sections "Type Variables" and "Parameterized Types":
    https://docs.oracle.com/javase/specs/jls/se17/html/jls-4.html#jls-4.4

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agoThe fourteenth batch
Junio C Hamano [Wed, 8 Feb 2023 17:14:51 +0000 (09:14 -0800)] 
The fourteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agoMerge branch 'ds/scalar-ignore-cron-error'
Junio C Hamano [Wed, 8 Feb 2023 17:14:42 +0000 (09:14 -0800)] 
Merge branch 'ds/scalar-ignore-cron-error'

Allow "scalar" to warn but continue when its periodic maintenance
feature cannot be enabled.

* ds/scalar-ignore-cron-error:
  scalar: only warn when background maintenance fails
  t921*: test scalar behavior starting maintenance
  t: allow 'scalar' in test_must_fail

15 months agoMerge branch 'mh/doc-credential-cache-only-in-core'
Junio C Hamano [Wed, 8 Feb 2023 17:14:42 +0000 (09:14 -0800)] 
Merge branch 'mh/doc-credential-cache-only-in-core'

Documentation clarification.

* mh/doc-credential-cache-only-in-core:
  Documentation: clarify that cache forgets credentials if the system restarts

15 months agoMerge branch 'gm/request-pull-with-non-pgp-signed-tags'
Junio C Hamano [Wed, 8 Feb 2023 17:14:42 +0000 (09:14 -0800)] 
Merge branch 'gm/request-pull-with-non-pgp-signed-tags'

Adjust "git request-pull" to strip embedded signature from signed
tags to notice non-PGP signatures.

* gm/request-pull-with-non-pgp-signed-tags:
  request-pull: filter out SSH/X.509 tag signatures

15 months agocommit.c: free() revs.commit in get_fork_point()
Ævar Arnfjörð Bjarmason [Mon, 6 Feb 2023 19:08:13 +0000 (20:08 +0100)] 
commit.c: free() revs.commit in get_fork_point()

Fix a memory leak that's been with us since d96855ff517 (merge-base:
teach "--fork-point" mode, 2013-10-23).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agobuiltin/rebase.c: free() "options.strategy_opts"
Ævar Arnfjörð Bjarmason [Mon, 6 Feb 2023 19:08:12 +0000 (20:08 +0100)] 
builtin/rebase.c: free() "options.strategy_opts"

When the "strategy_opts" member was added in ba1905a5fef (builtin
rebase: add support for custom merge strategies, 2018-09-04) the
corresponding free() for it at the end of cmd_rebase() wasn't added,
let's do so.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agosequencer.c: always free() the "msgbuf" in do_pick_commit()
Ævar Arnfjörð Bjarmason [Mon, 6 Feb 2023 19:08:11 +0000 (20:08 +0100)] 
sequencer.c: always free() the "msgbuf" in do_pick_commit()

In [1] the strbuf_release(&msgbuf) was moved into this
do_pick_commit(), but didn't take into account the case of [2], where
we'd return before the strbuf_release(&msgbuf).

Then when the "fixup" support was added in [3] this leak got worse, as
in this error case we added another place where we'd "return" before
reaching the strbuf_release().

This changes the behavior so that we'll call
update_abort_safety_file() in these cases where we'd previously
"return", but as noted in [4] "update_abort_safety_file() is a no-op
when rebasing and you're changing code that is only run when
rebasing.". Here "no-op" refers to the early return in
update_abort_safety_file() if git_path_seq_dir() doesn't exist.

1. 452202c74b8 (sequencer: stop releasing the strbuf in
   write_message(), 2016-10-21)
2. f241ff0d0a9 (prepare the builtins for a libified merge_recursive(),
   2016-07-26)
3. 6e98de72c03 (sequencer (rebase -i): add support for the 'fixup' and
   'squash' commands, 2017-01-02)
4. https://lore.kernel.org/git/bcace50b-a4c3-c468-94a3-4fe0c62b3671@dunelm.org.uk/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agobuiltin/rebase.c: fix "options.onto_name" leak
Ævar Arnfjörð Bjarmason [Mon, 6 Feb 2023 19:08:10 +0000 (20:08 +0100)] 
builtin/rebase.c: fix "options.onto_name" leak

Similar to the existing "squash_onto_name" added in [1] we need to
free() the xstrdup()'d "options.onto.name" added for "--keep-base" in
[2]..

1. 9dba809a69a (builtin rebase: support --root, 2018-09-04)
2. 414d924beb4 (rebase: teach rebase --keep-base, 2019-08-27)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agobuiltin/revert.c: move free-ing of "revs" to replay_opts_release()
Ævar Arnfjörð Bjarmason [Mon, 6 Feb 2023 19:08:09 +0000 (20:08 +0100)] 
builtin/revert.c: move free-ing of "revs" to replay_opts_release()

In [1] and [2] I added the code being moved here to cmd_revert() and
cmd_cherry_pick(), now that we've got a "replay_opts_release()" for
the "struct replay_opts" it should know how to free these "revs",
rather than having these users reach into the struct to free its
individual members.

1. d1ec656d68f (cherry-pick: free "struct replay_opts" members,
   2022-11-08)
2. fd74ac95ac3 (revert: free "struct replay_opts" members, 2022-07-01)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agosequencer API users: fix get_replay_opts() leaks
Ævar Arnfjörð Bjarmason [Mon, 6 Feb 2023 19:08:08 +0000 (20:08 +0100)] 
sequencer API users: fix get_replay_opts() leaks

Make the replay_opts_release() function added in the preceding commit
non-static, and use it for freeing the "struct replay_opts"
constructed for "rebase" and "revert".

To safely call our new replay_opts_release() we'll need to stop
calling it in sequencer_remove_state(), and instead call it where we
allocate the "struct replay_opts" itself.

This is because in e.g. do_interactive_rebase() we construct a "struct
replay_opts" with "get_replay_opts()", and then call
"complete_action()". If we get far enough in that function without
encountering errors we'll call "pick_commits()" which (indirectly)
calls sequencer_remove_state() at the end.

But if we encounter errors anywhere along the way we'd punt out early,
and not free() the memory we allocated. Remembering whether we
previously called sequencer_remove_state() would be a hassle.

Using a FREE_AND_NULL() pattern would also work, as it would be safe
to call replay_opts_release() repeatedly. But let's fix this properly
instead, by having the owner of the data free() it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agosequencer.c: split up sequencer_remove_state()
Ævar Arnfjörð Bjarmason [Mon, 6 Feb 2023 19:08:07 +0000 (20:08 +0100)] 
sequencer.c: split up sequencer_remove_state()

Split off the free()-ing in sequencer_remove_state() into a utility
function, which will be adjusted and called independent of the other
code in sequencer_remove_state() in a subsequent commit.

The only functional change here is changing the "int" to a "size_t",
which is the correct type, as "xopts_nr" is a "size_t".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agorebase: use "cleanup" pattern in do_interactive_rebase()
Ævar Arnfjörð Bjarmason [Mon, 6 Feb 2023 19:08:06 +0000 (20:08 +0100)] 
rebase: use "cleanup" pattern in do_interactive_rebase()

Use a "goto cleanup" pattern in do_interactive_rebase(). This
eliminates some duplicated free() code added in 53bbcfbde7c (rebase
-i: implement the main part of interactive rebase as a builtin,
2018-09-27), and sets us up for a subsequent commit which'll make
further use of the "cleanup" label.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agot5000: modernise archive and :(glob) test
Kostya Farber [Sat, 4 Feb 2023 20:41:24 +0000 (20:41 +0000)] 
t5000: modernise archive and :(glob) test

To match present day coding guiding codelines let's:

- use <<-EOF, so we can indent all lines to the
  the same level for this test

- use <<\EOF to notify the reader that no interpolation
  is expected in the body

Signed-off-by: Kostya Farber <kostya.farber@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agonew-command.txt: update reference to builtin docs
Wes Lord [Sat, 4 Feb 2023 02:27:39 +0000 (02:27 +0000)] 
new-command.txt: update reference to builtin docs

Commit ec14d4ecb5 (builtin.h: take over documentation from
api-builtin.txt, 2017-08-02) deleted api-builtin.txt and moved the
contents into builtin.h, but new-command.txt still references the old
file.

Signed-off-by: Wes Lord <weslord@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months ago.gitattributes: include `text` attribute for eol attributes
Philip Oakley [Fri, 3 Feb 2023 12:59:20 +0000 (12:59 +0000)] 
.gitattributes: include `text` attribute for eol attributes

The standard advice for text file eol endings in the .gitattributes file
was updated in e28eae3184 (gitattributes: Document the unified "auto"
handling, 2016-08-26) with a recent clarification in 8c591dbfce (docs:
correct documentation about eol attribute, 2022-01-11), with a follow
up comment by the original author in [1] confirming the use of the eol
attribute in conjunction with the text attribute.

Update Git's .gitattributes file to reflect our own advice.

[1] https://lore.kernel.org/git/?q=%3C20220216115239.uo2ie3flaqo3nf2d%40tb-raspi4%3E.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agoGit 2.39.2 v2.39.2
Johannes Schindelin [Mon, 6 Feb 2023 08:43:41 +0000 (09:43 +0100)] 
Git 2.39.2

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoSync with 2.38.4
Johannes Schindelin [Mon, 6 Feb 2023 08:43:39 +0000 (09:43 +0100)] 
Sync with 2.38.4

* maint-2.38:
  Git 2.38.4
  Git 2.37.6
  Git 2.36.5
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agoGit 2.38.4 v2.38.4
Johannes Schindelin [Mon, 6 Feb 2023 08:43:30 +0000 (09:43 +0100)] 
Git 2.38.4

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoSync with 2.37.6
Johannes Schindelin [Mon, 6 Feb 2023 08:43:28 +0000 (09:43 +0100)] 
Sync with 2.37.6

* maint-2.37:
  Git 2.37.6
  Git 2.36.5
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agoGit 2.37.6 v2.37.6
Johannes Schindelin [Mon, 6 Feb 2023 08:38:32 +0000 (09:38 +0100)] 
Git 2.37.6

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoSync with 2.36.5
Johannes Schindelin [Mon, 6 Feb 2023 08:38:31 +0000 (09:38 +0100)] 
Sync with 2.36.5

* maint-2.36:
  Git 2.36.5
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agoGit 2.36.5 v2.36.5
Johannes Schindelin [Mon, 6 Feb 2023 08:37:53 +0000 (09:37 +0100)] 
Git 2.36.5

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoSync with 2.35.7
Johannes Schindelin [Mon, 6 Feb 2023 08:37:52 +0000 (09:37 +0100)] 
Sync with 2.35.7

* maint-2.35:
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agoGit 2.35.7 v2.35.7
Johannes Schindelin [Mon, 6 Feb 2023 08:29:45 +0000 (09:29 +0100)] 
Git 2.35.7

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoSync with 2.34.7
Johannes Schindelin [Mon, 6 Feb 2023 08:29:44 +0000 (09:29 +0100)] 
Sync with 2.34.7

* maint-2.34:
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agoGit 2.34.7 v2.34.7
Johannes Schindelin [Mon, 6 Feb 2023 08:29:17 +0000 (09:29 +0100)] 
Git 2.34.7

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoSync with 2.33.7
Johannes Schindelin [Mon, 6 Feb 2023 08:29:16 +0000 (09:29 +0100)] 
Sync with 2.33.7

* maint-2.33:
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agoMerge branch 'jk/curl-avoid-deprecated-api'
Junio C Hamano [Fri, 20 Jan 2023 23:36:21 +0000 (15:36 -0800)] 
Merge branch 'jk/curl-avoid-deprecated-api'

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

15 months agohttp: support CURLOPT_PROTOCOLS_STR
Jeff King [Tue, 17 Jan 2023 03:04:48 +0000 (22:04 -0500)] 
http: support CURLOPT_PROTOCOLS_STR

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>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agohttp: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
Jeff King [Tue, 17 Jan 2023 03:04:44 +0000 (22:04 -0500)] 
http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION

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>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agohttp-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
Jeff King [Tue, 17 Jan 2023 03:04:38 +0000 (22:04 -0500)] 
http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT

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>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoGit 2.33.7 v2.33.7
Johannes Schindelin [Mon, 6 Feb 2023 08:25:58 +0000 (09:25 +0100)] 
Git 2.33.7

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoSync with 2.32.6
Johannes Schindelin [Mon, 6 Feb 2023 08:25:56 +0000 (09:25 +0100)] 
Sync with 2.32.6

* maint-2.32:
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agoGit 2.32.6 v2.32.6
Johannes Schindelin [Mon, 6 Feb 2023 08:25:09 +0000 (09:25 +0100)] 
Git 2.32.6

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoSync with 2.31.7
Johannes Schindelin [Mon, 6 Feb 2023 08:25:08 +0000 (09:25 +0100)] 
Sync with 2.31.7

* maint-2.31:
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agoGit 2.31.7 v2.31.7
Johannes Schindelin [Mon, 6 Feb 2023 08:24:07 +0000 (09:24 +0100)] 
Git 2.31.7

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoSync with 2.30.8
Johannes Schindelin [Mon, 6 Feb 2023 08:24:06 +0000 (09:24 +0100)] 
Sync with 2.30.8

* maint-2.30:
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agoGit 2.30.8 v2.30.8
Junio C Hamano [Fri, 3 Feb 2023 22:58:10 +0000 (14:58 -0800)] 
Git 2.30.8

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agoMerge branch 'ps/apply-beyond-symlink' into maint-2.30
Junio C Hamano [Fri, 3 Feb 2023 22:57:27 +0000 (14:57 -0800)] 
Merge branch 'ps/apply-beyond-symlink' into maint-2.30

Fix a vulnerability (CVE-2023-23946) that allows crafted input to trick
`git apply` into writing files outside of the working tree.

* ps/apply-beyond-symlink:
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
15 months agoMerge branch 'tb/clone-local-symlinks' into maint-2.30
Taylor Blau [Wed, 25 Jan 2023 19:58:38 +0000 (14:58 -0500)] 
Merge branch 'tb/clone-local-symlinks' into maint-2.30

Resolve a security vulnerability (CVE-2023-22490) where `clone_local()`
is used in conjunction with non-local transports, leading to arbitrary
path exfiltration.

* tb/clone-local-symlinks:
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport

15 months agodelta-islands: free island_marks and bitmaps
Eric Wong [Fri, 3 Feb 2023 23:44:30 +0000 (23:44 +0000)] 
delta-islands: free island_marks and bitmaps

On my mirror of linux.git forkgroup with 780 islands, this saves
nearly 4G of heap memory in pack-objects.  This savings only
benefits delta island users of pack bitmaps, as the process
would otherwise be exiting anyways.

However, there's probably not many delta island users, but the
majority of delta island users would also be pack bitmaps users.

Signed-off-by: Eric Wong <e@80x24.org>
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agoThe thirteenth batch
Junio C Hamano [Fri, 3 Feb 2023 22:31:25 +0000 (14:31 -0800)] 
The thirteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agoMerge branch 'en/ls-files-doc-update'
Junio C Hamano [Sat, 4 Feb 2023 00:08:22 +0000 (16:08 -0800)] 
Merge branch 'en/ls-files-doc-update'

Doc update to ls-files.

* en/ls-files-doc-update:
  ls-files: guide folks to --exclude-standard over other --exclude* options
  ls-files: clarify descriptions of status tags for -t
  ls-files: clarify descriptions of file selection options
  ls-files: add missing documentation for --resolve-undo option

15 months agoMerge branch 'en/rebase-incompatible-opts'
Junio C Hamano [Sat, 4 Feb 2023 00:08:21 +0000 (16:08 -0800)] 
Merge branch 'en/rebase-incompatible-opts'

"git rebase" often ignored incompatible options instead of
complaining, which has been corrected.

* en/rebase-incompatible-opts:
  rebase: provide better error message for apply options vs. merge config
  rebase: put rebase_options initialization in single place
  rebase: fix formatting of rebase --reapply-cherry-picks option in docs
  rebase: clarify the OPT_CMDMODE incompatibilities
  rebase: add coverage of other incompatible options
  rebase: fix incompatiblity checks for --[no-]reapply-cherry-picks
  rebase: fix docs about incompatibilities with --root
  rebase: remove --allow-empty-message from incompatible opts
  rebase: flag --apply and --merge as incompatible
  rebase: mark --update-refs as requiring the merge backend

15 months agoMerge branch 'as/ssh-signing-improve-key-missing-error'
Junio C Hamano [Sat, 4 Feb 2023 00:08:21 +0000 (16:08 -0800)] 
Merge branch 'as/ssh-signing-improve-key-missing-error'

Improve the error message given when private key is not loaded in
the ssh agent in the codepath to sign with an ssh key.

* as/ssh-signing-improve-key-missing-error:
  ssh signing: better error message when key not in agent

15 months agoMerge branch 'jc/attr-doc-fix'
Junio C Hamano [Sat, 4 Feb 2023 00:08:21 +0000 (16:08 -0800)] 
Merge branch 'jc/attr-doc-fix'

Comment fix.

* jc/attr-doc-fix:
  attr: fix instructions on how to check attrs

15 months agoapply: fix writing behind newly created symbolic links
Patrick Steinhardt [Thu, 2 Feb 2023 10:54:34 +0000 (11:54 +0100)] 
apply: fix writing behind newly created symbolic links

When writing files git-apply(1) initially makes sure that none of the
files it is about to create are behind a symlink:

```
 $ git init repo
 Initialized empty Git repository in /tmp/repo/.git/
 $ cd repo/
 $ ln -s dir symlink
 $ git apply - <<EOF
 diff --git a/symlink/file b/symlink/file
 new file mode 100644
 index 0000000..e69de29
 EOF
 error: affected file 'symlink/file' is beyond a symbolic link
```

This safety mechanism is crucial to ensure that we don't write outside
of the repository's working directory. It can be fooled though when the
patch that is being applied creates the symbolic link in the first
place, which can lead to writing files in arbitrary locations.

Fix this by checking whether the path we're about to create is
beyond a symlink or not. Tightening these checks like this should be
fine as we already have these precautions in Git as explained
above. Ideally, we should update the check we do up-front before
starting to reflect the computed changes to the working tree so that
we catch this case as well, but as part of embargoed security work,
adding an equivalent check just before we try to write out a file
should serve us well as a reasonable first step.

Digging back into history shows that this vulnerability has existed
since at least Git v2.9.0. As Git v2.8.0 and older don't build on my
system anymore I cannot tell whether older versions are affected, as
well.

Reported-by: Joern Schneeweisz <jschneeweisz@gitlab.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agomingw: remove msysGit/MSYS1 support
Harshil-Jani [Thu, 2 Feb 2023 03:51:38 +0000 (03:51 +0000)] 
mingw: remove msysGit/MSYS1 support

MSys has long fallen behind MSYS2 in features like Unicode or
x86_64 support or even security bug fixes, and is therefore no
longer used by anyone in the Git developer community. The Git for
Windows project itself started switching from MSys to MSYS2 early
in 2015, i.e. about eight years ago. Let's drop supporting MSys as
a development platform.

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 months agomingw: remove duplicate `USE_NED_ALLOCATOR` directive
Harshil-Jani [Thu, 2 Feb 2023 03:51:37 +0000 (03:51 +0000)] 
mingw: remove duplicate `USE_NED_ALLOCATOR` directive

nedalloc was added to fix the slowness of memory allocator. Here
specifically for the MSys2 build there seems to be a duplication of
USE_NED_ALLOCATOR directive. So this patch intends to remove the
duplicate USE_NED_ALLOCATOR and keeping it only into the MSys2 config
section so it still uses the nedalloc.

Signed-off-by: Harshil-Jani <harshiljani2002@gmail.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>