git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] cat-file: add %(objectmode) avoid verifying submodules' OIDs
@ 2024-03-11 18:55 Johannes Schindelin via GitGitGadget
  2024-03-11 18:56 ` [PATCH 1/3] t1006: update 'run_tests' to test generic object specifiers Victoria Dye via GitGitGadget
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2024-03-11 18:55 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin

The cat-file --batch command is very valuable in server settings, but so far
it is missing a bit of functionality that would come in handy there.

For example, it is sometimes necessary to determine the object mode of a
batch of tree objects' children.

This came up in $dayjob recently, and applies cleanly to v2.44.0.

Johannes Schindelin (1):
  cat-file: avoid verifying submodules' OIDs

Victoria Dye (2):
  t1006: update 'run_tests' to test generic object specifiers
  cat-file: add %(objectmode) atom

 Documentation/git-cat-file.txt | 10 +++++
 builtin/cat-file.c             | 41 ++++++++++++++----
 t/t1006-cat-file.sh            | 79 +++++++++++++++++++++-------------
 3 files changed, 92 insertions(+), 38 deletions(-)


base-commit: 3c2a3fdc388747b9eaf4a4a4f2035c1c9ddb26d0
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1689%2Fdscho%2Fcat-file-vs-submodules-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1689/dscho/cat-file-vs-submodules-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1689
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH 0/3] cat-file: add %(objectmode) and submodule message to batch commands
@ 2025-06-02 18:55 Victoria Dye via GitGitGadget
  2025-06-02 18:55 ` [PATCH 2/3] cat-file: add %(objectmode) atom Victoria Dye via GitGitGadget
  0 siblings, 1 reply; 17+ messages in thread
From: Victoria Dye via GitGitGadget @ 2025-06-02 18:55 UTC (permalink / raw)
  To: git; +Cc: peff, gitster, Victoria Dye

This series re-attempts the changes proposed last year [1] for extending the
information about tree entries available from the 'cat-file' batch format
commands. It also (hopefully) addresses the initial round of feedback that
series received.

The first patch updates 't1006-cat-file.sh' to test non-OID object
specifications. In response to the feedback in [2], I added more careful
quoting and a couple tests using paths with spaces. This change revealed a
(likely known) limitation of the '%(rest)' atom when processing object names
with spaces. To make that limitation explicit, I marked the relevant test as
expected to fail.

The second patch adds "mode" support. This is essentially unchanged from its
initial submission, save for some conflict resolution in the test script.

The final patch takes a different approach to submodule resolution than the
initial submission; rather than treat the entry as a "regular" commit object
with empty content, we now print an error message similar to the "missing",
"ambiguous", etc. cases, but with the tree entry's OID rather than the input
object name.

As for the motivation behind the change (re: [3]), the goal of this series
is to be able to get more of the information available internally about an
object in 'cat-file --batch[*]' -- in the case of a tree entry, the main
things missing were the file mode and the presence (and OID) of submodule
pointers. As Junio mentioned in [4], using a single long-running process to
resolve objects is far more performant than spawning multiple processes to
resolve tree entries with something like 'ls-tree', especially when
resolving entries across multiple trees or resolving a mix of tree entries
and OIDs, refnames, etc. The object resolution logic in 'cat-file' meant
that the mode & submodule OID information were already (mostly) available,
but we didn't have a way to output it.

The intent of this series is to make the new format options/outputs to get
those fields as unobtrusive as possible, but I'm happy to do something more
like the previous series if that would be preferable.

[1]
https://lore.kernel.org/git/pull.1689.git.1710183362.gitgitgadget@gmail.com/
[2] https://lore.kernel.org/git/xmqqle6oo2ns.fsf@gitster.g/ [3]
https://lore.kernel.org/git/20240312221758.GA109417@coredump.intra.peff.net/
[4] https://lore.kernel.org/git/xmqq1q8fl05r.fsf@gitster.g/

Victoria Dye (3):
  t1006: update 'run_tests' to test generic object specifiers
  cat-file: add %(objectmode) atom
  cat-file.c: add batch handling for submodules

 Documentation/git-cat-file.adoc |  13 ++++
 builtin/cat-file.c              |  14 +++-
 t/t1006-cat-file.sh             | 111 +++++++++++++++++++++++---------
 3 files changed, 103 insertions(+), 35 deletions(-)


base-commit: 7014b55638da979331baf8dc31c4e1d697cf2d67
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1929%2Fvdye%2Fvdye%2Fcat-file-mode-submodule-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1929/vdye/vdye/cat-file-mode-submodule-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1929
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-06-04 19:36 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-11 18:55 [PATCH 0/3] cat-file: add %(objectmode) avoid verifying submodules' OIDs Johannes Schindelin via GitGitGadget
2024-03-11 18:56 ` [PATCH 1/3] t1006: update 'run_tests' to test generic object specifiers Victoria Dye via GitGitGadget
2024-03-11 21:54   ` Junio C Hamano
2024-03-11 18:56 ` [PATCH 2/3] cat-file: add %(objectmode) atom Victoria Dye via GitGitGadget
2024-03-11 22:15   ` Junio C Hamano
2024-03-13 21:23     ` Junio C Hamano
2024-03-11 18:56 ` [PATCH 3/3] cat-file: avoid verifying submodules' OIDs Johannes Schindelin via GitGitGadget
2024-03-12  8:58   ` Jeff King
2024-03-12 18:35   ` Junio C Hamano
2024-03-12 22:17     ` Jeff King
2024-03-13 15:22       ` Junio C Hamano
2024-03-11 21:43 ` [PATCH 0/3] cat-file: add %(objectmode) " Junio C Hamano
2024-03-12  8:59   ` Jeff King
2024-03-12 19:28     ` Junio C Hamano
2024-03-12 22:03       ` Jeff King
  -- strict thread matches above, loose matches on Subject: below --
2025-06-02 18:55 [PATCH 0/3] cat-file: add %(objectmode) and submodule message to batch commands Victoria Dye via GitGitGadget
2025-06-02 18:55 ` [PATCH 2/3] cat-file: add %(objectmode) atom Victoria Dye via GitGitGadget
2025-06-04 19:36   ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).