Commit Graph

16465 Commits (v2.50.0-rc1)

Author SHA1 Message Date
Junio C Hamano 0bd2d791cc Git 2.50-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-03 08:55:24 -07:00
Junio C Hamano 86c32bbee8 Merge branch 'kh/doc-column-markup-fix'
Doc updates.

* kh/doc-column-markup-fix:
  doc: column: fix blank lines around block delimiters
2025-06-03 08:55:23 -07:00
Junio C Hamano b07857f7dc A bit more before -rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-02 09:25:34 -07:00
Junio C Hamano 3624591b84 Merge branch 'wk/sparse-checkout-doc-fix'
Doc update.

* wk/sparse-checkout-doc-fix:
  doc: sparse-checkout: use consistent inline list style
2025-06-02 09:25:34 -07:00
Junio C Hamano bbe8a3723b Merge branch 'jc/signed-fast-export-is-experimental'
Mark a new feature added during this cycle as experimental and fix
its default so that existing users of the fast-export command is
not broken.

* jc/signed-fast-export-is-experimental:
  fast-export: --signed-commits is experimental
2025-06-02 09:25:34 -07:00
Junio C Hamano 4f91e606fb Merge branch 'ja/doc-synopsis-style'
Doc mark-up fixes.

* ja/doc-synopsis-style:
  doc: convert git-switch manpage to new synopsis style
  doc: convert git-mergetool options to new synopsis style
  doc: convert git-mergetool manpage to new synopsis style
  doc: switch merge config description to new synopsis format
  doc: convert merge strategies to synopsis format
  doc: merge-options.adoc remove a misleading double negation
  doc: convert merge options to new synopsis format
  doc: convert git-merge manpage to new style
  doc: convert git-checkout manpage to new style
2025-06-02 09:25:33 -07:00
Kristoffer Haugsbakk 23d30ea200 doc: column: fix blank lines around block delimiters
227c4f33a0 (doc: add a blank line around block delimiters,
2025-03-09) added blank lines around block delimiters as a
defensive measure.  For each block you had to mind the con-
text (like the commit says):

• Top-level: just add blank lines
• Block: use list continuation (+)

But list continuation was used here at the top level, which
results in literal `+` in the output formats.

Acked-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-01 17:20:16 -07:00
Junio C Hamano 7014b55638 A bit more topics for -rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-30 11:59:18 -07:00
Junio C Hamano 1a140c870d Merge branch 'kh/notes-doc-fixes'
"git notes --help" documentation updates.

* kh/notes-doc-fixes:
  doc: notes: use stuck form throughout
  doc: notes: treat --stdin equally between copy/remove
  doc: notes: point out copy --stdin use with argv
  doc: notes: clearly state that --stripspace is the default
  doc: notes: remove stripspace discussion from other options
  doc: notes: rework --[no-]stripspace
  doc: notes: split out options with negated forms
  doc: config: mention core.commentChar on commit.cleanup
  doc: stripspace: mention where the default comes from
2025-05-30 11:59:17 -07:00
Junio C Hamano 48a25bbbbb Merge branch 'pw/midx-repack-overflow-fix'
Integer overflow fix around code paths for "git multi-pack-index repack"..

* pw/midx-repack-overflow-fix:
  midx docs: clarify tie breaking
  midx: avoid negative array index
  midx repack: avoid potential integer overflow on 64 bit systems
  midx repack: avoid integer overflow on 32 bit systems
2025-05-30 11:59:16 -07:00
Wonuk Kim cea9f55f00 doc: sparse-checkout: use consistent inline list style
Fix this inline list to use a single style, namely numeric, instead of
`(1)` followed by `(b)`.

Signed-off-by: Wonuk Kim <kimww0306@gmail.com>
Acked-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-30 09:54:18 -07:00
Junio C Hamano 0b4c6baa70 fast-export: --signed-commits is experimental
As the design of signature handling is still being discussed, it is
likely that the data stream produced by the code in Git 2.50 would
have to be changed in such a way that is not backward compatible.

Mark the feature as experimental and discourge its use for now.

Also flip the default on the generation side to "strip"; users of
existing versions would not have passed --signed-commits=strip and
will be broken by this change if the default is made to abort, and
will be encouraged by the error message to produce data stream with
future breakage guarantees by passing --signed-commits option.

As we tone down the default behaviour, we no longer need the
FAST_EXPORT_SIGNED_COMMITS_NOABORT environment variable, which was
not discoverable enough.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-28 10:30:47 -07:00
Junio C Hamano b32feae0f1 Git 2.50-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-28 07:59:56 -07:00
Junio C Hamano b4847a4477 Merge branch 'jt/receive-pack-skip-connectivity-check'
"git receive-pack" optionally learns not to care about connectivity
check, which can be useful when the repository arranges to ensure
connectivity by some other means.

* jt/receive-pack-skip-connectivity-check:
  builtin/receive-pack: add option to skip connectivity check
  t5410: test receive-pack connectivity check
2025-05-28 07:59:56 -07:00
Kristoffer Haugsbakk 806337c705 doc: notes: use stuck form throughout
gitcli(7) recommends the *stuck form*.  `--ref` is the only one which
does not use it.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 15:31:08 -07:00
Kristoffer Haugsbakk 45113e142e doc: notes: treat --stdin equally between copy/remove
46538012d9 (notes remove: --stdin reads from the standard input,
2011-05-18) added `--stdin` for the `remove` subcommand, documenting it
in the “Options” section.  But `copy --stdin` was added before that, in
160baa0d9c (notes: implement 'git notes copy --stdin', 2010-03-12).

Treat this option equally between the two subcommands:

• remove: mention `--stdin` on the subcommand as well, like for `copy`
• copy: mention it as well under the option documentation

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 15:31:07 -07:00
Kristoffer Haugsbakk 6dcec8930c doc: notes: point out copy --stdin use with argv
Unlike `remove --stdin`, this option cannot be combined with object
names given via the command line.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 15:31:07 -07:00
Kristoffer Haugsbakk 5471b190f8 doc: notes: clearly state that --stripspace is the default
Clearly state when which of the regular and negated form of the
option take effect.[1]

Also mention the subtle behavior that occurs when you mix options like
`-m` and `-C`, including a note that it might be fixed in the future.
The topic was brought up on v8 of the `--separator` series.[2][3]

[1]: https://lore.kernel.org/git/xmqqcyct1mtq.fsf@gitster.g/
[2]: https://lore.kernel.org/git/xmqq4jp326oj.fsf@gitster.g/
† 3: v11 was the version that landed

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 15:31:07 -07:00
Kristoffer Haugsbakk 159c42a063 doc: notes: remove stripspace discussion from other options
Cleaning up whitespace in metadata is typical porcelain behavior and
this default does not need to be pointed out.[1]  Only speak up when
the default `--stripspace` is not used.

Also remove all misleading mentions of comment lines in the process;
see the previous commit.

Also remove the period that trails the parenthetical here.

† 1: See `-F` in git-commit(1) which has nothing to say about whitespace
    cleanup.  The cleanup discussion is on `--cleanup`.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 15:31:06 -07:00
Kristoffer Haugsbakk 6521ca8ec4 doc: notes: rework --[no-]stripspace
Document this option by copying the bullet list from git-stripspace(1).
A bullet list is cleaner when there are this many points to consider.
We also get a more standardized description of the multiple-blank-lines
behavior.  Compare the repeating (git-notes(1)):

    empty lines other than a single line between paragraphs

With (git-stripspace(1)):

    multiple consecutive empty lines

And:

    leading [...] whitespace

With:

    empty lines from the beginning

Leading whitespace in the form of spaces (indentation) are not removed.
However, empty lines at the start of the message are removed.

Note that we drop the mentions of comment line handling because they are
wrong; this option does not control how lines which can be recognized as
comment lines are handled.  Only interactivity controls that:

• Comment lines are stripped after editing interactively
• Lines which could be recognized as comment lines are left alone when
  the message is given non-interactively

So it is misleading to document the comment line behavior on
this option.

Further, the text is wrong:

    Lines starting with `#` will be stripped out in non-editor cases
    like `-m`, [...]

Comment lines are still indirectly discussed on other options.  We will
deal with them in the next commit.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 15:31:06 -07:00
Kristoffer Haugsbakk 37dd51a6eb doc: notes: split out options with negated forms
Split these out so that they are easier to search for.[1]

[1]: https://lore.kernel.org/git/xmqqcyct1mtq.fsf@gitster.g/

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 15:31:06 -07:00
Kristoffer Haugsbakk e2971d6f76 doc: config: mention core.commentChar on commit.cleanup
Mention it in parentheses since we are in a configuration context.
Refer to the default as such, not as “the” character.

Also don’t mention `#` again; just say “comment character”.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 15:31:06 -07:00
Kristoffer Haugsbakk e2de9b354f doc: stripspace: mention where the default comes from
Also quote `#` in line with the modern formatting convention.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 15:31:05 -07:00
Junio C Hamano 34673cd0e8 The eighteenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 13:59:12 -07:00
Junio C Hamano e8f4e146d4 Merge branch 'kj/my-first-contribution-updates'
Doc updates.

* kj/my-first-contribution-updates:
  docs: replace git_config to repo_config
  docs: clarify cmd_psuh signature and explain UNUSED macro
  docs: remove unused mentoring mailing list reference
2025-05-27 13:59:12 -07:00
Junio C Hamano d8b48af391 Merge branch 'sj/use-mmap-to-check-packed-refs'
The code path to access the "packed-refs" file while "fsck" is
taught to mmap the file, instead of reading the whole file in the
memory.

* sj/use-mmap-to-check-packed-refs:
  packed-backend: mmap large "packed-refs" file during fsck
  packed-backend: extract snapshot allocation in `load_contents`
  packed-backend: fsck should warn when "packed-refs" file is empty
2025-05-27 13:59:10 -07:00
Junio C Hamano 3950f8f1b4 Merge branch 'jc/doc-synopsis-option-markup'
Doc mark-up fixes.

* jc/doc-synopsis-option-markup:
  git-var doc: fix usage of $ENV_VAR vs ENV_VAR
  git-verify-* doc: update mark-up of synopsis option descriptions
  git-{var,write-tree} docs: update mark-up of synopsis option descriptions
  git-daemon doc: update mark-up of synopsis option descriptions
2025-05-27 13:59:10 -07:00
Junio C Hamano f545f401be Merge branch 'en/merge-tree-check'
"git merge-tree" learned an option to see if it resolves cleanly
without actually creating a result.

* en/merge-tree-check:
  merge-tree: add a new --quiet flag
  merge-ort: add a new mergeability_only option
2025-05-27 13:59:08 -07:00
Junio C Hamano 17d9dbd3c2 Merge branch 'jk/no-funny-object-types'
Support to create a loose object file with unknown object type has
been dropped.

* jk/no-funny-object-types:
  object-file: drop support for writing objects with unknown types
  hash-object: handle --literally with OPT_NEGBIT
  hash-object: merge HASH_* and INDEX_* flags
  hash-object: stop allowing unknown types
  t: add lib-loose.sh
  t/helper: add zlib test-tool
  oid_object_info(): drop type_name strbuf
  fsck: stop using object_info->type_name strbuf
  oid_object_info_convert(): stop using string for object type
  cat-file: use type enum instead of buffer for -t option
  object-file: drop OBJECT_INFO_ALLOW_UNKNOWN_TYPE flag
  cat-file: make --allow-unknown-type a noop
  object-file.h: fix typo in variable declaration
2025-05-27 13:59:08 -07:00
Jean-Noël Avila b983aaabc8 doc: convert git-switch manpage to new synopsis style
- Switch the synopsis to a synopsis block which will automatically
  format placeholders in italics and keywords in monospace
- Use _<placeholder>_ instead of <placeholder> in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 07:51:02 -07:00
Jean-Noël Avila d30c5cc459 doc: convert git-mergetool options to new synopsis style
- Use _<placeholder>_ instead of <placeholder> in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 07:51:01 -07:00
Jean-Noël Avila 1654396782 doc: convert git-mergetool manpage to new synopsis style
- Switch the synopsis to a synopsis block which will automatically
  format placeholders in italics and keywords in monospace
- Use _<placeholder>_ instead of <placeholder> in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 07:51:01 -07:00
Jean-Noël Avila 90a837a720 doc: switch merge config description to new synopsis format
- Use _<placeholder>_ instead of <placeholder> in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Additionally, a list of option possible values has been reformatted as a
standalone definition list.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 07:51:00 -07:00
Jean-Noël Avila 179f877b88 doc: convert merge strategies to synopsis format
- Switch the synopsis to a synopsis block which will automatically
  format placeholders in italics and keywords in monospace
- Use _<placeholder>_ instead of <placeholder> in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 07:51:00 -07:00
Jean-Noël Avila cbbb3b2d38 doc: merge-options.adoc remove a misleading double negation
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 07:51:00 -07:00
Jean-Noël Avila 5f3213232f doc: convert merge options to new synopsis format
- Use _<placeholder>_ instead of <placeholder> in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 07:50:59 -07:00
Jean-Noël Avila 13d5331ccc doc: convert git-merge manpage to new style
- Switch the synopsis to a synopsis block which will automatically
  format placeholders in italics and keywords in monospace
- Use _<placeholder>_ instead of <placeholder> in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

In order to avoid breaking the format on '<<<<<<' and '>>>>>' lines
by applying the synopsis rules to these spans, they are formatted using '+'
signs instead of '`' signs.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 07:50:59 -07:00
Jean-Noël Avila 3d26ec1715 doc: convert git-checkout manpage to new style
- Switch the synopsis to a synopsis block which will automatically
  format placeholders in italics and keywords in monospace
- Use _<placeholder>_ instead of <placeholder> in the description
- Use `backticks` for keywords and more complex option
descriptions. The new rendering engine will apply synopsis rules to
these spans.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-27 07:50:58 -07:00
Junio C Hamano 845c48a16a The seventeenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-23 15:34:09 -07:00
Junio C Hamano 95c79efb8d Merge branch 'ds/scalar-no-maintenance'
Two "scalar" subcommands that adds a repository that hasn't been
under "scalar"'s control are taught an option not to enable the
scheduled maintenance on it.

* ds/scalar-no-maintenance:
  scalar reconfigure: improve --maintenance docs
  scalar reconfigure: add --maintenance=<mode> option
  scalar clone: add --no-maintenance option
  scalar register: add --no-maintenance option
  scalar: customize register_dir()'s behavior
2025-05-23 15:34:07 -07:00
Phillip Wood 70b128c576 midx docs: clarify tie breaking
Clarify what happens when an object exists in more than one pack, but
not in the preferred pack. "git multi-pack-index repack" relies on ties
for objects that are not in the preferred pack being resolved in favor
of the newest pack that contains a copy of the object. If ties were
resolved in favor of the oldest pack as the current documentation
suggests the multi-pack index would not reference any of the objects in
the pack created by "git multi-pack-index repack".

Helped-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-22 14:48:37 -07:00
Justin Tobler 68cb0b5253 builtin/receive-pack: add option to skip connectivity check
During git-receive-pack(1), connectivity of the object graph is
validated to ensure that the received packfile does not leave the
repository in a broken state. This is done via git-rev-list(1) and
walking the objects, which can be expensive for large repositories.

Generally, this check is critical to avoid an incomplete received
packfile from corrupting a repository. Server operators may have
additional knowledge though around exactly how Git is being used on the
server-side which can be used to facilitate more efficient connectivity
computation of incoming objects.

For example, if it can be ensured that all objects in a repository are
connected and do not depend on any missing objects, the connectivity of
newly written objects can be checked by walking the object graph
containing only the new objects from the updated tips and identifying
the missing objects which represent the boundary between the new objects
and the repository. These boundary objects can be checked in the
canonical repository to ensure the new objects connect as expected and
thus avoid walking the rest of the object graph.

Git itself cannot make the guarantees required for such an optimization
as it is possible for a repository to contain an unreachable object that
references a missing object without the repository being considered
corrupt.

Introduce the --skip-connectivity-check option for git-receive-pack(1)
which bypasses this connectivity check to give more control to the
server-side. Note that without proper server-side validation of newly
received objects handled outside of Git, usage of this option risks
corrupting a repository.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-20 11:43:36 -07:00
Junio C Hamano 8613c2bb6c The sixteenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-19 16:02:48 -07:00
Junio C Hamano ae0b60e009 Merge branch 'ag/doc-send-email'
The `send-email` documentation has been updated with OAuth2.0
related examples.

* ag/doc-send-email:
  docs: add credential helper for outlook and gmail in OAuth list of helpers
  docs: improve send-email documentation
  send-mail: improve checks for valid_fqdn
2025-05-19 16:02:45 -07:00
Junio C Hamano 4bb72548fc Merge branch 'sc/bundle-uri-use-all-refs-in-bundle'
Bundle-URI feature did not use refs recorded in the bundle other
than normal branches as anchoring points to optimize the follow-up
fetch during "git clone"; now it is told to utilize all.

* sc/bundle-uri-use-all-refs-in-bundle:
  bundle-uri: add test for bundle-uri clones with tags
  bundle-uri: copy all bundle references ino the refs/bundle space
2025-05-19 16:02:45 -07:00
K Jayatheerth 7649d316ce docs: replace git_config to repo_config
Since this document was written, the built-in API has been
updated a few times, but the document was left stale.

Adjust to the current best practices by calling repo_config() on the
repository instance the subcommand implementation receives as a
parameter, instead of calling git_config() that used to be the
common practice.

Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-19 10:53:12 -07:00
K Jayatheerth a1dcf6b289 docs: clarify cmd_psuh signature and explain UNUSED macro
The sample program, as written, would no longer build for at least two
reasons:

 - Since this document was first written, the convention to call a
   subcommand implementation has changed, and cmd_psuh() now needs
   to accept the fourth parameter, repository.

 - These days, compiler warning options for developers include one
   that detects and complains about unused parameters, so ones that
   are deliberately unused have to be marked as such.

Update the old-style examples to adjust to the current practices,
with explanations as needed.

Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-19 10:52:24 -07:00
K Jayatheerth 3749b8a795 docs: remove unused mentoring mailing list reference
The git-mentoring group was initially created to help newcomers
with their development itches. However, in practice,
most of their questions were already being addressed
directly on the mailing list, and contributors consistently
received helpful responses there.

Remove the mentoring group details from the Documentation.

Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-19 10:51:19 -07:00
Elijah Newren 29d7bf1951 merge-tree: add a new --quiet flag
Git Forges may be interested in whether two branches can be merged while
not being interested in what the resulting merge tree is nor which files
conflicted.  For such cases, add a new --quiet flag which
will make use of the new mergeability_only flag added to merge-ort in
the previous commit.  This option allows the merge machinery to, in the
outer layer of the merge:
    * exit early when a conflict is detected
    * avoid writing (most) merged blobs/trees to the object store

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-16 15:09:14 -07:00
Jeff King f227fc7d43 cat-file: make --allow-unknown-type a noop
The cat-file command has some minor support for handling objects with
"unknown" types. I.e., strings that are not "blob", "commit", "tree", or
"tag".

In theory this could be used for debugging or experimenting with
extensions to Git. But in practice this support is not very useful:

  1. You can get the type and size of such objects, but nothing else.
     Not even the contents!

  2. Only loose objects are supported, since packfiles use numeric ids
     for the types, rather than strings.

  3. Likewise you cannot ever transfer objects between repositories,
     because they cannot be represented in the packfiles used for the
     on-the-wire protocol.

The support for these unknown types complicates the object-parsing code,
and has led to bugs such as b748ddb7a4 (unpack_loose_header(): fix
infinite loop on broken zlib input, 2025-02-25). So let's drop it.

The first step is to remove the user-facing parts, which are accessible
only via cat-file. This is technically backwards-incompatible, but given
the limitations listed above, these objects couldn't possibly be useful
in any workflow.

However, we can't just rip out the option entirely. That would hurt a
caller who ran:

  git cat-file -t --allow-unknown-object <oid>

and fed it normal, well-formed objects. There --allow-unknown-type was
doing nothing, but we wouldn't want to start bailing with an error. So
to protect any such callers, we'll retain --allow-unknown-type as a
noop.

The code change is fairly small (but we'll able to clean up more code in
follow-on patches). The test updates drop any use of the option. We
still retain tests that feed the broken objects to cat-file without
--allow-unknown-type, as we should continue to confirm that those
objects are rejected. Note that in one spot we can drop a layer of loop,
re-indenting the body; viewing the diff with "-w" helps there.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-16 09:43:09 -07:00