MHTML test files are marked as text but checked in with CRLFs, leading to Git weirdness |
|||
Issue description
This .gitattributes file declares that the files in LayoutTests/mhtml/ are text files which should be checked out with CRLF line endings:
third_party/WebKit/LayoutTests/mhtml/.gitattributes
Git internally represents text files with LF line endings, but before that file was created, the files were checked in with CRLFs. This is an invalid state, but it doesn't show itself in an initial clone or after a `git reset --hard` (probably some optimization in Git which assumes that freshly-checked-out files don't have changes).
You can trigger the issue by touching any .mht file in this directory. For example:
touch third_party/WebKit/LayoutTests/mhtml/transfer_encoding_7bit.mht
Now, a `git status` will show that file as modified, and no combination of `git checkout <file>` and `git reset <file>` will make it stop showing up as modified. A `git reset --hard` on the whole repo will restore Git's ignorance.
,
Oct 14 2016
,
Oct 17 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/89a9d64a0cdaba5a5f5be5a098b99769074bf623 commit 89a9d64a0cdaba5a5f5be5a098b99769074bf623 Author: Sidney San Martín <sdy@chromium.org> Date: Mon Oct 17 16:23:22 2016 Re-add MHTML files so that they're represented with LF line endings. They'll still be CRLF on checkout. In crrev.com/bb2148f3eed355794122db8d31d5eed903c53ced, a .gitattributes file with this line was added to the mhtml directory: *.mht text eol=crlf Git internally represents text files with LF line endings, but before that file was created, the files were checked in with CRLFs. This is an invalid state, but it doesn't show in a fresh clone or after `git reset --hard` (probably some optimization in Git which assumes that no files in a fresh repo can have changes). You can trigger the issue by touching any .mht file in this directory. For example: touch third_party/WebKit/LayoutTests/mhtml/transfer_encoding_7bit.mht Now, a `git status` will show that file as modified, and no combination of `git checkout <file>` and `git reset <file>` will make it stop showing up as modified. A `git reset --hard` on the whole repo will restore Git's ignorance. You can also reveal the issue by deleting/moving .git/index and then running `git reset` to recreate it: all of these files will now show up as modified. As far as I can tell, the right solution is to check all of these files in again. This shouldn't have any observable effects other than the issue described above no longer being reproducible. Another option is to edit the .gitattributes file to treat these files as binary. BUG= 656177 R=mark@chromium.org Review URL: https://codereview.chromium.org/2419613006 . Patch from Sidney San Martín <sdy@chromium.org>. Cr-Commit-Position: refs/heads/master@{#425694} [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/content_transfer_encoding_none.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/invalid-bad-boundary.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/invalid-bad-boundary2.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/mhtml-with-capital-mimetype-loading.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/multi_frames_ie.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/multi_frames_unmht.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/page_with_css_and_js_ie.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/page_with_css_and_js_unmht.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/page_with_image_ie.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/page_with_image_unmht.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/page_with_javascript.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/relative_url.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/relaxed-content-type-parameters.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/shared_buffer_bug.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/simple_page_ie.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/simple_page_unmht.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/transfer_encoding_7bit.mht [modify] https://crrev.com/89a9d64a0cdaba5a5f5be5a098b99769074bf623/third_party/WebKit/LayoutTests/mhtml/transfer_encoding_8bit.mht
,
Dec 22 2016
This was fixed by the above change. |
|||
►
Sign in to add a comment |
|||
Comment 1 by sdy@chromium.org
, Oct 14 2016