git/list[1] front-page[2] threads[3] people[4] search[5] about
 

What is in git.git

From
Junio C Hamano <junkio@cox.net>
Date
Jan 21, 2006, 08:03 UTC
Message-ID
<7v3bjiuhxb.fsf@assigned-by-dhcp.cox.net>

The "bind commit" experiments for subproject support is coming along rather nicely. Near the tip of the "pu" branch, there are:

 - read-tree --prefix;
 - write-tree --prefix and write-tree --exclude;
 - commit-tree --bind;
 - fsck-objects and convert-objects that understand "bind" lines
   in commit objects;
 - rev-list --objects that understand "bind" lines
   in commit objects;
I think the first four are more-or-less well debugged.

I am reasonably confident that I did not break rev-list for repositories without "bind" commits, but I have no clue how correct it is when dealing with commits with "bind" lines. This is the last major remaining piece of the puzzle, and the rest is just the matter of scripting. I'd be sending out a request for help on the rev-list in a separate message.

There still is no barebone Porcelainish work done using these changes. The attached script demonstrates a superproject that binds two subprojects with their own development histories.

-- >8 --
#!/bin/sh
rm -fr .git
git init-db
: >main
for i in 1 2
do
	echo "Version #$i of primary subproject" >main
	git add main
	git commit -a -m "`cat main`"
	git tag main-$i
done
git branch main
rm -f .git/refs/heads/master .git/index
mkdir dir
: >sub1
: >dir/sub2
for i in A B C
do
	echo "subproject sub1 ($i)" >sub1
	echo "subproject dir/sub2 ($i)" >dir/sub2
	git add sub1 dir/sub2
	git commit -a -m "subproject #$i"
	git tag subpro-$i
done
git branch subpro
rm -fr dir sub1 main
rm -f .git/refs/heads/master .git/index
git read-tree main-1
git read-tree --prefix=sub/ subpro-A
toptree=`git write-tree`
topcommit=$(echo "Initial top commit" |
git commit-tree $toptree \
	--bind `git rev-parse --verify main-1` / \
	--bind  `git rev-parse --verify subpro-A` sub/)
echo $topcommit >.git/refs/heads/master
git tag top-1A
git read-tree main-1
git read-tree --prefix=sub/ subpro-B
toptree=`git write-tree`
topcommit=$(echo "Second top commit" |
git commit-tree $toptree \
	-p `git rev-parse --verify top-1A` \
	--bind `git rev-parse --verify main-1` / \
	--bind  `git rev-parse --verify subpro-B` sub/)
echo $topcommit >.git/refs/heads/master
git tag top-1B
git read-tree main-2
git read-tree --prefix=sub/ subpro-C
toptree=`git write-tree`
topcommit=$(echo "Third top commit" |
git commit-tree $toptree \
	-p `git rev-parse --verify top-1B` \
	--bind `git rev-parse --verify main-2` / \
	--bind  `git rev-parse --verify subpro-C` sub/)
echo $topcommit >.git/refs/heads/master
git tag top-2C
git log

git rev-list --objects top-1A..top-2C | git name-rev --tags --stdin

Next: Alexander Litvinov
Message 1 of 14 in “What is in git.git”
  1. Junio C HamanoJan 21, 2006
  2. Alexander LitvinovJan 21, 2006
  3. Junio C HamanoJan 21, 2006
  4. Junio C HamanoJan 21, 2006
  5. Josef WeidendorferJan 21, 2006
  6. Junio C HamanoJan 22, 2006
  7. Josef WeidendorferJan 24, 2006
  8. Petr BaudisJan 22, 2006
  9. Daniel BarkalowJan 22, 2006
  10. Junio C HamanoJan 22, 2006
  11. Daniel BarkalowJan 22, 2006
  12. Junio C HamanoJan 22, 2006
  13. Junio C HamanoJan 22, 2006
  14. Alexander LitvinovJan 21, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.