Skip to content

RFC Extended tree format for mixed submodules and conflicts

brian m. carlson git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 patch 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1Define an extended tree formatDocumentation/Makefile Documentation/gitformat-extended-tree.adoc Documentation/meson.build+79 -08 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/1] Extended tree format for mixed submodules and conflicts

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