[all-commits] [llvm/llvm-project] dccebd: Finally formalise our defacto line-ending policy
ldrumm via All-commits
all-commits at lists.llvm.org
Thu Oct 17 06:49:59 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: dccebddb3b802c4c1fe287222e454b63f850f012
https://github.com/llvm/llvm-project/commit/dccebddb3b802c4c1fe287222e454b63f850f012
Author: Luke Drummond <luke.drummond at codeplay.com>
Date: 2024-10-17 (Thu, 17 Oct 2024)
Changed paths:
M .gitattributes
A clang-tools-extra/clangd/test/.gitattributes
A clang/test/.gitattributes
M llvm/docs/TestingGuide.rst
A llvm/test/FileCheck/.gitattributes
A llvm/test/tools/llvm-ar/Inputs/.gitattributes
A llvm/utils/lit/tests/Inputs/shtest-shell/.gitattributes
Log Message:
-----------
Finally formalise our defacto line-ending policy
Historically, we've not automatically enforced how git tracks line
endings, but there are many, many commits that "undo" unintended CRLFs
getting into history.
`git log --pretty=oneline --grep=CRLF` shows nearly 100 commits
involving reverts of CRLF making its way into the index and then
history. As far as I can tell, there are none the other way round except
for specific cases like `.bat` files or tests for parsers that need to
accept such sequences.
Of note, one of the earliest of those listed in that output is:
```
commit 9795860250734e5c2a879546c534e35d9edd5944
Author: NAKAMURA Takumi <geek4civic at gmail.com>
Date: Thu Feb 3 11:41:27 2011 +0000
cmake/*: Add svn:eol-style=native and fix CRLF.
llvm-svn: 124793
```
...which introduced such a defacto policy for subversion.
With old versions of git, it's been a bit of a crap-shoot whether
enforcing storing line endings in the history will upset checkouts on
machines where such line endings are the norm. Indeed many users have
enforced that git checks out the working copy according to a global or
per-user config via core crlf, or core autocrlf.
For ~8 years now[1], however, git has supported the ability to "do as
the Romans do" on checkout, but internally store subsets of text files
with line-endings specified via a system of patterns in the
`.gitattributes` file. Since we now have this ability, and we've been
specifying attributes for various binary files, I think it makes sense
to rid us of all that work converting things "back", and just let git
handle the local checkout. Thus the new toplevel policy here is
* text=auto
In simple terms this means "unless otherwise specified, convert all
files considered "text" files to LF in the project history, but check
them out as expected on the local machine. What is "expected on the
local machine" is dependent on configuration and default.
For those files in the repository that *do* need CRLF endings, I've
adopted a policy of `eol=crlf` which means that git will store them in
history with LF, but regardless of user config, they'll be checked out
in tree with CRLF.
Finally, existing files have been "corrected" in history via `git add
--renormalize .`
End users should *not* need to adjust their local git config or
workflow.
[1]: git 2.10 was released with fixed support for fine-grained
line-ending tracking that respects user-config *and* repo policy. This
can be considered the point at which git will respect both the user's
local working tree preference *and* the history as specified by the
maintainers. See
https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248
for the release note.
Commit: 9d98acb196a40fee5229afeb08f95fd36d41c10a
https://github.com/llvm/llvm-project/commit/9d98acb196a40fee5229afeb08f95fd36d41c10a
Author: Luke Drummond <luke.drummond at codeplay.com>
Date: 2024-10-17 (Thu, 17 Oct 2024)
Changed paths:
M clang-tools-extra/clangd/test/input-mirror.test
M clang-tools-extra/clangd/test/protocol.test
M clang-tools-extra/clangd/test/too_large.test
M clang/test/AST/HLSL/StructuredBuffer-AST.hlsl
M clang/test/C/C2y/n3262.c
M clang/test/C/C2y/n3274.c
M clang/test/CodeGenHLSL/builtins/StructuredBuffer-annotations.hlsl
M clang/test/CodeGenHLSL/builtins/StructuredBuffer-constructor.hlsl
M clang/test/CodeGenHLSL/builtins/StructuredBuffer-elementtype.hlsl
M clang/test/CodeGenHLSL/builtins/StructuredBuffer-subscript.hlsl
M clang/test/CodeGenHLSL/builtins/atan2.hlsl
M clang/test/CodeGenHLSL/builtins/cross.hlsl
M clang/test/CodeGenHLSL/builtins/length.hlsl
M clang/test/CodeGenHLSL/builtins/normalize.hlsl
M clang/test/CodeGenHLSL/builtins/step.hlsl
M clang/test/Driver/flang/msvc-link.f90
M clang/test/FixIt/fixit-newline-style.c
M clang/test/Frontend/rewrite-includes-mixed-eol-crlf.c
M clang/test/Frontend/rewrite-includes-mixed-eol-crlf.h
M clang/test/Frontend/system-header-line-directive-ms-lineendings.c
M clang/test/ParserHLSL/bitfields.hlsl
M clang/test/ParserHLSL/hlsl_annotations_on_struct_members.hlsl
M clang/test/ParserHLSL/hlsl_contained_type_attr.hlsl
M clang/test/ParserHLSL/hlsl_contained_type_attr_error.hlsl
M clang/test/ParserHLSL/hlsl_is_rov_attr.hlsl
M clang/test/ParserHLSL/hlsl_is_rov_attr_error.hlsl
M clang/test/ParserHLSL/hlsl_raw_buffer_attr.hlsl
M clang/test/ParserHLSL/hlsl_raw_buffer_attr_error.hlsl
M clang/test/ParserHLSL/hlsl_resource_class_attr.hlsl
M clang/test/ParserHLSL/hlsl_resource_class_attr_error.hlsl
M clang/test/ParserHLSL/hlsl_resource_handle_attrs.hlsl
M clang/test/Sema/aarch64-sve-vector-trig-ops.c
M clang/test/Sema/riscv-rvv-vector-trig-ops.c
M clang/test/SemaHLSL/Availability/avail-diag-default-compute.hlsl
M clang/test/SemaHLSL/Availability/avail-diag-default-lib.hlsl
M clang/test/SemaHLSL/Availability/avail-diag-relaxed-compute.hlsl
M clang/test/SemaHLSL/Availability/avail-diag-relaxed-lib.hlsl
M clang/test/SemaHLSL/Availability/avail-diag-strict-compute.hlsl
M clang/test/SemaHLSL/Availability/avail-diag-strict-lib.hlsl
M clang/test/SemaHLSL/Availability/avail-lib-multiple-stages.hlsl
M clang/test/SemaHLSL/BuiltIns/StructuredBuffers.hlsl
M clang/test/SemaHLSL/BuiltIns/cross-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/half-float-only-errors2.hlsl
M clang/test/SemaHLSL/BuiltIns/length-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/normalize-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/step-errors.hlsl
M clang/test/SemaHLSL/Types/Traits/IsIntangibleType.hlsl
M clang/test/SemaHLSL/Types/Traits/IsIntangibleTypeErrors.hlsl
M clang/test/SemaHLSL/resource_binding_attr_error_basic.hlsl
M clang/test/SemaHLSL/resource_binding_attr_error_other.hlsl
M clang/test/SemaHLSL/resource_binding_attr_error_resource.hlsl
M clang/test/SemaHLSL/resource_binding_attr_error_silence_diags.hlsl
M clang/test/SemaHLSL/resource_binding_attr_error_space.hlsl
M clang/test/SemaHLSL/resource_binding_attr_error_udt.hlsl
M clang/tools/scan-build/bin/scan-build.bat
M clang/tools/scan-build/libexec/c++-analyzer.bat
M clang/tools/scan-build/libexec/ccc-analyzer.bat
M clang/utils/ClangVisualizers/clang.natvis
M flang/test/Driver/msvc-dependent-lib-flags.f90
M lldb/test/API/commands/expression/ir-interpreter-phi-nodes/Makefile
M lldb/test/API/functionalities/postmortem/minidump/fizzbuzz.syms
M lldb/test/API/functionalities/target-new-solib-notifications/Makefile
M lldb/test/API/functionalities/target-new-solib-notifications/a.cpp
M lldb/test/API/functionalities/target-new-solib-notifications/b.cpp
M lldb/test/API/functionalities/target-new-solib-notifications/c.cpp
M lldb/test/API/functionalities/target-new-solib-notifications/d.cpp
M lldb/test/API/functionalities/target-new-solib-notifications/main.cpp
M lldb/test/API/functionalities/unwind/zeroth_frame/Makefile
M lldb/test/API/functionalities/unwind/zeroth_frame/TestZerothFrame.py
M lldb/test/API/python_api/debugger/Makefile
M lldb/test/Shell/BuildScript/modes.test
M lldb/test/Shell/BuildScript/script-args.test
M lldb/test/Shell/BuildScript/toolchain-clang-cl.test
M lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp
M lldb/test/Shell/SymbolFile/NativePDB/Inputs/inline_sites.s
M lldb/test/Shell/SymbolFile/NativePDB/Inputs/inline_sites_live.lldbinit
M lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables-registers.lldbinit
M lldb/test/Shell/SymbolFile/NativePDB/Inputs/lookup-by-types.lldbinit
M lldb/test/Shell/SymbolFile/NativePDB/Inputs/subfield_register_simple_type.lldbinit
M lldb/test/Shell/SymbolFile/NativePDB/function-types-classes.cpp
M lldb/test/Shell/SymbolFile/NativePDB/inline_sites_live.cpp
M lldb/test/Shell/SymbolFile/NativePDB/lookup-by-types.cpp
M lldb/unittests/Breakpoint/CMakeLists.txt
M llvm/benchmarks/FormatVariadicBM.cpp
M llvm/benchmarks/GetIntrinsicForClangBuiltin.cpp
M llvm/benchmarks/GetIntrinsicInfoTableEntriesBM.cpp
M llvm/docs/_static/LoopOptWG_invite.ics
M llvm/lib/Support/rpmalloc/CACHE.md
M llvm/lib/Support/rpmalloc/README.md
M llvm/lib/Support/rpmalloc/malloc.c
M llvm/lib/Support/rpmalloc/rpmalloc.c
M llvm/lib/Support/rpmalloc/rpmalloc.h
M llvm/lib/Support/rpmalloc/rpnew.h
M llvm/lib/Target/DirectX/DXILFinalizeLinkage.cpp
M llvm/lib/Target/DirectX/DirectXTargetTransformInfo.cpp
M llvm/test/CodeGen/DirectX/atan2.ll
M llvm/test/CodeGen/DirectX/atan2_error.ll
M llvm/test/CodeGen/DirectX/cross.ll
M llvm/test/CodeGen/DirectX/finalize_linkage.ll
M llvm/test/CodeGen/DirectX/normalize.ll
M llvm/test/CodeGen/DirectX/normalize_error.ll
M llvm/test/CodeGen/DirectX/step.ll
M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/atan2.ll
M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/cross.ll
M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/length.ll
M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/normalize.ll
M llvm/test/CodeGen/SPIRV/hlsl-intrinsics/step.ll
M llvm/test/Demangle/ms-placeholder-return-type.test
M llvm/test/FileCheck/dos-style-eol.txt
M llvm/test/tools/llvm-ar/Inputs/mri-crlf.mri
M llvm/test/tools/llvm-cvtres/Inputs/languages.rc
M llvm/test/tools/llvm-cvtres/Inputs/test_resource.rc
M llvm/test/tools/llvm-rc/Inputs/dialog-with-menu.rc
M llvm/test/tools/llvm-readobj/COFF/Inputs/resources/test_resource.rc
M llvm/unittests/Support/ModRefTest.cpp
M llvm/utils/LLVMVisualizers/llvm.natvis
M llvm/utils/lit/tests/Inputs/shtest-shell/diff-in.dos
M llvm/utils/release/build_llvm_release.bat
M openmp/runtime/doc/doxygen/config
M pstl/CREDITS.txt
Log Message:
-----------
Renormalize line endings whitespace only after dccebddb3b80
Line ending policies were changed in the parent, dccebddb3b80. To make
it easier to resolve downstream merge conflicts after line-ending
policies are adjusted this is a separate whitespace-only commit. If you
have merge conflicts as a result, you can simply `git add --renormalize
-u && git merge --continue` or `git add --renormalize -u && git rebase
--continue` - depending on your workflow.
Compare: https://github.com/llvm/llvm-project/compare/8c60efe94ba3...9d98acb196a4
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list