[RFC PATCH 0/1] Extended tree format for mixed submodules and conflicts
From: brian m. carlson <hidden>
Date: 2025-10-01 00:58:21
Today at the Contributor Summit we discussed two different proposals that might benefit from some extensions to trees: submodules of a different hash algorithm and first-class conflicts. Peff suggested that we could do something hideous to the tree format to allow for extensions to submodules of different algorithms. In the interests of prototyping things to see how much people like or hate the idea, I've written up an example spec and included a script below so we can see how current Git implementations handle this. (This was part of my lunchtime activity.) Git itself handles this data as a submodule, which seems to be the least bad option for a new mode type. `git fsck` complains about the mode, as expected. I don't intend to actually implement this proposal or do anything serious with it, but I offer it as a discussion piece about what we could do if we wanted in a minimally incompatible way. If you really hate it, that's okay; I agree it's a little gross. ---- #!/bin/sh -e # This script requires a printf that supports hex escapes because I'm too lazy # to convert things into octal. rm -fr test-repo git init --object-format=sha1 -b dev test-repo cd test-repo tree_oid=$(/usr/bin/printf '130000 \x91\x82\x80s256\x01\xdf\xac\xbf\xee\xdf\xac\xbf\xee\xdf\xac\xbf\xeesubmodule\x00\xde\xad\xbe\xef\xde\xad\xbe\xef\xde\xad\xbe\xef\xde\xad\xbe\xef\xde\xad\xbe\xef' | git hash-object -t tree -w --literally --stdin) commit_oid=$(git commit-tree -m + "$tree_oid") git reset --hard "$commit_oid" git show HEAD ---- brian m. carlson (1): Define an extended tree format Documentation/Makefile | 1 + Documentation/gitformat-extended-tree.adoc | 77 ++++++++++++++++++++++ Documentation/meson.build | 1 + 3 files changed, 79 insertions(+) create mode 100644 Documentation/gitformat-extended-tree.adoc