Commit graph

65940 commits

Author SHA1 Message Date
Ævar Arnfjörð Bjarmason d7f817d376 help: note the option name on option incompatibility
Change the errors added in d35d03cf93 (help: simplify by moving to
OPT_CMDMODE(), 2021-09-22) to quote the offending option at the user
when invoked as e.g.:

    git help --guides garbage

Now instead of:

    fatal: this option doesn't take any other arguments

We'll emit:

    fatal: the '--guides' option doesn't take any non-option arguments

Let's also rename the function, as it will be extended to do other
checks that aren't "no extra argc" in a subsequent commit.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-23 13:41:36 -08:00
Ævar Arnfjörð Bjarmason 6fb427abbb help.c: split up list_all_cmds_help() function
Split up the listing of commands and aliases from
list_all_cmds_help(). This will make a subsequent functional change
smaller.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-23 13:41:36 -08:00
Ævar Arnfjörð Bjarmason bf7eed75b9 help tests: test "git" and "git help [-a|-g] spacing
There's logic in "help.c"'s "print_cmd_by_category()" to emit "help"
output with particular spacing, which doesn't make much sense when
emitting only one section with "help -g".

Let's add tests for the current spacing in preparation for a
subsequent whitespace formatting fix, and make sure that that fix
doesn't cause regressions for the "git" and "git help" output.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-23 13:41:36 -08:00
Ævar Arnfjörð Bjarmason cd87ce7d0d help.c: use puts() instead of printf{,_ln}() for consistency
Change code in "help.c" that used printf_ln() without format
specifiers to use puts() instead, as other existing code in the file
does. Let's also change related code to use puts() instead of the
equivalent of calling "printf" with a "%s\n" format.

This formatting-only change will make a subsequent functional change
easier to read, as it'll be changing code that's consistently using
the same functions to do the same things.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-23 13:41:36 -08:00
Ævar Arnfjörð Bjarmason 4bf5cdab8e help doc: add missing "]" to "[-a|--all]"
Add a missing "]" to documentation added in 63eae83f8f (help: add "-a
--verbose" to list all commands with synopsis, 2018-05-20). This made
it seem as though "--[no-]verbose" can only be provided with "--all",
not "-a". The corresponding usage information in the C
code ("builtin_help_usage") does not have the same problem.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-23 13:41:36 -08:00
Junio C Hamano e6ebfd0e8c The sixth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-18 13:53:30 -08:00
Junio C Hamano 9a1d16989f Merge branch 'jc/glossary-worktree'
"working tree" and "per-worktree ref" were in glossary, but
"worktree" itself wasn't, which has been corrected.

* jc/glossary-worktree:
  glossary: describe "worktree"
2022-02-18 13:53:30 -08:00
Junio C Hamano 122c78dcb4 Merge branch 'jd/t0015-modernize'
Test modernization.

* jd/t0015-modernize:
  t/t0015-hash.sh: remove unnecessary '\' at line end
2022-02-18 13:53:30 -08:00
Junio C Hamano c5973cb98f Merge branch 'js/short-help-outside-repo-fix'
"git cmd -h" outside a repository should error out cleanly for many
commands, but instead it hit a BUG(), which has been corrected.

* js/short-help-outside-repo-fix:
  t0012: verify that built-ins handle `-h` even without gitdir
  checkout/fetch/pull/pack-objects: allow `-h` outside a repository
2022-02-18 13:53:30 -08:00
Junio C Hamano 9b7e531f94 Merge branch 'tb/midx-no-bitmap-for-no-objects'
When there is no object to write .bitmap file for, "git
multi-pack-index" triggered an error, instead of just skipping,
which has been corrected.

* tb/midx-no-bitmap-for-no-objects:
  midx: prevent writing a .bitmap without any objects
2022-02-18 13:53:30 -08:00
Junio C Hamano 18636afdce Merge branch 'ab/release-transport-ls-refs-options'
* ab/release-transport-ls-refs-options:
  ls-remote & transport API: release "struct transport_ls_refs_options"
2022-02-18 13:53:29 -08:00
Junio C Hamano 09320a8af1 Merge branch 'ab/hash-object-leakfix'
Trivial leakfix.

* ab/hash-object-leakfix:
  hash-object: fix a trivial leak in --path
2022-02-18 13:53:29 -08:00
Junio C Hamano 5cc9522b15 Merge branch 'gc/branch-recurse-submodules'
"git branch" learned the "--recurse-submodules" option.

* gc/branch-recurse-submodules:
  branch.c: use 'goto cleanup' in setup_tracking() to fix memory leaks
  branch: add --recurse-submodules option for branch creation
  builtin/branch: consolidate action-picking logic in cmd_branch()
  branch: add a dry_run parameter to create_branch()
  branch: make create_branch() always create a branch
  branch: move --set-upstream-to behavior to dwim_and_setup_tracking()
2022-02-18 13:53:29 -08:00
Junio C Hamano 7455e33cba Merge branch 'ab/t0051-skip-on-non-windows'
Conditional test update.

* ab/t0051-skip-on-non-windows:
  t0051: use "skip_all" under !MINGW in single-test file
2022-02-18 13:53:28 -08:00
Junio C Hamano 991b4d47f0 Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'
Because a deletion of ref would need to remove it from both the
loose ref store and the packed ref store, a delete-ref operation
that logically removes one ref may end up invoking ref-transaction
hook twice, which has been corrected.

* ps/avoid-unnecessary-hook-invocation-with-packed-refs:
  refs: skip hooks when deleting uncovered packed refs
  refs: do not execute reference-transaction hook on packing refs
  refs: demonstrate excessive execution of the reference-transaction hook
  refs: allow skipping the reference-transaction hook
  refs: allow passing flags when beginning transactions
  refs: extract packed_refs_delete_refs() to allow control of transaction
2022-02-18 13:53:27 -08:00
Junio C Hamano bcd020f88e Merge branch 'pw/use-in-process-checkout-in-rebase'
Use an internal call to reset_head() helper function instead of
spawning "git checkout" in "rebase", and update code paths that are
involved in the change.

* pw/use-in-process-checkout-in-rebase:
  rebase -m: don't fork git checkout
  rebase --apply: set ORIG_HEAD correctly
  rebase --apply: fix reflog
  reset_head(): take struct rebase_head_opts
  rebase: cleanup reset_head() calls
  create_autostash(): remove unneeded parameter
  reset_head(): make default_reflog_action optional
  reset_head(): factor out ref updates
  reset_head(): remove action parameter
  rebase --apply: don't run post-checkout hook if there is an error
  rebase: do not remove untracked files on checkout
  rebase: pass correct arguments to post-checkout hook
  t5403: refactor rebase post-checkout hook tests
  rebase: factor out checkout for up to date branch
2022-02-18 13:53:27 -08:00
Junio C Hamano 867b520301 Merge branch 'cb/clear-quarantine-early-on-all-ref-update-errors'
"receive-pack" checks if it will do any ref updates (various
conditions could reject a push) before received objects are taken
out of the temporary directory used for quarantine purposes, so
that a push that is known-to-fail will not leave crufts that a
future "gc" needs to clean up.

* cb/clear-quarantine-early-on-all-ref-update-errors:
  receive-pack: purge temporary data if no command is ready to run
2022-02-18 13:53:27 -08:00
Junio C Hamano e2ac9141e6 The fifth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-17 16:25:06 -08:00
Junio C Hamano 037dbe8ed7 Merge branch 'ab/complete-show-all-commands'
The command line completion script (in contrib/) learned to
complete all Git subcommands, including the ones that are normally
hidden, when GIT_COMPLETION_SHOW_ALL_COMMANDS is used.

* ab/complete-show-all-commands:
  completion: add a GIT_COMPLETION_SHOW_ALL_COMMANDS
  completion tests: re-source git-completion.bash in a subshell
2022-02-17 16:25:06 -08:00
Junio C Hamano 6cfe518967 Merge branch 'sy/modernize-t-lib-read-tree-m-3way'
Style updates on a test script helper.

* sy/modernize-t-lib-read-tree-m-3way:
  t/lib-read-tree-m-3way: indent with tabs
  t/lib-read-tree-m-3way: modernize style
2022-02-17 16:25:05 -08:00
Junio C Hamano a4ec347888 Merge branch 'po/doc-check-ignore-markup-fix'
Typofix.

* po/doc-check-ignore-markup-fix:
  doc: check-ignore: code-quote an exclamation mark
2022-02-17 16:25:05 -08:00
Junio C Hamano ff6f1695a3 Merge branch 'js/scalar-global-options'
Scalar update.

* js/scalar-global-options:
  scalar: accept -C and -c options before the subcommand
2022-02-17 16:25:05 -08:00
Junio C Hamano 2f45f3e2bc Merge branch 'vd/sparse-clean-etc'
"git update-index", "git checkout-index", and "git clean" are
taught to work better with the sparse checkout feature.

* vd/sparse-clean-etc:
  update-index: reduce scope of index expansion in do_reupdate
  update-index: integrate with sparse index
  update-index: add tests for sparse-checkout compatibility
  checkout-index: integrate with sparse index
  checkout-index: add --ignore-skip-worktree-bits option
  checkout-index: expand sparse checkout compatibility tests
  clean: integrate with sparse index
  reset: reorder wildcard pathspec conditions
  reset: fix validation in sparse index test
2022-02-17 16:25:05 -08:00
Junio C Hamano 708cbef33a Merge branch 'jz/rev-list-exclude-first-parent-only'
"git log" and friends learned an option --exclude-first-parent-only
to propagate UNINTERESTING bit down only along the first-parent
chain, just like --first-parent option shows commits that lack the
UNINTERESTING bit only along the first-parent chain.

* jz/rev-list-exclude-first-parent-only:
  git-rev-list: add --exclude-first-parent-only flag
2022-02-17 16:25:05 -08:00
Junio C Hamano d077db1df0 Merge branch 'jz/patch-id-hunk-header-parsing-fix'
Unlike "git apply", "git patch-id" did not handle patches with
hunks that has only 1 line in either preimage or postimage, which
has been corrected.

* jz/patch-id-hunk-header-parsing-fix:
  patch-id: fix scan_hunk_header on diffs with 1 line of before/after
  patch-id: fix antipatterns in tests
2022-02-17 16:25:04 -08:00
Junio C Hamano 75ff34bcf7 Merge branch 'hn/reftable-tests'
Prepare more test scripts for the introduction of reftable.

* hn/reftable-tests:
  t5312: prepare for reftable
  t1405: mark test that checks existence as REFFILES
  t1405: explictly delete reflogs for reftable
2022-02-17 16:25:04 -08:00
Junio C Hamano 0ac270cf7c Merge branch 'tk/subtree-merge-not-ff-only'
When "git subtree" wants to create a merge, it used "git merge" and
let it be affected by end-user's "merge.ff" configuration, which
has been corrected.

* tk/subtree-merge-not-ff-only:
  subtree: force merge commit
2022-02-17 16:25:04 -08:00
Junio C Hamano 45fe28c951 The fourth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-16 15:14:30 -08:00
Junio C Hamano 834625bd6f Merge branch 'ab/do-not-hide-failures-in-git-dot-pm'
Git.pm update.

* ab/do-not-hide-failures-in-git-dot-pm:
  perl Git.pm: don't ignore signalled failure in _cmd_close()
2022-02-16 15:14:30 -08:00
Junio C Hamano b9f791aee6 Merge branch 'js/no-more-legacy-stash'
Removal of unused code and doc.

* js/no-more-legacy-stash:
  stash: stop warning about the obsolete `stash.useBuiltin` config setting
  stash: remove documentation for `stash.useBuiltin`
  add: remove support for `git-legacy-stash`
  git-sh-setup: remove remnant bits referring to `git-legacy-stash`
2022-02-16 15:14:30 -08:00
Junio C Hamano 9a160990ef Merge branch 'js/diff-filter-negation-fix'
"git diff --diff-filter=aR" is now parsed correctly.

* js/diff-filter-negation-fix:
  diff-filter: be more careful when looking for negative bits
  diff.c: move the diff filter bits definitions up a bit
  docs(diff): lose incorrect claim about `diff-files --diff-filter=A`
2022-02-16 15:14:30 -08:00
Junio C Hamano 70ff41ffcf Merge branch 'en/fetch-negotiation-default-fix'
Interaction between fetch.negotiationAlgorithm and
feature.experimental configuration variables has been corrected.

* en/fetch-negotiation-default-fix:
  repo-settings: rename the traditional default fetch.negotiationAlgorithm
  repo-settings: fix error handling for unknown values
  repo-settings: fix checking for fetch.negotiationAlgorithm=default
2022-02-16 15:14:30 -08:00
Junio C Hamano 00e38ba6d8 Merge branch 'ab/auto-detect-zlib-compress2'
The build procedure has been taught to notice older version of zlib
and enable our replacement uncompress2() automatically.

* ab/auto-detect-zlib-compress2:
  compat: auto-detect if zlib has uncompress2()
2022-02-16 15:14:30 -08:00
Junio C Hamano f2cb46a6b3 Merge branch 'tb/midx-bitmap-corruption-fix'
A bug that made multi-pack bitmap and the object order out-of-sync,
making the .midx data corrupt, has been fixed.

* tb/midx-bitmap-corruption-fix:
  pack-bitmap.c: gracefully fallback after opening pack/MIDX
  midx: read `RIDX` chunk when present
  t/lib-bitmap.sh: parameterize tests over reverse index source
  t5326: move tests to t/lib-bitmap.sh
  t5326: extract `test_rev_exists`
  t5326: drop unnecessary setup
  pack-revindex.c: instrument loading on-disk reverse index
  midx.c: make changing the preferred pack safe
  t5326: demonstrate bitmap corruption after permutation
2022-02-16 15:14:29 -08:00
Junio C Hamano 90b7153806 Merge branch 'en/remerge-diff'
"git log --remerge-diff" shows the difference from mechanical merge
result and the result that is actually recorded in a merge commit.

* en/remerge-diff:
  diff-merges: avoid history simplifications when diffing merges
  merge-ort: mark conflict/warning messages from inner merges as omittable
  show, log: include conflict/warning messages in --remerge-diff headers
  diff: add ability to insert additional headers for paths
  merge-ort: format messages slightly different for use in headers
  merge-ort: mark a few more conflict messages as omittable
  merge-ort: capture and print ll-merge warnings in our preferred fashion
  ll-merge: make callers responsible for showing warnings
  log: clean unneeded objects during `log --remerge-diff`
  show, log: provide a --remerge-diff capability
2022-02-16 15:14:29 -08:00
Junio C Hamano 34230514b8 Merge branch 'hn/reftable-coverity-fixes'
Problems identified by Coverity in the reftable code have been
corrected.

* hn/reftable-coverity-fixes:
  reftable: add print functions to the record types
  reftable: make reftable_record a tagged union
  reftable: remove outdated file reftable.c
  reftable: implement record equality generically
  reftable: make reftable-record.h function signatures const correct
  reftable: handle null refnames in reftable_ref_record_equal
  reftable: drop stray printf in readwrite_test
  reftable: order unittests by complexity
  reftable: all xxx_free() functions accept NULL arguments
  reftable: fix resource warning
  reftable: ignore remove() return value in stack_test.c
  reftable: check reftable_stack_auto_compact() return value
  reftable: fix resource leak blocksource.c
  reftable: fix resource leak in block.c error path
  reftable: fix OOB stack write in print functions
2022-02-16 15:14:28 -08:00
Junio C Hamano dd77ff8181 Merge branch 'll/doc-mktree-typofix'
Typofix.

* ll/doc-mktree-typofix:
  fix typo in git-mktree.txt
2022-02-16 15:14:26 -08:00
Junio C Hamano 9d2f9a6188 Merge branch 'ld/sparse-index-bash-completion'
The command line completion (in contrib/) learns to complete
arguments to give to "git sparse-checkout" command.

* ld/sparse-index-bash-completion:
  completion: handle unusual characters for sparse-checkout
  completion: improve sparse-checkout cone mode directory completion
  completion: address sparse-checkout issues
2022-02-16 15:14:26 -08:00
Junio C Hamano b80121027d The third batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-11 16:56:01 -08:00
Junio C Hamano acd920a0ee Merge branch 'sy/diff-usage-typofix'
Typofix.

* sy/diff-usage-typofix:
  builtin/diff.c: fix "git-diff" usage string typo
2022-02-11 16:56:01 -08:00
Junio C Hamano c73d46b3a8 Merge branch 'tg/fetch-prune-exit-code-fix'
When "git fetch --prune" failed to prune the refs it wanted to
prune, the command issued error messages but exited with exit
status 0, which has been corrected.

* tg/fetch-prune-exit-code-fix:
  fetch --prune: exit with error if pruning fails
2022-02-11 16:56:01 -08:00
Junio C Hamano 9210a00d65 Merge branch 'en/sparse-checkout-leakfix'
Leakfix.

* en/sparse-checkout-leakfix:
  sparse-checkout: fix a couple minor memory leaks
2022-02-11 16:56:01 -08:00
Junio C Hamano b855f5045e Merge branch 'rc/negotiate-only-typofix'
Typofix.

* rc/negotiate-only-typofix:
  fetch: fix negotiate-only error message
2022-02-11 16:55:59 -08:00
Junio C Hamano 83760938bd Merge branch 'jc/doc-log-messages'
Update the contributor-facing documents on proposed log messages.

* jc/doc-log-messages:
  SubmittingPatches: explain why we care about log messages
  CodingGuidelines: hint why we value clearly written log messages
  SubmittingPatches: write problem statement in the log in the present tense
2022-02-11 16:55:58 -08:00
Junio C Hamano 03bdcfcc78 Merge branch 'ab/no-errno-from-resolve-ref-unsafe'
Remaining code-clean-up.

* ab/no-errno-from-resolve-ref-unsafe:
  refs API: remove "failure_errno" from refs_resolve_ref_unsafe()
  sequencer: don't use die_errno() on refs_resolve_ref_unsafe() failure
2022-02-11 16:55:58 -08:00
Junio C Hamano c46452eb98 Merge branch 'gh/doc-typos'
Typofix.

* gh/doc-typos:
  Documentation/config/pgp.txt: add missing apostrophe
  Documentation/config/pgp.txt: replace stray <TAB> character with <SPC>
2022-02-11 16:55:58 -08:00
Junio C Hamano e66e9906e6 Merge branch 'rs/parse-options-lithelp-help'
Comment update.

* rs/parse-options-lithelp-help:
  parse-options: document bracketing of argh
2022-02-11 16:55:58 -08:00
Junio C Hamano d073bdc6a0 Merge branch 'bc/csprng-mktemps'
Pick a better random number generator and use it when we prepare
temporary filenames.

* bc/csprng-mktemps:
  wrapper: use a CSPRNG to generate random file names
  wrapper: add a helper to generate numbers from a CSPRNG
2022-02-11 16:55:57 -08:00
Junio C Hamano 8db2f665e1 Merge branch 'bc/clarify-eol-attr'
Doc and test update around the eol attribute.

* bc/clarify-eol-attr:
  docs: correct documentation about eol attribute
  t0027: add tests for eol without text in .gitattributes
2022-02-11 16:55:57 -08:00
Junio C Hamano 2df5387ed0 glossary: describe "worktree"
We have description on "per worktree ref", but "worktree" is not
described in the glossary.  We do have "working tree", though.

Casually put, a "working tree" is what your editor and compiler
interacts with.  "worktree" is a mechanism to allow one or more
"working tree"s to be attached to a repository and used to check out
different commits and branches independently, which includes not
just a "working tree" but also repository metadata like HEAD, the
index to support simultaneous use of them.  Historically, we used
these terms interchangeably but we have been trying to use "working
tree" when we mean it, instead of "worktree".

Most of the existing references to "working tree" in the glossary do
refer primarily to the working tree portion, except for one that
said refs like HEAD and refs/bisect/* are per "working tree", but it
is more precise to say they are per "worktree".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-09 18:34:41 -08:00