-
Notifications
You must be signed in to change notification settings - Fork 510
What is count
in a change object?
#210
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
Comments
I also was trying to analyze it. It seems that 'count' is the tokens count. Tokens can be such as:
E.g. for
on the string:
and see |
You can add up the numbers of added/removed tokens up to show summary stats like GitHub does on pull requests: It's also useful for understanding how the underlying algorithm works (in particular how it is tokenizing stuff), especially if you're getting results that intuitively seem like a sub-optimal diff! For instance, in the issue description you figured out from these numbers that I can also imagine hypothetical uses like showing in some kind of review tool that the user has so far reviewed (or scrolled past) x% of all inserted content and y% of all deleted content, though I've not seen an example of such functionality in the wild. |
Anyway, you're right that the docs don't mention this, and that seems bad. We should document |
By the way, @rococode, I'd love any feedback you have on the updates to the README I've made to address this. :) |
What do those counts mean? Unless I'm missing something it doesn't seem to be mentioned in the spec at all. In the image above I'm using word diff.
Edit: Oh, it seems it's a count of the type that was diffed? So in this case it's a count of "words" (except spaces are counted too) and for a
diffChars
it counts characters. What's a potential use case for that info?The text was updated successfully, but these errors were encountered: