aboutsummaryrefslogtreecommitdiff
path: root/doc/.gitattributes
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2020-03-08 16:40:05 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2020-03-24 17:20:19 +0000
commitb7c13323e702c7aa1d05d952708d1e408c47fae1 (patch)
tree1971df8ad4bcc09b070ca41e2805eb5c0179ce32 /doc/.gitattributes
parent4d7c48fb80cb65d53ad3bcd57182ffb79b61e5f3 (diff)
downloadriscv-openocd-b7c13323e702c7aa1d05d952708d1e408c47fae1.zip
riscv-openocd-b7c13323e702c7aa1d05d952708d1e408c47fae1.tar.gz
riscv-openocd-b7c13323e702c7aa1d05d952708d1e408c47fae1.tar.bz2
doc: fix texinfo files attributes on Windows
While installing git on Windows, the user is prompted by a dialog "Configuring the line ending conversions" to select the value for the git property "core.autocrlf". The default choice proposed by the installer is "Checkout Windows-style, commit Unix-style line endings", that corresponds to "core.autocrlf=true". Even if the dialog provides technical explanation of the different choices, most users will blindly accept the default proposal. With "core.autocrlf=true" git will convert to DOS mode all the text files during "clone" (so can be edited by any crap Windows tool) and convert back to UNIX mode during "push" operation. While this is safe enough for C and TCL files, it breaks the texinfo files. The trailing '@' character used for command continuation in https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Def-Cmd-Continuation-Lines.html does not accept being followed by CR+LF (DOS mode), generating a build error. Same error can be replicated on Linux by passing the file doc/openocd.texi through "unix2dos" command. Tentative to fix this has already been proposed in http://openocd.zylin.com/5294 http://openocd.zylin.com/5413 by breaking the command continuation syntax, which is a no go. The correct fix would require to force/suggest all the Windows users to get rid of the crap DOS mode, but this could have side effects. To workaround the issue, add a .gitattributes file in the doc folder, specifying a local conversion attribute for the files .txt and .texi in the doc folder and overriding the eventual incorrect global value of "core.autocrlf" selected during installation. The local attribute "text eol=lf" is equivalent to the global one "core.autocrlf=input". Change-Id: I468a8f8125b6bc4628fce6c66eb082824ba3413f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5499 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'doc/.gitattributes')
-rw-r--r--doc/.gitattributes3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/.gitattributes b/doc/.gitattributes
new file mode 100644
index 0000000..dcf6d03
--- /dev/null
+++ b/doc/.gitattributes
@@ -0,0 +1,3 @@
+# Avoid DOS conversion of texinfo files during git clone
+*.texi text eol=lf
+*.txt text eol=lf