-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
gitserver: grpc: port DiffSymbols from client as new GitBackend.ChangedFiles() func #62252
gitserver: grpc: port DiffSymbols from client as new GitBackend.ChangedFiles() func #62252
Conversation
d02b395
to
39e5cfb
Compare
cc96f91
to
75dd653
Compare
39e5cfb
to
3e6f221
Compare
75dd653
to
18d4bba
Compare
3e6f221
to
ca768ec
Compare
18d4bba
to
7a9e364
Compare
ca768ec
to
dd16782
Compare
7a9e364
to
319d6a9
Compare
dd16782
to
6d618e6
Compare
319d6a9
to
d8cb7fe
Compare
6d618e6
to
a450397
Compare
d8cb7fe
to
59cae3e
Compare
a450397
to
48fb88c
Compare
59cae3e
to
43d8723
Compare
48fb88c
to
1a44563
Compare
43d8723
to
9e1c79e
Compare
1a44563
to
8ad5a04
Compare
f800d7e
to
4a1d819
Compare
1762bcd
to
9c1c0ad
Compare
4a1d819
to
6dcb97e
Compare
9c1c0ad
to
ea74865
Compare
6dcb97e
to
4dc9626
Compare
ea74865
to
226ef53
Compare
2b94c9e
to
95ae787
Compare
226ef53
to
9a67eff
Compare
95ae787
to
8a62f4f
Compare
9a67eff
to
3c952f2
Compare
8a62f4f
to
04ebcb0
Compare
@sourcegraph/source Could you please re-review this (and the upstream PRs)? I refactored the approach to use the iterator pattern. |
04ebcb0
to
09a543b
Compare
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.
LGTM, left a question about using an iterator here as well
switch status[0] { | ||
case 'A': | ||
changes = append(changes, gitdomain.PathStatus{Path: string(path), Status: gitdomain.AddedAMD}) | ||
case 'M': | ||
changes = append(changes, gitdomain.PathStatus{Path: string(path), Status: gitdomain.ModifiedAMD}) | ||
case 'D': | ||
changes = append(changes, gitdomain.PathStatus{Path: string(path), Status: gitdomain.DeletedAMD}) |
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.
The logic in LogReverseEach that we had here: https://github.com/sourcegraph/sourcegraph/pull/62260/files#diff-e7b89c0e3e24a2fda065a7cfa5f06f7b7def4d36189d88e495e5b40f5ca9795fL112-L194 also does some more checks on submodule status and stuff. Not sure if needed here, but might be cool for consolidation. We can do that separately though
469da92
to
6f8daa5
Compare
6f8daa5
to
1326bb8
Compare
Part of #61691
This PR adds a new method, ChangedFiles to the git cli backend that lists the files that between the base and head commits, along with their added/modified/deleted status. Unlike the current workflow that involves multiple callsites with their own implementations for parsing the raw gitserver exec output, all the parsing now happens server-side and is well tested.
This functionality should be able to subsume the other diff-tree / diff use-cases in:
Test plan
Added new unit tests:
sourcegraph/cmd/symbols/gitserver/client_test.go
Lines 9 to 61 in 458ce56