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

high-level description of algorithm #8

Closed
aspiers opened this issue Feb 6, 2019 · 3 comments · Fixed by #41
Closed

high-level description of algorithm #8

aspiers opened this issue Feb 6, 2019 · 3 comments · Fixed by #41

Comments

@aspiers
Copy link

aspiers commented Feb 6, 2019

It would be nice if the algorithm was documented at a high-level, not just so that people can more easily contribute to the code, but also so that users can be aware of any particular strengths or caveats. For example it seems that it doesn't use libgit2's blame APIs - is that right? In which case, does it just iterate through the N most recent commits (where N seems to default to 10) looking for commits which change the same lines altered by the fixup hunks?

@tummychow
Copy link
Owner

the best description atm is probably here https://github.com/tummychow/git-scripts/blob/master/git-absorb.md#interlude-patch-theory

but i acknowledge that there should probably be something in this specific repo, and it should probably be refreshed a bit (eg my old implementation of hunk commutation was completely wrong)

@aspiers
Copy link
Author

aspiers commented Feb 6, 2019

Oh cool thanks! Yes, that file definitely belongs in this repository. So you are going more down the darcs route than the blame route - interesting (I used to use darcs a long time ago, and enjoyed this feature). I went the opposite way and chose the latter:

but it has been on my mind for a long time to look deeper into patch theory:

It would be cool to get your thoughts on this. I expect there are pros and cons of both approaches. I expect that pairwise testing of commutativity is probably more efficient than the blame algorithm which presumably tries to excavate a lot more information than a simple boolean result, and as a consequence is probably much more expensive. But I'd have to research git's blame algorithm to be sure.

gasche added a commit to gasche/git-absorb that referenced this issue Apr 14, 2021
@gasche
Copy link
Contributor

gasche commented Apr 14, 2021

I also thought that it would help to describe how the tool work, so that users can form a mental model and not be surprised when using it. It went to read this issue and the long explanation at https://github.com/tummychow/git-scripts/blob/master/git-absorb.md#interlude-patch-theory, and proposed a short summary in the README at #41.

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

Successfully merging a pull request may close this issue.

3 participants