-
-
Notifications
You must be signed in to change notification settings - Fork 25.5k
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
Revisit gitattributes merge=union #21516
Comments
Not sure either ... it seems like merge=union prevents the lines removal to happen. From some quick tests, it seems like this can happen if you create your PR branch when the log entry for #21130 was still in v1.1.rst and you modify v1.1.rst. When you Generally speaking I guess this is a matter of deciding whether the benefit of merge=union i.e. avoiding conflicts in PRs is worth the downsides i.e. this kind of caveat or potentially additions that are not in the right order (e.g. lexical order for the modules). There is also the option to define custom merge drivers but this does not seem worth the effort I would say. |
A script reproducing the problem: set -e
# this is a commit that has the #21130 changelog line in v1.1.rst
git checkout -b test-merge b6f11554f > /dev/null
echo 'diff --git a/doc/whats_new/v1.1.rst b/doc/whats_new/v1.1.rst
index 93300bf67..54fb41a7d 100644
--- a/doc/whats_new/v1.1.rst
+++ b/doc/whats_new/v1.1.rst
@@ -55,6 +55,7 @@ Changelog
:mod:`sklearn.linear_model`
...........................
+- add something in linear model
- |Fix| :class:`linear_model.LogisticRegression` now raises a better error
message when the solver does not support sparse matrices with int64 indices.' > test-merge.patch
git apply test-merge.patch > /dev/null
git ci -am 'update changelog'
git pull upstream main --no-edit > /dev/null
# This shows that 21130 is still in the doc/whats_new/v1.1.rst
git --no-pager grep 21130 doc/whats_new/v1.1.rst && echo changelog line has been readded |
I am okay with considering this a non issue for now and change it if it becomes a problem. As for the whats new order, we can create a validator from |
Another data point I just bumped into, I thought that merge=union would avoid conflicts in the github web UI but apparently not. github needs to do something to have the behaviour I want if I understand correctly: More context: I just had a conflict in |
Data point: I recently ran into this when reviewing a PR with a merge conflict on |
Just to make sure I follow you, you would have preferred to get an explicit conflict so that you know you have to pay attention, rather than merge=union solving the conflict and realising only later (e.g. in the github diff) that a changelog entry was added although it was not related to your PR at all. It feels like in both cases you need to manually confirm that the entry has been moved to v1.0.rst. Maybe I am missing something though ... |
Yup, this was exactly what I was thinking about. Workflow wise, I am adapting to git diff upstream/main.. doc/whats_new/v1.1.rst after a merge to check if I need to make adjustments. |
I faced the same issue several times. I wouldn't mind removing the |
I opened #23062 to remove gitattributes for whats_new entry, I don't it is that useful after all. |
I have been seeing the default merge result in diffs looking like: https://github.com/scikit-learn/scikit-learn/pull/18975/files#diff-5a8a66bfe0792b4a0e50eb7c8cc929f2a8e0d4d88ac2d0084e07b70d069ced89. In this case, the changelog for #21130 was moved into 1.0 as a bug fix.
I'm not sure what a good way is to handle this use case. WDYT @lesteve ?
The text was updated successfully, but these errors were encountered: