Skip to content
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

mis-using commit object and commit id #35

Closed
coldfire-x opened this issue May 15, 2013 · 2 comments
Closed

mis-using commit object and commit id #35

coldfire-x opened this issue May 15, 2013 · 2 comments

Comments

@coldfire-x
Copy link
Contributor

in log/commitset.py, this line:

self.__tails = parents - commit_set is error, since parents is a set of strs, but commit_set is a set of commit objects, these two are different.

btw, according to the comment, i think the right order is commit_set - parents.

@jensl
Copy link
Owner

jensl commented May 15, 2013

The gitutils.Commit class has hash() and eq()/ne() methods that make them act sort of as strings (the commit's SHA-1) when used in, for instance, sets. So the set subtraction works as intended, returning the SHA-1 strings in 'parents' that are not matched by Commit objects in 'commit_set'.

And no, the order is correct. The tails of the commit set is defined as all parents (of commits in the commit set) that aren't themselves part of the commit set. If the expression was "commit_set - parents", you'd get every commit in the commit set that isn't a parent of another commit in the commit set. (This incidentally is what I call the "heads" of the commit set.)

The commit set class is fairly central functionality, on which quite a bit of other functionality depends, so we ought to have noticed if it was severely broken. :-)

@coldfire-x
Copy link
Contributor Author

oh, you are right about the set deduction operation, the reason i doubt the order is, when i click the filter link reviewable in http://host/r/1 page, it gives me an exception, impossible commit-set. so I checked the code, switched those two operands, and get an exception raised by subprocess complaining args type mush be string type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants