-
Notifications
You must be signed in to change notification settings - Fork 38
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
Improve git walking #439
Improve git walking #439
Conversation
5580ac3
to
73e6f78
Compare
73e6f78
to
93f25f8
Compare
9fd3d11
to
8123351
Compare
8123351
to
4877ea1
Compare
@jfly wouldn't mind your eye on this too 🙏 |
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.
This is a neat idea! It'll be cool to see it in action.
I tried to give you a thorough review, but I'm a total beginner with go
, and don't really have treefmt's architecture in my head.
That said, I think I understand enough of this PR to know that either something is missing, or I'm even more confused than I realize. Perhaps I'm just misunderstanding what this feature is meant to do.
I would have expected that if I ask treefmt to format my staged files, it would do some git acrobatics to only format the staged changes of those staged files. (You'll see this expectation reflected in at least one of my inline code comments). Now that I've read the whole diff, that doesn't seem to be the case: this really only affects which files we walk over, it doesn't do anything clever to separate the staged vs unstaged changes. Doing this right is tricky and is why writing a pre-commit hook correctly is so damn annoying.
If I understand correctly, this also doesn't seem to implement the thing asked for in #311. But maybe the goal changed since June? I'm also a little skeptical about the thing being described in #311. I'll leave a comment over there about that.
I tagged that issue as I thought I was solving the same problem. But you're right; I seem to have drifted. |
On reflection and continuing the discussion in #311, I will simplify this PR to just replacing |
4877ea1
to
8a719ff
Compare
Just curious, why are we dropping |
Originally, this was motivated by the status in Having seen how clean and simple it looks just shelling out versus using TLDR; less dependencies, less indirection, less code 🙂 |
I'll rebase this once #447 is merged and then mark it ready for review. |
Signed-off-by: Brian McGee <[email protected]>
8a719ff
to
d51e247
Compare
d51e247
to
349abb9
Compare
Replaces the use of `go-git` with a simple `git ls-file` for traversing the git index. Signed-off-by: Brian McGee <[email protected]>
349abb9
to
844f3fd
Compare
Replaces the use of
go-git
with a simplegit ls-file
for traversing the git index.TODO