Closed tirolerstefan closed 6 years ago
git read-tree
is perfectly happy to dereference an annotated tag to a tree. The problem is that the annotated tag object isn't fetched into the downstream repository, so git isn't able to access it in order to dereference it. So far, Braid has just fetched all branches from the mirror cache repository into the downstream repository and assumed that will cover the requested revision.
Given that we should probably be consistent and have the revision
field of the mirror object always be a commit, dereferencing the annotated tag in the context of the mirror cache repository in the mirror.tag
case in determine_repository_revision
is a reasonable solution. (There's no need to address the design flaw of fetching all branches versus just the requested revision right now.) Dereferencing in the branch case shouldn't be necessary but wouldn't hurt. Dereferencing a user-specified revision in validate_new_revision
wouldn't hurt either for the rare case that the user makes their own annotated tag in the downstream repository referring to a commit of the subproject.
There's a workaround or a solution? I'm unable to use braid with tags
There's a workaround or a solution? I'm unable to use braid with tags
As a workaround, you can look up the commit ID of the tag and specify it using the --revision option.
I will finish up the pull request #79 myself.
Fix released as braid version 1.1.2
.
Thanks for report and code fixes
(braid version 1.1.0, git version 2.16.1)
I have a test sub repo with one annotated tag "tag1":
When I try to add this sub repo to my parent repo, I get an error:
In my opinion, the problem is a wrong "tag to commit" resolution.
Here, the ID of the tag itself (git rev-parse tags/tag1 ==> a70a5034203235e428f0c6fb214c903668caa75c) is taken instead of the commit it is pointing to (f1248d76a08a1d53a7a9549c07d388459fb6f5ae).
The correct way to get the tag-commit-id might be (for both lightweight tags and annotated tags):