testify
testify copied to clipboard
Vendor unmaintained github.com/pmezard/go-difflib
Summary
Bring the un-maintained github.com/pmezard/go-difflib/difflib library into testify and adopt support of the package.
Changes
- Move
github.com/pmezard/go-difflib/difflibpackage to.../internal/difflibso that it cannot be imported by other modules. - Copy
internal/difflibinto testify, preserving all git history, and preserving the difflib license. - Remove unused functions from internal/difflib.
- Remove
github.com/pmezard/go-difflibfrom testify's requirements.
Motivation
Difflib is explicitly unmaintained but depended on by testify.
Related issues
Closes #1159
I love the idea of importing the lib and its history
But then, later, did you consider this also?
https://github.com/stretchr/testify/pull/1546
I'm aware, the idea of changing the library used for this gives me some concern. It's not so bad because it's not actually used for any comparisons. But it does change the diff and it's likely there will be cases where the change is a negative. If this was on a v2 boundary I'd be less hesitant.
It's also another library which might be considered unsupported by some. I usually don't share the view but a lot of corporations consider projects which don't have recent work on them to be de-facto unsupported. I sometimes consider these to be "stable", but an aim of the current maintenance of testify is to make it so that users with some requirement to use only supported software don't need to re-write all their tests to remove testify.
This PR is one of a few potential options. Substantive discussion will decide which is used.
Thanks a lot for handling this. When do you expect to merge this?
This is the right thing to do.
@Devourian What is your objection to this change?
@brackendawson I'm ok with the current code.
However I would prefer if we could have a clean branch rebased on top of master at the time of merge, for a cleaner history.
I've attempted git rebase -i -r --onto origin/master 7c367bb7bc7dad2d8b17921a604157dc27ebe06f internal-difflib, but a problem remains as the reference to the external difflib remains in go.mod. We would have to edit the merge commit, but I haven't been able to do it so far.
I'll make a clean version. Also would appreciate not changing the titles of PRs unless it's necessary, it makes it harder to keep track of things that are in progress.
I don't think the rebase tooling in git supports rebasing across unrelated histories, so the only way to make a version of this branch without another merge commit is to repeat this procedure from scratch, which I'm not going to do. I think the best way forward is to merge this with a merge commit, as has been done with many other PRs in this repo.
@dolmen or @ccoVeille I've re-based this PR, it's not trivial to do so I'd appreciate it if you could consider re-approval soon.