Message ID | 20181102185317.31015-1-newren@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | Improve path collision conflict resolutions | expand |
On 11/2/2018 2:53 PM, Elijah Newren wrote: > Major question: > * You'll note that I edited the last two patches to mark them as RFC. > To be honest, I'm not sure what to do with these. They improve code > coverage of new code, but the same gaps existed in the old code; > they only show up in the coverage-diff because I essentially moved > code around to a new improved function. Since the new code doesn't > really add new abilities but rather just shifts the handling of > these conflicts to a common function, they shouldn't need any more > testcases than previously and modifying the existing patches thus > feels slightly misleading. That line of thought leads me to believe > that perhaps putting them in a separate combined patch of their own > with a decent commit message is the right way to go. On the other > hand, squashing them to the commits they're marked as fixups for > shows which logical part of the code the tests are related to, which > seems like a good thing. So what's the right way to handle these? I appreciate the effort you made to improve test coverage! It's unfortunate that this portion wasn't covered earlier, because we could have broken it and not noticed until a release. I think making them separate commits is fine, and the comment on the test case is helpful. The fact that you only had to change the commit timestamps in order to get the coverage makes me reexamine the code and realize that maybe the "right" thing to do is to reduce our code clones. (This is also how I was looking at the wrong block of the patch when talking about it not being covered.) I'll look at the patch and see if I can contribute a concrete code suggestion there. Aside: I hope that I am not being annoying by poking around with the test coverage reports. It does give me a way to target my review efforts, especially into changes that touch areas outside my expertise (like this one). Thanks, -Stolee
On Fri, Nov 2, 2018 at 12:09 PM Derrick Stolee <stolee@gmail.com> wrote: > > On 11/2/2018 2:53 PM, Elijah Newren wrote: > > Major question: > > * You'll note that I edited the last two patches to mark them as RFC. > > To be honest, I'm not sure what to do with these. They improve code > > coverage of new code, but the same gaps existed in the old code; > > they only show up in the coverage-diff because I essentially moved > > code around to a new improved function. Since the new code doesn't > > really add new abilities but rather just shifts the handling of > > these conflicts to a common function, they shouldn't need any more > > testcases than previously and modifying the existing patches thus > > feels slightly misleading. That line of thought leads me to believe > > that perhaps putting them in a separate combined patch of their own > > with a decent commit message is the right way to go. On the other > > hand, squashing them to the commits they're marked as fixups for > > shows which logical part of the code the tests are related to, which > > seems like a good thing. So what's the right way to handle these? > > I appreciate the effort you made to improve test coverage! It's > unfortunate that this portion wasn't covered earlier, because we could > have broken it and not noticed until a release. Yes, I agree...except that I think we might not have noticed until a couple releases down the road; these things tend to not come up a lot in practice. (Which may make it even more important to pay attention to code coverage.) > I think making them separate commits is fine, and the comment on the > test case is helpful. The fact that you only had to change the commit > timestamps in order to get the coverage makes me reexamine the code and > realize that maybe the "right" thing to do is to reduce our code clones. > (This is also how I was looking at the wrong block of the patch when > talking about it not being covered.) I'll look at the patch and see if I > can contribute a concrete code suggestion there. Yeah, I had the same feeling, _again_, while re-looking at the tests and code as well. I think the history of how we got here goes something like this: * there is some fairly simple code to handle these rename/rename (1to2 and 2to1) cases, with logic for handling each side being a neary-copy of each other. * someone does some analysis about trying to remove duplication and notes that there are 3-4 pieces that change; adding logic to change out those pieces and rewrite it as a loop adds some complexity, which isn't worth it given the simple code * additional issues are discovered, such as D/F conflicts or inappropriate handling of untracked or dirty files, and due to merge-recursive's bad design[1], the fixes have to be sprinkled *everywhere* throughout the whole code base. Lather, rinse, repeat a few times. * Now, although the original analysis of removing the duplication was correct given the amount of code that exited at the time, the weights have changed as new code was added to both codepaths. But the original analysis is long since forgotten, the code is more complex, and we have to think about whether fixing it now is worth it if we're going to rewrite it all anyway to fix that fundamental design flaw[2]. [1] https://public-inbox.org/git/xmqqd147kpdm.fsf@gitster.mtv.corp.google.com/ [2] https://public-inbox.org/git/xmqqk1ydkbx0.fsf@gitster.mtv.corp.google.com/ > Aside: I hope that I am not being annoying by poking around with the > test coverage reports. It does give me a way to target my review > efforts, especially into changes that touch areas outside my expertise > (like this one). Not annoying at all; I think it's a very valuable thing you're doing. And I think these tests make things better (there have definitely been cases in the past where a merge one way would work and a merge the other way would have funny bugs). I was just unsure about what the best way to present it amongst the other changes was.