-
Notifications
You must be signed in to change notification settings - Fork 14
dulwich: fix output of describe(#4)
#5
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
dulwich: fix output of describe(#4)
#5
Conversation
|
|
||
| best_ref = None | ||
|
|
||
| for ref in sorted(self.iter_refs(base=base)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the best solution is to order it in dulwich by the time the branch was modified. But I don't know if they wish to modify the return with List instead of Set.
There was an old discussion related to it, but here the suggestion on reflog only gives the time of the last commit, in our case because both of the branch shares the same commit, they would have the same time in reflogs. what we need here is the branch modification time of files in .git/refs/heads
jelmer/dulwich#392
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this new check for whether or not HEAD is a branch and matches rev when base=refs/heads should maybe be added at the top level Git.describe() instead of at the individual backend level (since the order won't be guaranteed by any backend, but we want to at least be consistent for in this particular case regardless of what backend we are using)
So at the top scmrepo.git.Git.describe() level we would do this specific check (using the generic self.get_ref() calls) and then fall back to returning self._describe() (where _describe = _backend_func("describe"))
b63a81f to
b9fb39a
Compare
b9fb39a to
e5484ce
Compare
e5484ce to
c03b4b5
Compare
c03b4b5 to
c19555e
Compare
…terative#4) fix: iterative#4 and iterative/dvc#6051 In dvc we get a random toggling branch name in exp show. It is because when we iter branches the dulwich.refs.keys gives an unordered Set of refs. Here we choose the active branch if we are `describe` its commit rev. 1. Make active branch always in the first place. 2. Add a new test to it. Co-authored-by: Peter Rowlands (변기호) <peter@pmrowla.com>
c322eec to
976a0f2
Compare
fix: #4 and iterative/dvc#6051
In dvc we get a random toggling branch name in
exp show. It is becausewhen we iter branches the
dulwich.refs.keysgives an unorderedSetof refs. Here we reordered it, and makes current active branch always be
in the first order.