summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* CI: upgrade to macos-12, and pin OSX versionÆvar Arnfjörð Bjarmason2022-12-073-4/+4
| | | | | | | | | | | | | | | | Per [1] and the warnings our CI is emitting GitHub is phasing in "macos-12" as their "macos-latest". As with [2], let's pin our image to a specific version so that we're not having it swept from under us, and our upgrade cycle can be more predictable than whenever GitHub changes their images. 1. https://github.com/actions/runner-images/issues/6384 2. 0178420b9ca (github-actions: run gcc-8 on ubuntu-20.04 image, 2022-11-25) Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Downmerge a bit more for 2.38.2Junio C Hamano2022-10-281-0/+13
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'rs/archive-dedup-printf' into maint-2.38Junio C Hamano2022-10-281-5/+3
|\ | | | | | | | | | | | | Code simplification. * rs/archive-dedup-printf: archive: deduplicate verbose printing
| * archive: deduplicate verbose printingRené Scharfe2022-10-111-5/+3
| | | | | | | | | | | | | | | | | | | | 94bc671a1f (Add directory pattern matching to attributes, 2012-12-08) moved the code for adding the trailing slash to names of directories and submodules up. This left both branches of the if statement starting with the same conditional fprintf call. Deduplicate it. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jh/struct-zero-init-with-older-clang' into maint-2.38Junio C Hamano2022-10-281-0/+25
|\ \ | | | | | | | | | | | | | | | | | | | | | Work around older clang that warns against C99 zero initialization syntax for struct. * jh/struct-zero-init-with-older-clang: config.mak.dev: disable suggest braces error on old clang versions
| * | config.mak.dev: disable suggest braces error on old clang versionsJeff Hostetler2022-10-101-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the "-Wno-missing-braces" option when building with an old version of clang to suppress the "suggest braces around initialization" error in developer mode. For example, using an old version of clang gives the following errors (when in DEVELOPER=1 mode): $ make builtin/merge-file.o CC builtin/merge-file.o builtin/merge-file.c:29:23: error: suggest braces around initialization \ of subobject [-Werror,-Wmissing-braces] mmfile_t mmfs[3] = { 0 }; ^ {} builtin/merge-file.c:31:20: error: suggest braces around initialization \ of subobject [-Werror,-Wmissing-braces] xmparam_t xmp = { 0 }; ^ {} 2 errors generated. This example compiles without error/warning with updated versions of clang. Since this is an obsolete error, use the -Wno-missing-braces option to silence the warning when using an older compiler. This avoids the need to update the code to use "{{0}}" style initializations. Upstream clang version 8 has the problem. It was fixed in version 9. The version of clang distributed by Apple with XCode has its own unique set of version numbers. Apple clang version 11 has the problem. It was fixed in version 12. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'rs/use-fspathncmp' into maint-2.38Junio C Hamano2022-10-281-3/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Code clean-up. * rs/use-fspathncmp: dir: use fspathncmp() in pl_hashmap_cmp()
| * | | dir: use fspathncmp() in pl_hashmap_cmp()Jeff King2022-10-091-3/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | Call fspathncmp() instead of open-coding it. This shortens the code and makes it less repetitive. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'rj/branch-edit-desc-unborn' into maint-2.38Junio C Hamano2022-10-282-2/+58
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git branch --edit-description" on an unborh branch misleadingly said that no such branch exists, which has been corrected. * rj/branch-edit-desc-unborn: branch: description for non-existent branch errors
| * | | branch: description for non-existent branch errorsRubén Justo2022-10-082-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the repository does not yet have commits, some errors describe that there is no branch: $ git init -b first $ git branch --edit-description first error: No branch named 'first'. $ git branch --set-upstream-to=upstream fatal: branch 'first' does not exist $ git branch -c second error: refname refs/heads/first not found fatal: Branch copy failed That "first" branch is unborn but to say it doesn't exists is confusing. Options "-c" (copy) and "-m" (rename) show the same error when the origin branch doesn't exists: $ git branch -c non-existent-branch second error: refname refs/heads/non-existent-branch not found fatal: Branch copy failed $ git branch -m non-existent-branch second error: refname refs/heads/non-existent-branch not found fatal: Branch rename failed Note that "--edit-description" without an explicit argument is already considering the _empty repository_ circumstance in its error. Also note that "-m" on the initial branch it is an allowed operation. Make the error descriptions for those branch operations with unborn or non-existent branches, more informative. This is the result of the change: $ git init -b first $ git branch --edit-description first error: No commit on branch 'first' yet. $ git branch --set-upstream-to=upstream fatal: No commit on branch 'first' yet. $ git branch -c second fatal: No commit on branch 'first' yet. $ git branch [-c/-m] non-existent-branch second fatal: No branch named 'non-existent-branch'. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'pw/remove-rebase-p-test' into maint-2.38Junio C Hamano2022-10-281-8/+0
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove outdated test. * pw/remove-rebase-p-test: t3435: remove redundant test case
| * | | | t3435: remove redundant test casePhillip Wood2022-10-101-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rebase --preserve-merges no longer exists so there is no point in carrying this failing test case. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jc/use-of-uc-in-log-messages' into maint-2.38Junio C Hamano2022-10-281-1/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clarify that "the sentence after <area>: prefix does not begin with a capital letter" rule applies only to the commit title. * jc/use-of-uc-in-log-messages: SubmittingPatches: use usual capitalization in the log message body
| * | | | | SubmittingPatches: use usual capitalization in the log message bodyJunio C Hamano2022-10-071-1/+3
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the description of the summary section to clarify that the "do not capitalize" rule applies only the word after the "<area>:" prefix of the title and nowhere else. This hopefully will prevent folks from writing their proposed log message in all lowercase. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jc/tmp-objdir' into maint-2.38Junio C Hamano2022-10-281-36/+4
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code to clean temporary object directories (used for quarantine) tried to remove them inside its signal handler, which was a no-no. * jc/tmp-objdir: tmp-objdir: skip clean up when handling a signal
| * | | | | tmp-objdir: skip clean up when handling a signalJohn Cai2022-10-011-36/+4
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the tmp-objdir api, tmp_objdir_create will create a temporary directory but also register signal handlers responsible for removing the directory's contents and the directory itself. However, the function responsible for recursively removing the contents and directory, remove_dir_recurse() calls opendir(3) and closedir(3). This can be problematic because these functions allocate and free memory, which are not async-signal-safe functions. This can lead to deadlocks. One place we call tmp_objdir_create() is in git-receive-pack, where we create a temporary quarantine directory "incoming". Incoming objects will be written to this directory before they get moved to the object directory. We have observed this code leading to a deadlock: Thread 1 (Thread 0x7f621ba0b200 (LWP 326305)): #0 __lll_lock_wait_private (futex=futex@entry=0x7f621bbf8b80 <main_arena>) at ./lowlevellock.c:35 #1 0x00007f621baa635b in __GI___libc_malloc (bytes=bytes@entry=32816) at malloc.c:3064 #2 0x00007f621bae9f49 in __alloc_dir (statp=0x7fff2ea7ed60, flags=0, close_fd=true, fd=5) at ../sysdeps/posix/opendir.c:118 #3 opendir_tail (fd=5) at ../sysdeps/posix/opendir.c:69 #4 __opendir (name=<optimized out>) at ../sysdeps/posix/opendir.c:92 #5 0x0000557c19c77de1 in remove_dir_recurse () git#6 0x0000557c19d81a4f in remove_tmp_objdir_on_signal () #7 <signal handler called> git#8 _int_malloc (av=av@entry=0x7f621bbf8b80 <main_arena>, bytes=bytes@entry=7160) at malloc.c:4116 git#9 0x00007f621baa62c9 in __GI___libc_malloc (bytes=7160) at malloc.c:3066 git#10 0x00007f621bd1e987 in inflateInit2_ () from /opt/gitlab/embedded/lib/libz.so.1 git#11 0x0000557c19dbe5f4 in git_inflate_init () git#12 0x0000557c19cee02a in unpack_compressed_entry () git#13 0x0000557c19cf08cb in unpack_entry () git#14 0x0000557c19cf0f32 in packed_object_info () git#15 0x0000557c19cd68cd in do_oid_object_info_extended () git#16 0x0000557c19cd6e2b in read_object_file_extended () git#17 0x0000557c19cdec2f in parse_object () git#18 0x0000557c19c34977 in lookup_commit_reference_gently () git#19 0x0000557c19d69309 in mark_uninteresting () git#20 0x0000557c19d2d180 in do_for_each_repo_ref_iterator () git#21 0x0000557c19d21678 in for_each_ref () git#22 0x0000557c19d6a94f in assign_shallow_commits_to_refs () git#23 0x0000557c19bc02b2 in cmd_receive_pack () git#24 0x0000557c19b29fdd in handle_builtin () git#25 0x0000557c19b2a526 in cmd_main () git#26 0x0000557c19b28ea2 in main () Since we can't do the cleanup in a portable and signal-safe way, skip the cleanup when we're handling a signal. This means that when signal handling, the temporary directory may not get cleaned up properly. This is mitigated by b3cecf49ea (tmp-objdir: new API for creating temporary writable databases, 2021-12-06) which changed the default name and allows gc to clean up these temporary directories. In the event of a normal exit, we should still be cleaning up via the atexit() handler. Helped-by: Jeff King <peff@peff.net> Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'dd/document-runtime-prefix-better' into maint-2.38Junio C Hamano2022-10-281-2/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update comment in the Makefile about the RUNTIME_PREFIX config knob. * dd/document-runtime-prefix-better: Makefile: clarify runtime relative gitexecdir
| * | | | | Makefile: clarify runtime relative gitexecdirĐoàn Trần Công Danh2022-10-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git" built with RUNTIME_PREFIX flag turned on could figure out gitexecdir and other paths as relative to "git" executable. However, in the section specifies gitexecdir, RUNTIME_PREFIX wasn't mentioned, thus users may wrongly assume that "git" always locates gitexecdir as relative path to the executable. Let's clarify that only "git" built with RUNTIME_PREFIX will locate gitexecdir as relative path. Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'ab/unused-annotation' into maint-2.38Junio C Hamano2022-10-281-1/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compilation fix for ancient compilers. * ab/unused-annotation: git-compat-util.h: GCC deprecated message arg only in GCC 4.5+
| * | | | | | git-compat-util.h: GCC deprecated message arg only in GCC 4.5+Alejandro R. Sedeño2022-10-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gcc.gnu.org/gcc-4.5/changes.html says The deprecated attribute now takes an optional string argument, for example, __attribute__((deprecated("text string"))), that will be printed together with the deprecation warning. While GCC 4.5 is already 12 years old, git checks for even older versions in places. Let's not needlessly break older compilers when a small and simple fix is readily available. Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu> Signed-off-by: Alejandro R Sedeño <asedeno@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'tb/midx-repack-ignore-cruft-packs' into maint-2.38Junio C Hamano2022-10-283-6/+107
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git multi-pack-index repack/expire" used to repack unreachable cruft into a new pack, which have been corrected. cf. <63a1c3d4-eff3-af10-4263-058c88e74594@github.com> * tb/midx-repack-ignore-cruft-packs: midx.c: avoid cruft packs with non-zero `repack --batch-size` midx.c: remove unnecessary loop condition midx.c: replace `xcalloc()` with `CALLOC_ARRAY()` midx.c: avoid cruft packs with `repack --batch-size=0` midx.c: prevent `expire` from removing the cruft pack Documentation/git-multi-pack-index.txt: clarify expire behavior Documentation/git-multi-pack-index.txt: fix typo
| * | | | | | | midx.c: avoid cruft packs with non-zero `repack --batch-size`Taylor Blau2022-09-212-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply similar treatment with respect to cruft packs as in a few commits ago to `repack` with a non-zero `--batch-size`. Since the case of a non-zero `--batch-size` is handled separately (in `fill_included_packs_batch()` instead of `fill_included_packs_all()`), a separate fix must be applied for this case. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | midx.c: remove unnecessary loop conditionTaylor Blau2022-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fill_included_packs_batch() routine is responsible for aggregating objects in packs with a non-zero value for the `--batch-size` option of the `git multi-pack-index repack` sub-command. Since this routine is explicitly called only when `--batch-size` is non-zero, there is no point in checking that this is the case in our loop condition. Remove the unnecessary part of this condition to avoid confusion. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | midx.c: replace `xcalloc()` with `CALLOC_ARRAY()`Taylor Blau2022-09-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace a direct invocation of Git's `xcalloc()` wrapper with the `CALLOC_ARRAY()` macro instead. The latter is preferred since it is more conventional in Git's codebase, but also because it automatically picks the correct value for the record size. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | midx.c: avoid cruft packs with `repack --batch-size=0`Taylor Blau2022-09-212-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `repack` sub-command of the `git multi-pack-index` builtin creates a new pack aggregating smaller packs contained in the MIDX up to some given `--batch-size`. When `--batch-size=0`, this instructs the MIDX builtin to repack everything contained in the MIDX into a single pack. In similar spirit as a previous commit, it is undesirable to repack the contents of a cruft pack in this step. Teach `repack` to ignore any cruft pack(s) when `--batch-size=0` for the same reason(s). (The case of a non-zero `--batch-size` will be handled in a subsequent commit). Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | midx.c: prevent `expire` from removing the cruft packTaylor Blau2022-09-213-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `expire` sub-command unlinks any packs that are (a) contained in the MIDX, but (b) have no objects referenced by the MIDX. This sub-command ignores `.keep` packs, which remain on-disk even if they have no objects referenced by the MIDX. Cruft packs, however, aren't given the same treatment: if none of the objects contained in the cruft pack are selected from the cruft pack by the MIDX, then the cruft pack is eligible to be expired. This is less than desireable, since the cruft pack has important metadata about the individual object mtimes, which is useful to determine how quickly an object should age out of the repository when pruning. Ordinarily, we wouldn't expect the contents of a cruft pack to duplicated across non-cruft packs (and we'd expect to see the MIDX select all cruft objects from other sources even less often). But nonetheless, it is still possible to trick the `expire` sub-command into removing the `.mtimes` file in this circumstance. Teach the `expire` sub-command to ignore cruft packs in the same manner as it does `.keep` packs, in order to keep their metadata around, even when they are unreferenced by the MIDX. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Documentation/git-multi-pack-index.txt: clarify expire behaviorTaylor Blau2022-09-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `expire` sub-command of `git multi-pack-index` will never expire `.keep` packs, regardless of whether or not any of their objects were selected in the MIDX. This has always been the case since 19575c7c8e (multi-pack-index: implement 'expire' subcommand, 2019-06-10), which came after cff9711616 (multi-pack-index: prepare for 'expire' subcommand, 2019-06-10), when this documentation was originally written. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Documentation/git-multi-pack-index.txt: fix typoTaylor Blau2022-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the extra space character between "tracked" and "by", which dates back to when this paragraph was originally written in cff9711616 (multi-pack-index: prepare for 'expire' subcommand, 2019-06-10). Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'so/diff-merges-cleanup' into maint-2.38Junio C Hamano2022-10-282-19/+27
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code clean-up. * so/diff-merges-cleanup: diff-merges: clarify log.diffMerges documentation diff-merges: cleanup set_diff_merges() diff-merges: cleanup func_by_opt()
| * | | | | | | | diff-merges: clarify log.diffMerges documentationSergey Organov2022-09-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | diff-merges: cleanup set_diff_merges()Sergey Organov2022-09-161-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of special-casing of 'suppress' in set_diff_merges(). Instead set 'merges_need_diff' flag correctly in every option handling function. Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | diff-merges: cleanup func_by_opt()Sergey Organov2022-09-161-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of unneeded "else" statements in func_by_opt(). Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'rj/ref-filter-get-head-description-leakfix' into maint-2.38Junio C Hamano2022-10-281-0/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Leakfix. * rj/ref-filter-get-head-description-leakfix: ref-filter.c: fix a leak in get_head_description
| * | | | | | | | | ref-filter.c: fix a leak in get_head_descriptionRubén Justo2022-09-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2708ce62d2 (branch: sort detached HEAD based on a flag, 2021-01-07) a call to wt_status_state_free_buffers, responsible of freeing the resources that could be allocated in the local struct wt_status_state state, was eliminated. The call to wt_status_state_free_buffers was introduced in 962dd7ebc3 (wt-status: introduce wt_status_state_free_buffers(), 2020-09-27). This commit brings back that call in get_head_description. Signed-off-by: Rubén Justo <rjusto@gmail.com> Reviewed-by: Martin Ågren <martin.agren@gmail.com> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Merge branch 'jc/environ-docs' into maint-2.38Junio C Hamano2022-10-282-16/+28
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation on various Boolean GIT_* environment variables have been clarified. * jc/environ-docs: environ: GIT_INDEX_VERSION affects not just a new repository environ: simplify description of GIT_INDEX_FILE environ: GIT_FLUSH should be made a usual Boolean environ: explain Boolean environment variables environ: document GIT_SSL_NO_VERIFY
| * | | | | | | | | | environ: GIT_INDEX_VERSION affects not just a new repositoryJunio C Hamano2022-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The variable is consulted whenever we write the index file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | environ: simplify description of GIT_INDEX_FILEJunio C Hamano2022-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | environ: GIT_FLUSH should be made a usual BooleanJunio C Hamano2022-09-152-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses atoi() and checks if the result is not zero to decide what to do. Turning it into the usual Boolean environment variable to use git_env_bool() would not break those who have been using "set to 0, or set to non-zero, that can be parsed with atoi()" values, but will match the expectation of those who expected "true" to mean "yes". Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | environ: explain Boolean environment variablesJunio C Hamano2022-09-151-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many environment variables use the git_env_bool() API to parse their values, and allow the usual "true/yes/on are true, false/no/off are false. In addition non-zero numbers are true and zero is false. An empty string is also false." set of values. Mark them as such, and consistently say "true" or "false", instead of random mixes of '1', '0', 'yes', 'true', etc. in their description. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | environ: document GIT_SSL_NO_VERIFYJunio C Hamano2022-09-151-0/+5
| | |_|_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though the name of the environment variable is mentioned in "git config --help" from http.sslVerify, there is no description for it. Add one. Note that this is not a usual Boolean environment variable whose value can be yes/true/on vs no/false/off; the existence of it is enough to trigger the feature named by the variable. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Makefile: force -O0 when compiling with SANITIZE=leakJeff King2022-10-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cherry pick commit d3775de0 (Makefile: force -O0 when compiling with SANITIZE=leak, 2022-10-18), as otherwise the leak checker at GitHub Actions CI seems to fail with a false positive. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Downmerge a handful of topics for 2.38.2Junio C Hamano2022-10-262-1/+48
| | | | | | | | | |
* | | | | | | | | | Merge branch 'jk/cleanup-callback-parameters' into maint-2.38Junio C Hamano2022-10-264-57/+17
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code clean-up. * jk/cleanup-callback-parameters: attr: drop DEBUG_ATTR code commit: avoid writing to global in option callback multi-pack-index: avoid writing to global in option callback test-submodule: inline resolve_relative_url() function
| * | | | | | | | | | attr: drop DEBUG_ATTR codeJeff King2022-10-061-38/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since its inception in d0bfd026a8 (Add basic infrastructure to assign attributes to paths, 2007-04-12), the attribute code carries a little bit of debug code that is conditionally compiled only when DEBUG_ATTR is set. But since you have to know about it and make a special build of Git to use it, it's not clear that it's helping anyone (and there are very few mentions of it on the list over the years). Meanwhile, it causes slight headaches. Since it's not built as part of a regular compile, it's subject to bitrot. E.g., this was dealt with in 712efb1a42 (attr: make it build with DEBUG_ATTR again, 2013-01-15), and it currently fails to build with DEVELOPER=1 since e810e06357 (attr: tighten const correctness with git_attr and match_attr, 2017-01-27). And it causes confusion with -Wunused-parameter; the "what" parameter of fill_one() is unused in a normal build, but needed in a debug build. Let's just get rid of this code (and the now-useless parameter). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | commit: avoid writing to global in option callbackJeff King2022-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The callback function for --trailer writes directly to the global trailer_args and ignores opt->value completely. This is OK, since that's where we expect to find the value. But it does mean the option declaration isn't as clear. E.g., we have: OPT_BOOL(0, "reset-author", &renew_authorship, ...), OPT_CALLBACK_F(0, "trailer", NULL, ..., opt_pass_trailer) In the first one we can see where the result will be stored, but in the second, we get only NULL, and you have to go read the callback. Let's pass &trailer_args, and use it in the callback. As a bonus, this silences a -Wunused-parameter warning. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | multi-pack-index: avoid writing to global in option callbackJeff King2022-10-061-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We declare the --object-dir option like: OPT_CALLBACK(0, "object-dir", &opts.object_dir, ...); but the pointer to opts.object_dir is completely unused. Instead, the callback writes directly to a global. Which fortunately happens to be opts.object_dir. So everything works as expected, but it's unnecessarily confusing. Instead, let's have the callback write to the option value pointer that has been passed in. This also quiets a -Wunused-parameter warning (since we don't otherwise look at "opt"). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | test-submodule: inline resolve_relative_url() functionJeff King2022-10-061-14/+8
| | |_|_|_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The resolve_relative_url() function takes argc and argv parameters; it then reads up to 3 elements of argv without looking at argc at all. At first glance, this seems like a bug. But it has only one caller, cmd__submodule_resolve_relative_url(), which does confirm that argc is 3. The main reason this is a separate function is that it was moved from library code in 96a28a9bc6 (submodule--helper: move "resolve-relative-url-test" to a test-tool, 2022-09-01). We can make this code simpler and more obviously safe by just inlining the function in its caller. As a bonus, this silences a -Wunused-parameter warning. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Merge branch 'rs/gc-pack-refs-simplify' into maint-2.38Junio C Hamano2022-10-261-9/+2
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code clean-up. * rs/gc-pack-refs-simplify: gc: simplify maintenance_task_pack_refs()
| * | | | | | | | | | gc: simplify maintenance_task_pack_refs()René Scharfe2022-10-051-9/+2
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass a constant string array directly to run_command_v_opt() instead of copying it into a strvec first. This shortens the code and avoids heap allocations. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Merge branch 'nb/doc-mergetool-typofix' into maint-2.38Junio C Hamano2022-10-261-1/+1
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typofix. * nb/doc-mergetool-typofix: mergetool.txt: typofix 'overwriten' -> 'overwritten'