-
-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commit access to tree and parents oids #73
Comments
Is there a reasonable use-case for having a commit with a tree that's missing in the repo's database? Are you thinking of doing something like fsck? |
fsck is a perfectly legit use case. More fundamentally, I see things the other way. The property of the commit is the tree-oid, not the tree. The ability to get the tree directly from the commit is just sugar, a short way to write Related to this, I would like every call that returns a git-object to go through a central function. For instance, |
The other use-case: sometimes, we don't actually need to materialize the whole tree; we may have it in cache. But we won't know that unless we can check the tree ID first. As-is, this results in hitting the disk needlessly. The patch for this is simple, and I'm happy to contribute it. |
Please go ahead. The question is whether PS: Another question is whether to keep or not the sugar. But that could be decided later. |
We need something like
Commit.tree_oid
, that we can use instead ofCommit.tree.oid
, which would fail if the tree object is missing in the database. The same aboutCommit.parents
.The text was updated successfully, but these errors were encountered: