-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Add gix log #1643
Add gix log #1643
Conversation
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.
Thanks a lot for your contribution and for getting this started.
For fun, I did try it and it worked :)!
❯ cargo run --bin gix -- log src/gix.rs
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.46s
Running `target/debug/gix log src/gix.rs`
0b5dc744 Fix compilation errors
202f3e48 Refactor: Make it easier to compile gitoxide as dynlib
4ef9a323 use a multi-call binary ('uni') to have only one build step (#987)
518159da make top-level `gix` docs available when using `cargo doc`
73372d0b fix: re-enable local-time support for all binaries
3ddbd2de feat: Make `reqwest` TLS backend configuration easy.
b1c40b03 feat: use docsrs feature in code to show what is feature-gated automatically on docs.rs
f7f136db chore: uniformize deny attributes
6da82507 Merge branch 'main' into rev-parse-delegate
faaf791c make obvious what plumbing and porcelain really are (#331)
c3d319f2 Initial commit - based on standard project template
I thought I could leave some comments despite this PR being in its early stages, hoping that's alright.
I discovered a behavior in Apart from that, I have incorporated your suggestions, so thanks for all of them! |
This is the script I use to compare the output of |
Actually, I noticed the misuse too, but when I tried it, it (probably accidentally) worked so I thought that maybe you are just exploiting some property of it very cleverly. What's happening here is that |
Quick update: I hope this PR is mostly done. Comparing the output of |
Thanks for the update! It's interesting that |
5b0daaa
to
5766ea0
Compare
@Byron Is there any code in Also, I assume it makes little sense to land this feature without rename tracking. What do you think? And another also: since there seem to be more cases to consider than I initially thought, I would like to add a couple of tests. Would this require moving the code I’ve written so far elsewhere? |
Thanks for asking, happy to help. In order to get rename-tracking one would have to use
This is a harder question for me. The only way to test the CLI is In order to implement this correctly, one would have to add some sort of Probably something to exhange more thoughts on, not knowing |
Thanks for the hint! I’ve now done a bit of research and can provide another quick update: Also, At this point, I have learned that Also, your comment was really helpful as it made me dig deeper. So thanks for that! 😄 |
Thanks a lot for sharing - I had no clue! But wouldn't that make So my recommendation, assuming the assessment is correct, would certainly be to drop PS: I will have to keep working on PS2: When rename tracking is done, it's going to be even more expensive and I was thinking that one could even record all the paths that are touched in memory, similar to |
It's primarily meant to better understand `gix blame`.
For now, let's ignore file-based logs as it would take a moment to make it fast enough. Git can diff with pathspecs, which is probably something that would be needed to be fast here. In any case, more research would be needed to be competitive in performance. Maybe one day this will be re-added even in its current form to help with `gix blame` debugging, but I'd hope that there will be better ways to validate it.
Thanks a lot for getting this started! In order to be able to merge it, I had to remove the |
Am I right in assuming that single file history would also greatly benefit from a Bloom filter? This was one of the reasons I started working on |
I took another look and have a strong feeling that blame is doing its very own, manual traversal. They have a prio-queue that keeps commits sorted. The normal commit traversal in And then I think one can compare both algorithms based on without commit-graph available, as that disables the bloom filter as well. In theory, they would be just as fast. Please note that I will also be adding some statistics, just like |
This PR adds
gix log
with functionality similar togit log --oneline
. It seems to already work in the majority of cases, but there are still issues to flesh out with respect to how renames are handled. Nevertheless, I wanted to open the PR early, in order to get any feedback on the general approach you might already have at this point.I noticed that there is quite an overlap conceptually with how commit walks are done for blames, so this might be an area to share some code at some point.