]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
6 weeks agoMerge branch 'pb/advice-merge-conflict'
Junio C Hamano [Mon, 1 Apr 2024 20:21:34 +0000 (13:21 -0700)] 
Merge branch 'pb/advice-merge-conflict'

Hints that suggest what to do after resolving conflicts can now be
squelched by disabling advice.mergeConflict.

Acked-by: Phillip Wood <phillip.wood123@gmail.com>
cf. <e040c631-42d9-4501-a7b8-046f8dac6309@gmail.com>

* pb/advice-merge-conflict:
  builtin/am: allow disabling conflict advice
  sequencer: allow disabling conflict advice

6 weeks agoMerge branch 'ds/config-internal-whitespace-fix'
Junio C Hamano [Mon, 1 Apr 2024 20:21:34 +0000 (13:21 -0700)] 
Merge branch 'ds/config-internal-whitespace-fix'

"git config" corrupted literal HT characters written in the
configuration file as part of a value, which has been corrected.

* ds/config-internal-whitespace-fix:
  config.txt: describe handling of whitespace further
  t1300: add more tests for whitespace and inline comments
  config: really keep value-internal whitespace verbatim
  config: minor addition of whitespace

6 weeks agoMerge branch 'jk/pretty-subject-cleanup'
Junio C Hamano [Mon, 1 Apr 2024 20:21:33 +0000 (13:21 -0700)] 
Merge branch 'jk/pretty-subject-cleanup'

Code clean-up in the "git log" machinery that implements custom log
message formatting.

* jk/pretty-subject-cleanup:
  format-patch: fix leak of empty header string
  format-patch: simplify after-subject MIME header handling
  format-patch: return an allocated string from log_write_email_headers()
  log: do not set up extra_headers for non-email formats
  pretty: drop print_email_subject flag
  pretty: split oneline and email subject printing
  shortlog: stop setting pp.print_email_subject

6 weeks agoMerge branch 'pw/checkout-conflict-errorfix'
Junio C Hamano [Mon, 1 Apr 2024 20:21:33 +0000 (13:21 -0700)] 
Merge branch 'pw/checkout-conflict-errorfix'

"git checkout --conflict=bad" reported a bad conflictStyle as if it
were given to a configuration variable; it has been corrected to
report that the command line option is bad.

* pw/checkout-conflict-errorfix:
  checkout: fix interaction between --conflict and --merge
  checkout: cleanup --conflict=<style> parsing
  merge options: add a conflict style member
  merge-ll: introduce LL_MERGE_OPTIONS_INIT
  xdiff-interface: refactor parsing of merge.conflictstyle

7 weeks agoThe twelfth batch
Junio C Hamano [Thu, 28 Mar 2024 21:13:37 +0000 (14:13 -0700)] 
The twelfth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agoMerge branch 'jk/drop-hg-to-git'
Junio C Hamano [Thu, 28 Mar 2024 21:13:51 +0000 (14:13 -0700)] 
Merge branch 'jk/drop-hg-to-git'

Remove an ancient and not well maintained Hg-to-git migration
script from contrib/.

Acked-by: Stelian Pop <stelian@popies.net>
cf. <37e4cd61-b370-437e-bd42-f98f47d3ad32@popies.net>

* jk/drop-hg-to-git:
  contrib: drop hg-to-git script

7 weeks agoMerge branch 'rs/t-prio-queue-fixes'
Junio C Hamano [Thu, 28 Mar 2024 21:13:51 +0000 (14:13 -0700)] 
Merge branch 'rs/t-prio-queue-fixes'

Test clean-up.

* rs/t-prio-queue-fixes:
  t-prio-queue: check result array bounds
  t-prio-queue: shorten array index message

7 weeks agoMerge branch 'bt/fuzz-config-parse'
Junio C Hamano [Thu, 28 Mar 2024 21:13:51 +0000 (14:13 -0700)] 
Merge branch 'bt/fuzz-config-parse'

A new fuzz target that exercises config parsing code has been
added.

* bt/fuzz-config-parse:
  fuzz: add fuzzer for config parsing

7 weeks agoMerge branch 'jc/show-untracked-false'
Junio C Hamano [Thu, 28 Mar 2024 21:13:50 +0000 (14:13 -0700)] 
Merge branch 'jc/show-untracked-false'

The status.showUntrackedFiles configuration variable had a name
that tempts users to set a Boolean value expressed in our usual
"false", "off", and "0", but it only took "no".  This has been
corrected so "true" and its synonyms are taken as "normal", while
"false" and its synonyms are taken as "no".

* jc/show-untracked-false:
  status: allow --untracked=false and friends
  status: unify parsing of --untracked= and status.showUntrackedFiles

7 weeks agoMerge branch 'ph/diff-src-dst-prefix-config'
Junio C Hamano [Thu, 28 Mar 2024 21:13:50 +0000 (14:13 -0700)] 
Merge branch 'ph/diff-src-dst-prefix-config'

"git diff" and friends learned two extra configuration variables,
diff.srcPrefix and diff.dstPrefix.

* ph/diff-src-dst-prefix-config:
  diff.*Prefix: use camelCase in the doc and test titles
  diff: add diff.srcPrefix and diff.dstPrefix configuration variables

7 weeks agoMerge branch 'eb/hash-transition'
Junio C Hamano [Thu, 28 Mar 2024 21:13:50 +0000 (14:13 -0700)] 
Merge branch 'eb/hash-transition'

Work to support a repository that work with both SHA-1 and SHA-256
hash algorithms has started.

* eb/hash-transition: (30 commits)
  t1016-compatObjectFormat: add tests to verify the conversion between objects
  t1006: test oid compatibility with cat-file
  t1006: rename sha1 to oid
  test-lib: compute the compatibility hash so tests may use it
  builtin/ls-tree: let the oid determine the output algorithm
  object-file: handle compat objects in check_object_signature
  tree-walk: init_tree_desc take an oid to get the hash algorithm
  builtin/cat-file: let the oid determine the output algorithm
  rev-parse: add an --output-object-format parameter
  repository: implement extensions.compatObjectFormat
  object-file: update object_info_extended to reencode objects
  object-file-convert: convert commits that embed signed tags
  object-file-convert: convert commit objects when writing
  object-file-convert: don't leak when converting tag objects
  object-file-convert: convert tag objects when writing
  object-file-convert: add a function to convert trees between algorithms
  object: factor out parse_mode out of fast-import and tree-walk into in object.h
  cache: add a function to read an OID of a specific algorithm
  tag: sign both hashes
  commit: export add_header_signature to support handling signatures on tags
  ...

7 weeks agoThe eleventh batch
Junio C Hamano [Mon, 25 Mar 2024 23:16:20 +0000 (16:16 -0700)] 
The eleventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agoMerge branch 'bl/doc-key-val-sep-fix'
Junio C Hamano [Mon, 25 Mar 2024 23:16:35 +0000 (16:16 -0700)] 
Merge branch 'bl/doc-key-val-sep-fix'

The documentation for "%(trailers[:options])" placeholder in the
"--pretty" option of commands in the "git log" family has been
updated.

* bl/doc-key-val-sep-fix:
  docs: adjust trailer `separator` and `key_value_separator` language
  docs: correct trailer `key_value_separator` description

7 weeks agoMerge branch 'bl/doc-config-fixes'
Junio C Hamano [Mon, 25 Mar 2024 23:16:35 +0000 (16:16 -0700)] 
Merge branch 'bl/doc-config-fixes'

A few typoes in "git config --help" have been corrected.

* bl/doc-config-fixes:
  docs: fix typo in git-config `--default`
  docs: clarify file options in git-config `--edit`

7 weeks agoMerge branch 'ja/doc-formatting-fix'
Junio C Hamano [Mon, 25 Mar 2024 23:16:34 +0000 (16:16 -0700)] 
Merge branch 'ja/doc-formatting-fix'

Documentation mark-up fix.

* ja/doc-formatting-fix:
  doc: fix some placeholders formating
  doc: format alternatives in synopsis

7 weeks agoMerge branch 'bb/sh-scripts-cleanup'
Junio C Hamano [Mon, 25 Mar 2024 23:16:34 +0000 (16:16 -0700)] 
Merge branch 'bb/sh-scripts-cleanup'

Shell scripts clean-up.

* bb/sh-scripts-cleanup: (22 commits)
  git-quiltimport: avoid an unnecessary subshell
  contrib/coverage-diff: avoid redundant pipelines
  t/t9*: merge "grep | sed" pipelines
  t/t8*: merge "grep | sed" pipelines
  t/t5*: merge a "grep | sed" pipeline
  t/t4*: merge a "grep | sed" pipeline
  t/t3*: merge a "grep | awk" pipeline
  t/t1*: merge a "grep | sed" pipeline
  t/t9*: avoid redundant uses of cat
  t/t8*: avoid redundant use of cat
  t/t7*: avoid redundant use of cat
  t/t6*: avoid redundant uses of cat
  t/t5*: avoid redundant uses of cat
  t/t4*: avoid redundant uses of cat
  t/t3*: avoid redundant uses of cat
  t/t1*: avoid redundant uses of cat
  t/t0*: avoid redundant uses of cat
  t/perf: avoid redundant use of cat
  t/annotate-tests.sh: avoid redundant use of cat
  t/lib-cvs.sh: avoid redundant use of cat
  ...

7 weeks agoMerge branch 'jc/index-pack-fsck-levels'
Junio C Hamano [Mon, 25 Mar 2024 23:16:34 +0000 (16:16 -0700)] 
Merge branch 'jc/index-pack-fsck-levels'

Test fix.

* jc/index-pack-fsck-levels:
  t5300: fix test_with_bad_commit()

7 weeks agoMerge branch 'js/bugreport-no-suffix-fix'
Junio C Hamano [Mon, 25 Mar 2024 23:16:34 +0000 (16:16 -0700)] 
Merge branch 'js/bugreport-no-suffix-fix'

"git bugreport --no-suffix" was not supported and instead
segfaulted, which has been corrected.

* js/bugreport-no-suffix-fix:
  bugreport.c: fix a crash in `git bugreport` with `--no-suffix` option

7 weeks agoMerge branch 'rj/restore-plug-leaks'
Junio C Hamano [Mon, 25 Mar 2024 23:16:33 +0000 (16:16 -0700)] 
Merge branch 'rj/restore-plug-leaks'

Leaks from "git restore" have been plugged.

* rj/restore-plug-leaks:
  checkout: plug some leaks in git-restore

8 weeks agoformat-patch: fix leak of empty header string
Jeff King [Fri, 22 Mar 2024 09:59:51 +0000 (05:59 -0400)] 
format-patch: fix leak of empty header string

The log_write_email_headers() function recently learned to return the
"extra_headers_p" variable to the caller as an allocated string. We
start by copying rev_info.extra_headers into a strbuf, and then detach
the strbuf at the end of the function. If there are no extra headers, we
leave the strbuf empty. Likewise, if there are no headers to return, we
pass back NULL.

This misses a corner case which can cause a leak. The "do we have any
headers to copy" check is done by looking for a NULL opt->extra_headers.
But the "do we have a non-empty string to return" check is done by
checking the length of the strbuf. That means if opt->extra_headers is
the empty string, we'll "copy" it into the strbuf, triggering an
allocation, but then leak the buffer when we return NULL from the
function.

We can solve this in one of two ways:

  1. Rather than checking headers->len at the end, we could check
     headers->alloc to see if we allocated anything. That retains the
     original behavior before the recent change, where an empty
     extra_headers string is "passed through" to the caller. In practice
     this doesn't matter, though (the code which eventually looks at the
     result treats NULL or the empty string the same).

  2. Only bother copying a non-empty string into the strbuf. This has
     the added bonus of avoiding a pointless allocation.

     Arguably strbuf_addstr() could do this optimization itself, though
     it may be slightly dangerous to do so (some existing callers may
     not get a fresh allocation when they expect to). In theory callers
     are all supposed to use strbuf_detach() in such a case, but there's
     no guarantee that this is the case.

This patch uses option 2. Without it, building with SANITIZE=leak shows
many errors in t4021 and elsewhere.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoconfig.txt: describe handling of whitespace further
Dragan Simic [Thu, 21 Mar 2024 06:06:08 +0000 (07:06 +0100)] 
config.txt: describe handling of whitespace further

Make it more clear what the whitespace characters are in the context of git
configuration files, and significantly improve the description of the leading
and trailing whitespace handling, especially how it works out together with
the presence of inline comments.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agot1300: add more tests for whitespace and inline comments
Dragan Simic [Thu, 21 Mar 2024 06:06:07 +0000 (07:06 +0100)] 
t1300: add more tests for whitespace and inline comments

Add a handful of additional tests, to improve the coverage of the handling
of configuration file entries whose values contain internal whitespace,
leading and/or trailing whitespace, which may or may not be enclosed within
quotation marks, or which contain an additional inline comment.

At the same time, rework one already existing whitespace-related test a bit,
to ensure its consistency with the newly added tests.  This change introduced
no functional changes to the already existing test.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoconfig: really keep value-internal whitespace verbatim
Dragan Simic [Thu, 21 Mar 2024 06:06:06 +0000 (07:06 +0100)] 
config: really keep value-internal whitespace verbatim

Fix a bug in function parse_value() that prevented whitespace characters
(i.e. spaces and horizontal tabs) found inside configuration option values
from being parsed and returned in their original form.  The bug caused any
number of consecutive whitespace characters to be wrongly "squashed" into
the same number of space characters.

This bug was introduced back in July 2009, in commit ebdaae372b46 ("config:
Keep inner whitespace verbatim").

Further investigation showed that setting a configuration value, by invoking
git-config(1), converts value-internal horizontal tabs into "\t" escape
sequences, which the buggy value-parsing logic in function parse_value()
didn't "squash" into spaces.  That's why the test included in the ebdaae37
commit passed, which presumably made the bug remain undetected for this long.
On the other hand, value-internal literal horizontal tab characters, found in
a configuration file edited by hand, do get "squashed" by the value-parsing
logic, so the right choice was to fix this bug by making the value-internal
whitespace characters preserved verbatim.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoconfig: minor addition of whitespace
Dragan Simic [Thu, 21 Mar 2024 06:06:05 +0000 (07:06 +0100)] 
config: minor addition of whitespace

In general, binary operators should be enclosed in a pair of leading and
trailing space (SP) characters.  Thus, clean up one spotted expression that
for some reason had a "bunched up" operator.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoThe tenth batch
Junio C Hamano [Thu, 21 Mar 2024 21:54:56 +0000 (14:54 -0700)] 
The tenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoMerge branch 'bb/t0006-negative-tz-offset'
Junio C Hamano [Thu, 21 Mar 2024 21:55:14 +0000 (14:55 -0700)] 
Merge branch 'bb/t0006-negative-tz-offset'

More tests on showing time with negative TZ offset.

* bb/t0006-negative-tz-offset:
  t0006: add more tests with a negative TZ offset

8 weeks agoMerge branch 'bb/iso-strict-utc'
Junio C Hamano [Thu, 21 Mar 2024 21:55:14 +0000 (14:55 -0700)] 
Merge branch 'bb/iso-strict-utc'

The output format for dates "iso-strict" has been tweaked to show
a time in the Zulu timezone with "Z" suffix, instead of "+00:00".

* bb/iso-strict-utc:
  date: make "iso-strict" conforming for the UTC timezone

8 weeks agoMerge branch 'jw/doc-show-untracked-files-fix'
Junio C Hamano [Thu, 21 Mar 2024 21:55:14 +0000 (14:55 -0700)] 
Merge branch 'jw/doc-show-untracked-files-fix'

The status.showUntrackedFiles configuration variable was
incorrectly documented to accept "false", which has been corrected.

* jw/doc-show-untracked-files-fix:
  doc: status.showUntrackedFiles does not take "false"

8 weeks agoMerge branch 'dg/user-manual-hash-example'
Junio C Hamano [Thu, 21 Mar 2024 21:55:13 +0000 (14:55 -0700)] 
Merge branch 'dg/user-manual-hash-example'

User manual (the original one) update.

* dg/user-manual-hash-example:
  Documentation/user-manual.txt: example for generating object hashes

8 weeks agoMerge branch 'ja/doc-markup-fixes'
Junio C Hamano [Thu, 21 Mar 2024 21:55:13 +0000 (14:55 -0700)] 
Merge branch 'ja/doc-markup-fixes'

Mark-ups used in the documentation has been improved for
consistency.

* ja/doc-markup-fixes:
  doc: git-clone: format placeholders
  doc: git-clone: format verbatim words
  doc: git-init: rework config item init.templateDir
  doc: git-init: rework definition lists
  doc: git-init: format placeholders
  doc: git-init: format verbatim parts

8 weeks agoMerge branch 'pb/ci-win-artifact-names-fix'
Junio C Hamano [Thu, 21 Mar 2024 21:55:13 +0000 (14:55 -0700)] 
Merge branch 'pb/ci-win-artifact-names-fix'

CI update.

* pb/ci-win-artifact-names-fix:
  ci(github): make Windows test artifacts name unique

8 weeks agoMerge branch 'ps/reftable-reflog-iteration-perf'
Junio C Hamano [Thu, 21 Mar 2024 21:55:13 +0000 (14:55 -0700)] 
Merge branch 'ps/reftable-reflog-iteration-perf'

The code to iterate over reflogs in the reftable has been optimized
to reduce memory allocation and deallocation.

Reviewed-by: Josh Steadmon <steadmon@google.com>
cf. <Ze9eX-aaWoVaqsPP@google.com>

* ps/reftable-reflog-iteration-perf:
  refs/reftable: track last log record name via strbuf
  reftable/record: use scratch buffer when decoding records
  reftable/record: reuse message when decoding log records
  reftable/record: reuse refnames when decoding log records
  reftable/record: avoid copying author info
  reftable/record: convert old and new object IDs to arrays
  refs/reftable: reload correct stack when creating reflog iter

8 weeks agoMerge branch 'jc/safe-implicit-bare'
Junio C Hamano [Thu, 21 Mar 2024 21:55:13 +0000 (14:55 -0700)] 
Merge branch 'jc/safe-implicit-bare'

Users with safe.bareRepository=explicit can still work from within
$GIT_DIR of a seconary worktree (which resides at .git/worktrees/$name/)
of the primary worktree without explicitly specifying the $GIT_DIR
environment variable or the --git-dir=<path> option.

* jc/safe-implicit-bare:
  setup: notice more types of implicit bare repositories

8 weeks agoMerge branch 'fs/find-end-of-log-message-fix'
Junio C Hamano [Thu, 21 Mar 2024 21:55:12 +0000 (14:55 -0700)] 
Merge branch 'fs/find-end-of-log-message-fix'

The code to find the effective end of log message can fall into an
endless loop, which has been corrected.

* fs/find-end-of-log-message-fix:
  wt-status: don't find scissors line beyond buf len

8 weeks agoMerge branch 'ps/reftable-block-search-fix'
Junio C Hamano [Thu, 21 Mar 2024 21:55:12 +0000 (14:55 -0700)] 
Merge branch 'ps/reftable-block-search-fix'

The reftable code has its own custom binary search function whose
comparison callback has an unusual interface, which caused the
binary search to degenerate into a linear search, which has been
corrected.

* ps/reftable-block-search-fix:
  reftable/block: fix binary search over restart counter
  reftable/record: fix memory leak when decoding object records

8 weeks agoMerge branch 'ps/reftable-stack-tempfile'
Junio C Hamano [Thu, 21 Mar 2024 21:55:12 +0000 (14:55 -0700)] 
Merge branch 'ps/reftable-stack-tempfile'

The code in reftable backend that creates new table files works
better with the tempfile framework to avoid leaving cruft after a
failure.

* ps/reftable-stack-tempfile:
  reftable/stack: register compacted tables as tempfiles
  reftable/stack: register lockfiles during compaction
  reftable/stack: register new tables as tempfiles
  lockfile: report when rollback fails

8 weeks agoMerge branch 'rs/opt-parse-long-fixups'
Junio C Hamano [Thu, 21 Mar 2024 21:55:12 +0000 (14:55 -0700)] 
Merge branch 'rs/opt-parse-long-fixups'

The parse-options code that deals with abbreviated long option
names have been cleaned up.

Reviewed-by: Josh Steadmon <steadmon@google.com>
cf. <ZfDM5Or3EKw7Q9SA@google.com>

* rs/opt-parse-long-fixups:
  parse-options: rearrange long_name matching code
  parse-options: normalize arg and long_name before comparison
  parse-options: detect ambiguous self-negation
  parse-options: factor out register_abbrev() and struct parsed_option
  parse-options: set arg of abbreviated option lazily
  parse-options: recognize abbreviated negated option with arg

8 weeks agocontrib: drop hg-to-git script
Jeff King [Wed, 20 Mar 2024 09:48:24 +0000 (05:48 -0400)] 
contrib: drop hg-to-git script

The hg-to-git script is full of command injection vulnerabilities
against malicious branch and tag names. It's also old and largely
unmaintained; the last commit was over 4 years ago, and the last code
change before that was from 2013. Users are better off with a modern
remote-helper tool like cinnabar or remote-hg.

So rather than spending time to fix it, let's just get rid of it.

Reported-by: Matthew Rollings <admin@stealthcopter.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoformat-patch: simplify after-subject MIME header handling
Jeff King [Wed, 20 Mar 2024 00:35:57 +0000 (20:35 -0400)] 
format-patch: simplify after-subject MIME header handling

In log_write_email_headers(), we append our MIME headers to the set of
extra headers by creating a new strbuf, adding the existing headers, and
then adding our new ones.  We had to do it this way when our output
buffer might point to the constant opt->extra_headers variable.

But since the previous commit, we always make a local copy of that
variable. Let's turn that into a strbuf, which lets the MIME code simply
append to it. That simplifies the function and avoids a pointless extra
copy of the headers.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoformat-patch: return an allocated string from log_write_email_headers()
Jeff King [Wed, 20 Mar 2024 00:35:33 +0000 (20:35 -0400)] 
format-patch: return an allocated string from log_write_email_headers()

When pretty-printing a commit in the email format, we have to fill in
the "after subject" field of the pretty_print_context with any extra
headers the user provided (e.g., from "--to" or "--cc" options) plus any
special MIME headers.

We return an out-pointer that sometimes points to a newly heap-allocated
string and sometimes not. To avoid leaking, we store the allocated
version in a buffer with static lifetime, which is ugly. Worse, as we
extend the header feature, we'll end up having to repeat this ugly
pattern.

Instead, let's have our out-pointer pass ownership back to the caller,
and duplicate the string when necessary. This does mean one extra
allocation per commit when you use extra headers, but in the context of
format-patch which is showing diffs, I don't think that's even
measurable.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agolog: do not set up extra_headers for non-email formats
Jeff King [Wed, 20 Mar 2024 00:31:39 +0000 (20:31 -0400)] 
log: do not set up extra_headers for non-email formats

The commit pretty-printer code has an "after_subject" parameter which it
uses to insert extra headers into the email format. In show_log() we set
this by calling log_write_email_headers() if we are using an email
format, but otherwise default the variable to the rev_info.extra_headers
variable.

Since the pretty-printer code will ignore after_subject unless we are
using an email format, this default is pointless. We can just set
after_subject directly, eliminating an extra variable.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agopretty: drop print_email_subject flag
Jeff King [Wed, 20 Mar 2024 00:30:44 +0000 (20:30 -0400)] 
pretty: drop print_email_subject flag

With one exception, the print_email_subject flag is set if and only if
the commit format is email based:

  - in make_cover_letter() we set it along with CMIT_FMT_EMAIL
    explicitly

  - in show_log(), we set it if cmit_fmt_is_mail() is true. That covers
    format-patch as well as "git log --format=email" (or mboxrd).

The one exception is "rev-list --format=email", which somewhat
nonsensically prints the author and date as email headers, but no
subject, like:

  $ git rev-list --format=email HEAD
  commit 64fc4c2cdd4db2645eaabb47aa4bac820b03cdba
  From: Jeff King <peff@peff.net>
  Date: Tue, 19 Mar 2024 19:39:26 -0400

  this is the subject

  this is the body

It's doubtful that this is a useful format at all (the "commit" lines
replace the "From" lines that would make it work as an actual mbox).
But I think that printing the subject as a header (like this patch does)
is the least surprising thing to do.

So let's drop this field, making the code a little simpler and easier to
reason about. Note that we do need to set the "rev" field of the
pretty_print_context in rev-list, since that is used to check for
subject_prefix, etc. It's not possible to set those fields via rev-list,
so we'll always just print "Subject: ". But unless we pass in our
rev_info, fmt_output_email_subject() would segfault trying to figure it
out.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agopretty: split oneline and email subject printing
Jeff King [Wed, 20 Mar 2024 00:28:51 +0000 (20:28 -0400)] 
pretty: split oneline and email subject printing

The pp_title_line() function is used for two formats: the oneline format
and the subject line of the email format. But most of the logic in the
function does not make any sense for oneline; it is about special
formatting of email headers.

Lumping the two formats together made sense long ago in 4234a76167
(Extend --pretty=oneline to cover the first paragraph, 2007-06-11), when
there was a lot of manual logic to paste lines together. But later,
88c44735ab (pretty: factor out format_subject(), 2008-12-27) pulled that
logic into its own function.

We can implement the oneline format by just calling that one function.
This makes the intention of the code much more clear, as we know we only
need to worry about those extra email options when dealing with actual
email.

While the intent here is cleanup, it is possible to trigger these cases
in practice by running format-patch with an explicit --oneline option.
But if you did, the results are basically nonsense. For example, with
the preserve_subject flag:

  $ printf "%s\n" one two three | git commit --allow-empty -F -
  $ git format-patch -1 --stdout -k | grep ^Subject
  Subject: =?UTF-8?q?one=0Atwo=0Athree?=
  $ git format-patch -1 --stdout -k --oneline --no-signature
  2af7fbe one
  two
  three

Or with extra headers:

  $ git format-patch -1 --stdout --cc=me --oneline --no-signature
  2af7fbe one two three
Cc: me
So I'd actually consider this to be an improvement, though you are
probably crazy to use other formats with format-patch in the first place
(arguably it should forbid non-email formats entirely, but that's a
bigger change).

As a bonus, it eliminates some pointless extra allocations for the
oneline output. The email code, since it has to deal with wrapping,
formats into an extra auxiliary buffer. The speedup is tiny, though like
"rev-list --no-abbrev --format=oneline" seems to improve by a consistent
1-2% for me.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoshortlog: stop setting pp.print_email_subject
Jeff King [Wed, 20 Mar 2024 00:27:16 +0000 (20:27 -0400)] 
shortlog: stop setting pp.print_email_subject

When shortlog processes a commit using its internal traversal, it may
pretty-print the subject line for the summary view. When we do so, we
set the "print_email_subject" flag in the pretty-print context. But this
flag does nothing! Since we are using CMIT_FMT_USERFORMAT, we skip most
of the usual formatting code entirely.

This flag is there due to commit 6d167fd7cc (pretty: use
fmt_output_email_subject(), 2017-03-01). But that just switched us away
from setting an empty "subject" header field, which was similarly
useless. That was added by dd2e794a21 (Refactor pretty_print_commit
arguments into a struct, 2009-10-19). Before using the struct, we had to
pass _something_ as the argument, so we passed the empty string (a NULL
would have worked equally well).

So this setting has never done anything, and we can drop the line. That
shortens the code, but more importantly, makes it easier to reason about
and refactor the other users of this flag.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoThe ninth batch
Junio C Hamano [Mon, 18 Mar 2024 20:02:12 +0000 (13:02 -0700)] 
The ninth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoMerge branch 'jk/doc-remote-helpers-markup-fix'
Junio C Hamano [Mon, 18 Mar 2024 20:04:25 +0000 (13:04 -0700)] 
Merge branch 'jk/doc-remote-helpers-markup-fix'

Doc mark-up fix.

* jk/doc-remote-helpers-markup-fix:
  doc/gitremote-helpers: fix missing single-quote

8 weeks agoMerge branch 'jh/trace2-missing-def-param-fix'
Junio C Hamano [Mon, 18 Mar 2024 20:04:25 +0000 (13:04 -0700)] 
Merge branch 'jh/trace2-missing-def-param-fix'

Some trace2 events that lacked def_param have learned to show it,
enriching the output.

Reviewed-by: Josh Steadmon <steadmon@google.com>
cf. <ZejkVOVQBZhLVfHW@google.com>

* jh/trace2-missing-def-param-fix:
  trace2: emit 'def_param' set with 'cmd_name' event
  trace2: avoid emitting 'def_param' set more than once
  t0211: demonstrate missing 'def_param' events for certain commands

8 weeks agoMerge branch 'pw/rebase-i-ignore-cherry-pick-help-environment'
Junio C Hamano [Mon, 18 Mar 2024 20:04:25 +0000 (13:04 -0700)] 
Merge branch 'pw/rebase-i-ignore-cherry-pick-help-environment'

Code simplification by getting rid of code that sets an environment
variable that is no longer used.

* pw/rebase-i-ignore-cherry-pick-help-environment:
  rebase -i: stop setting GIT_CHERRY_PICK_HELP

8 weeks agodocs: adjust trailer `separator` and `key_value_separator` language
Brian Lyles [Mon, 18 Mar 2024 05:38:02 +0000 (00:38 -0500)] 
docs: adjust trailer `separator` and `key_value_separator` language

The language describing the trailer separator and key-value separator
default value is overly complicated.

Indicate the default with simpler "Defaults to ..." language.

Suggested-by: Linus Arver <linusa@google.com>
Signed-off-by: Brian Lyles <brianmlyles@gmail.com>
Acked-by: Linus Arver <linusa@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agodocs: correct trailer `key_value_separator` description
Brian Lyles [Mon, 18 Mar 2024 05:38:01 +0000 (00:38 -0500)] 
docs: correct trailer `key_value_separator` description

The description for `key_value_separator` incorrectly states that this
separator is inserted between trailer lines, which appears likely to
have been incorrectly copied from `separator` when this option was
added.

Update the description to correctly indicate that it is a separator that
appears between the key and the value of each trailer.

Signed-off-by: Brian Lyles <brianmlyles@gmail.com>
Acked-by: Linus Arver <linusa@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agobuiltin/am: allow disabling conflict advice
Philippe Blain [Sat, 16 Mar 2024 21:16:30 +0000 (21:16 +0000)] 
builtin/am: allow disabling conflict advice

When 'git am' or 'git rebase --apply' encounter a conflict, they show a
message instructing the user how to continue the operation. This message
can't be disabled.

Use ADVICE_MERGE_CONFLICT introduced in the previous commit to allow
disabling it. Update the tests accordingly, as the advice output is now
on stderr instead of stdout. In t4150, redirect stdout to 'out' and
stderr to 'err', since this is less confusing. In t4254, as we are
testing a specific failure mode of 'git am', simply disable the advice.
Note that we are not testing that this advice is shown in 'git rebase'
for the apply backend since 2ac0d6273f (rebase: change the default
backend from "am" to "merge", 2020-02-15).

Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agosequencer: allow disabling conflict advice
Philippe Blain [Sat, 16 Mar 2024 21:16:29 +0000 (21:16 +0000)] 
sequencer: allow disabling conflict advice

Allow disabling the advice shown when a squencer operation results in a
merge conflict through a new config 'advice.mergeConflict', which is
named generically such that it can be used by other commands eventually.

Remove that final '\n' in the first hunk in sequencer.c to avoid an
otherwise empty 'hint: ' line before the line 'hint: Disable this
message with "git config advice.mergeConflict false"' which is
automatically added by 'advise_if_enabled'.

Note that we use 'advise_if_enabled' for each message in the second hunk
in sequencer.c, instead of using 'if (show_hints &&
advice_enabled(...)', because the former instructs the user how to
disable the advice, which is more user-friendly.

Update the tests accordingly. Note that the body of the second test in
t3507-cherry-pick-conflict.sh is enclosed in double quotes, so we must
escape them in the added line. Note that t5520-pull.sh, which checks
that we display the advice for 'git rebase' (via 'git pull --rebase')
does not have to be updated because it only greps for a specific line in
the advice message.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agot-prio-queue: check result array bounds
René Scharfe [Sat, 16 Mar 2024 21:09:47 +0000 (22:09 +0100)] 
t-prio-queue: check result array bounds

Avoid reading past the end of the "result" array, which could otherwise
happen if the prio-queue were to yield more items than were put into it
due to an implementation bug, or if the array has not enough entries due
to a test bug.

Also check at the end whether all "result" entries were consumed, which
would not be the case if the prio-queue forgot some entries or the test
definition contained too many.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agot-prio-queue: shorten array index message
René Scharfe [Sat, 16 Mar 2024 20:45:51 +0000 (21:45 +0100)] 
t-prio-queue: shorten array index message

If we get an unexpected result, the prio-queue unit test reports it like
this:

 # check "result[j++] == show(get)" failed at t/unit-tests/t-prio-queue.c:43
 #    left: 5
 #   right: 1
 # failed at result[] index 0

That last line repeats "failed" and "result" from the first line.
Shorten it to resemble a similar one in t-ctype and also remove the
incrementation from the first line to avoid possible distractions from
the message of which comparison went wrong where:

 # check "result[j] == show(get)" failed at t/unit-tests/t-prio-queue.c:43
 #    left: 5
 #   right: 1
 #       j: 0

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agodiff.*Prefix: use camelCase in the doc and test titles
Junio C Hamano [Sat, 16 Mar 2024 05:57:22 +0000 (22:57 -0700)] 
diff.*Prefix: use camelCase in the doc and test titles

We added documentation for diff.srcPrefix and diff.dstPrefix with
their names properly camelCased, but the diff.noPrefix is listed
there in all lowercase.  Also these configuration variables, both
existing ones and the {src,dst}Prefix we recently added, were
spelled in all lowercase in the tests in t4013.

Now we are done with the main change, clean these up.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agogit-quiltimport: avoid an unnecessary subshell
Beat Bolli [Fri, 15 Mar 2024 19:46:19 +0000 (20:46 +0100)] 
git-quiltimport: avoid an unnecessary subshell

Use braces for the compound command.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocontrib/coverage-diff: avoid redundant pipelines
Beat Bolli [Fri, 15 Mar 2024 19:46:18 +0000 (20:46 +0100)] 
contrib/coverage-diff: avoid redundant pipelines

Merge multiple sed and "grep | awk" invocations, finally use "sort -u"
instead of "sort | uniq".

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t9*: merge "grep | sed" pipelines
Beat Bolli [Fri, 15 Mar 2024 19:46:17 +0000 (20:46 +0100)] 
t/t9*: merge "grep | sed" pipelines

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t8*: merge "grep | sed" pipelines
Beat Bolli [Fri, 15 Mar 2024 19:46:16 +0000 (20:46 +0100)] 
t/t8*: merge "grep | sed" pipelines

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t5*: merge a "grep | sed" pipeline
Beat Bolli [Fri, 15 Mar 2024 19:46:15 +0000 (20:46 +0100)] 
t/t5*: merge a "grep | sed" pipeline

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t4*: merge a "grep | sed" pipeline
Beat Bolli [Fri, 15 Mar 2024 19:46:14 +0000 (20:46 +0100)] 
t/t4*: merge a "grep | sed" pipeline

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t3*: merge a "grep | awk" pipeline
Beat Bolli [Fri, 15 Mar 2024 19:46:13 +0000 (20:46 +0100)] 
t/t3*: merge a "grep | awk" pipeline

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t1*: merge a "grep | sed" pipeline
Beat Bolli [Fri, 15 Mar 2024 19:46:12 +0000 (20:46 +0100)] 
t/t1*: merge a "grep | sed" pipeline

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t9*: avoid redundant uses of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:11 +0000 (20:46 +0100)] 
t/t9*: avoid redundant uses of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t8*: avoid redundant use of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:10 +0000 (20:46 +0100)] 
t/t8*: avoid redundant use of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t7*: avoid redundant use of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:09 +0000 (20:46 +0100)] 
t/t7*: avoid redundant use of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t6*: avoid redundant uses of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:08 +0000 (20:46 +0100)] 
t/t6*: avoid redundant uses of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t5*: avoid redundant uses of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:07 +0000 (20:46 +0100)] 
t/t5*: avoid redundant uses of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t4*: avoid redundant uses of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:06 +0000 (20:46 +0100)] 
t/t4*: avoid redundant uses of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t3*: avoid redundant uses of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:05 +0000 (20:46 +0100)] 
t/t3*: avoid redundant uses of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t1*: avoid redundant uses of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:04 +0000 (20:46 +0100)] 
t/t1*: avoid redundant uses of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/t0*: avoid redundant uses of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:03 +0000 (20:46 +0100)] 
t/t0*: avoid redundant uses of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/perf: avoid redundant use of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:02 +0000 (20:46 +0100)] 
t/perf: avoid redundant use of cat

Take care to redirect stdin, otherwise the output of wc would also contain
the file name.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/annotate-tests.sh: avoid redundant use of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:01 +0000 (20:46 +0100)] 
t/annotate-tests.sh: avoid redundant use of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/lib-cvs.sh: avoid redundant use of cat
Beat Bolli [Fri, 15 Mar 2024 19:46:00 +0000 (20:46 +0100)] 
t/lib-cvs.sh: avoid redundant use of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocontrib/subtree/t: avoid redundant use of cat
Beat Bolli [Fri, 15 Mar 2024 19:45:59 +0000 (20:45 +0100)] 
contrib/subtree/t: avoid redundant use of cat

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: avoid redundant use of cat
Beat Bolli [Fri, 15 Mar 2024 19:45:58 +0000 (20:45 +0100)] 
doc: avoid redundant use of cat

The update-hook-example.txt script uses this anti-pattern twice. Call grep
with the input file name directy. While at it, merge the two consecutive
grep calls.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: fix some placeholders formating
Jean-Noël Avila [Sat, 16 Mar 2024 15:21:41 +0000 (15:21 +0000)] 
doc: fix some placeholders formating

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: format alternatives in synopsis
Jean-Noël Avila [Sat, 16 Mar 2024 15:21:40 +0000 (15:21 +0000)] 
doc: format alternatives in synopsis

This is a list of various fixes on malformed alternative in commands
and option syntax.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodocs: fix typo in git-config `--default`
Brian Lyles [Sat, 16 Mar 2024 05:01:25 +0000 (00:01 -0500)] 
docs: fix typo in git-config `--default`

Signed-off-by: Brian Lyles <brianmlyles@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodocs: clarify file options in git-config `--edit`
Brian Lyles [Sat, 16 Mar 2024 05:01:24 +0000 (00:01 -0500)] 
docs: clarify file options in git-config `--edit`

The description for the `-e`/`--edit` option references scopes
inconsistently: system and global are referenced by their option name
(`--system`/`--global`), but repository (`--local` is not. Additionally,
neither `--worktree` nor `--file` are referenced at all, despite also
being a valid options.

Update the description to mention all four available scopes as well as
`--file`, referencing each consistently by their option name.

Signed-off-by: Brian Lyles <brianmlyles@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobugreport.c: fix a crash in `git bugreport` with `--no-suffix` option
Jiamu Sun [Thu, 14 Mar 2024 04:00:16 +0000 (04:00 +0000)] 
bugreport.c: fix a crash in `git bugreport` with `--no-suffix` option

`git bugreport` does not complain when `--no-suffix` is given, but
it leads to a segmentation fault as the it is not prepared to see a
NULL assigned to the option_suffix variable.

Signed-off-by: Jiamu Sun <barroit@linux.com>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoThe eighth batch
Junio C Hamano [Fri, 15 Mar 2024 22:20:53 +0000 (15:20 -0700)] 
The eighth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'hd/config-mak-os390'
Junio C Hamano [Fri, 15 Mar 2024 23:06:00 +0000 (16:06 -0700)] 
Merge branch 'hd/config-mak-os390'

Platform specific tweaks for OS/390 has been added to
config.mak.uname.

* hd/config-mak-os390:
  build: support z/OS (OS/390).

2 months agoMerge branch 'vm/t7301-use-test-path-helpers'
Junio C Hamano [Fri, 15 Mar 2024 23:06:00 +0000 (16:06 -0700)] 
Merge branch 'vm/t7301-use-test-path-helpers'

GSoC practice to replace "test -f" with "test_path_is_file".

* vm/t7301-use-test-path-helpers:
  t7301: use test_path_is_(missing|file)

2 months agoMerge branch 'jc/xwrite-cleanup'
Junio C Hamano [Fri, 15 Mar 2024 23:06:00 +0000 (16:06 -0700)] 
Merge branch 'jc/xwrite-cleanup'

Uses of xwrite() helper have been audited and updated for better
error checking and simpler code.

* jc/xwrite-cleanup:
  repack: check error writing to pack-objects subprocess
  sideband: avoid short write(2)
  unpack: replace xwrite() loop with write_in_full()

2 months agoMerge branch 'ag/t0010-modernize'
Junio C Hamano [Fri, 15 Mar 2024 23:05:59 +0000 (16:05 -0700)] 
Merge branch 'ag/t0010-modernize'

GSoC practice to modernize a test script.

* ag/t0010-modernize:
  tests: modernize the test script t0010-racy-git.sh

2 months agoMerge branch 'as/option-names-in-messages'
Junio C Hamano [Fri, 15 Mar 2024 23:05:59 +0000 (16:05 -0700)] 
Merge branch 'as/option-names-in-messages'

Error message updates.

* as/option-names-in-messages:
  revision.c: trivial fix to message
  builtin/clone.c: trivial fix of message
  builtin/remote.c: trivial fix of error message
  transport-helper.c: trivial fix of error message

2 months agoMerge branch 'kh/branch-ref-syntax-advice'
Junio C Hamano [Fri, 15 Mar 2024 23:05:59 +0000 (16:05 -0700)] 
Merge branch 'kh/branch-ref-syntax-advice'

When git refuses to create a branch because the proposed branch
name is not a valid refname, an advice message is given to refer
the user to exact naming rules.

* kh/branch-ref-syntax-advice:
  branch: advise about ref syntax rules
  advice: use double quotes for regular quoting
  advice: use backticks for verbatim
  advice: make all entries stylistically consistent
  t3200: improve test style

2 months agofuzz: add fuzzer for config parsing
Brian C Tracy [Fri, 15 Mar 2024 05:47:31 +0000 (05:47 +0000)] 
fuzz: add fuzzer for config parsing

Add a new fuzz target that exercises the parsing of git configs.
The existing git_config_from_mem function is a perfect entry point
for fuzzing as it exercises the same code paths as the rest of the
config parsing functions and offers an easily fuzzable interface.

Config parsing is a useful thing to fuzz because it operates on user
controlled data and is a central component of many git operations.

Signed-off-by: Brian C Tracy <brian.tracy33@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot5300: fix test_with_bad_commit()
John Cai [Fri, 15 Mar 2024 04:57:26 +0000 (04:57 +0000)] 
t5300: fix test_with_bad_commit()

0f8edf7317 (index-pack: --fsck-objects to take an optional argument for
fsck msgs, 2024-02-01) added a test function test_with_bad_commit() that
contained two bugs. test_expect_fail was used instead of test_must_fail,
and a && was not included at the end of the line.

Fix these two issues in the test.

Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodiff: add diff.srcPrefix and diff.dstPrefix configuration variables
Peter Hutterer [Fri, 15 Mar 2024 01:03:10 +0000 (11:03 +1000)] 
diff: add diff.srcPrefix and diff.dstPrefix configuration variables

Allow the default prefixes "a/" and "b/" to be tweaked by the
diff.srcPrefix and diff.dstPrefix configuration variables.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoThe seventh batch
Junio C Hamano [Thu, 14 Mar 2024 21:03:22 +0000 (14:03 -0700)] 
The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'rj/complete-worktree-paths-fix'
Junio C Hamano [Thu, 14 Mar 2024 21:05:25 +0000 (14:05 -0700)] 
Merge branch 'rj/complete-worktree-paths-fix'

The logic to complete the command line arguments to "git worktree"
subcommand (in contrib/) has been updated to correctly honor things
like "git -C dir" etc.

* rj/complete-worktree-paths-fix:
  completion: fix __git_complete_worktree_paths

2 months agoMerge branch 'rj/complete-reflog'
Junio C Hamano [Thu, 14 Mar 2024 21:05:24 +0000 (14:05 -0700)] 
Merge branch 'rj/complete-reflog'

The command line completion script (in contrib/) learned to
complete "git reflog" better.

* rj/complete-reflog:
  completion: reflog subcommands and options
  completion: factor out __git_resolve_builtins
  completion: introduce __git_find_subcommand
  completion: reflog show <log-options>
  completion: reflog with implicit "show"

2 months agoMerge branch 'jc/test-i18ngrep'
Junio C Hamano [Thu, 14 Mar 2024 21:05:24 +0000 (14:05 -0700)] 
Merge branch 'jc/test-i18ngrep'

With release 2.44 we got rid of all uses of test_i18ngrep and there
is no in-flight topic that adds a new use of it.  Make a call to
test_i18ngrep a hard failure, so that we can remove it at the end
of this release cycle.

* jc/test-i18ngrep:
  test_i18ngrep: hard deprecate and forbid its use

2 months agoMerge branch 'gt/core-bare-in-templates'
Junio C Hamano [Thu, 14 Mar 2024 21:05:24 +0000 (14:05 -0700)] 
Merge branch 'gt/core-bare-in-templates'

Code simplification.

* gt/core-bare-in-templates:
  setup: remove unnecessary variable

2 months agoMerge branch 'la/trailer-api'
Junio C Hamano [Thu, 14 Mar 2024 21:05:24 +0000 (14:05 -0700)] 
Merge branch 'la/trailer-api'

Trailer API updates.

Acked-by: Christian Couder <christian.couder@gmail.com>
cf. <CAP8UFD1Zd+9q0z1JmfOf60S2vn5-sD3SafDvAJUzRFwHJKcb8A@mail.gmail.com>

* la/trailer-api:
  format_trailers_from_commit(): indirectly call trailer_info_get()
  format_trailer_info(): move "fast path" to caller
  format_trailers(): use strbuf instead of FILE
  trailer_info_get(): reorder parameters
  trailer: move interpret_trailers() to interpret-trailers.c
  trailer: reorder format_trailers_from_commit() parameters
  trailer: rename functions to use 'trailer'
  shortlog: add test for de-duplicating folded trailers
  trailer: free trailer_info _after_ all related usage

2 months agoMerge branch 'kh/doc-commentchar-is-a-byte'
Junio C Hamano [Thu, 14 Mar 2024 21:05:23 +0000 (14:05 -0700)] 
Merge branch 'kh/doc-commentchar-is-a-byte'

The "core.commentChar" configuration variable only allows an ASCII
character, which was not clearly documented, which has been
corrected.

* kh/doc-commentchar-is-a-byte:
  config: document `core.commentChar` as ASCII-only

2 months agoMerge branch 'jh/fsmonitor-icase-corner-case-fix'
Junio C Hamano [Thu, 14 Mar 2024 21:05:23 +0000 (14:05 -0700)] 
Merge branch 'jh/fsmonitor-icase-corner-case-fix'

FSMonitor client code was confused when FSEvents were given in a
different case on a case-insensitive filesystem, which has been
corrected.

Acked-by: Patrick Steinhardt <ps@pks.im>
cf. <ZehofMaSZyUq8S1N@tanuki>

* jh/fsmonitor-icase-corner-case-fix:
  fsmonitor: support case-insensitive events
  fsmonitor: refactor bit invalidation in refresh callback
  fsmonitor: trace the new invalidated cache-entry count
  fsmonitor: return invalidated cache-entry count on non-directory event
  fsmonitor: remove custom loop from non-directory path handler
  fsmonitor: return invalidated cache-entry count on directory event
  fsmonitor: move untracked-cache invalidation into helper functions
  fsmonitor: refactor untracked-cache invalidation
  dir: create untracked_cache_invalidate_trimmed_path()
  fsmonitor: refactor refresh callback for non-directory events
  fsmonitor: clarify handling of directory events in callback helper
  fsmonitor: refactor refresh callback on directory events
  t7527: add case-insensitve test for FSMonitor
  name-hash: add index_dir_find()