GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Store Windows batch files with CRLF line endings · asad/SMSD@ab909cb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .gitattributes
  • java/cli/src/scripts
    • smsd.bat
  • scripts/tests
    • test_supply_chain_pins.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.gitattributes‎

Copy file name to clipboardExpand all lines: .gitattributes
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# Text files are stored and checked out with LF line endings on every platform, except
2-
# Windows batch files, which cmd.exe reads reliably only with CRLF line endings.
1+
# Text files are stored and checked out with LF line endings on every platform.
2+
# Windows batch files are stored with the CRLF line endings that cmd.exe needs and
3+
# are never converted, so every checkout and the source archive hold the same bytes.
34
* text=auto eol=lf
4-
*.bat text eol=crlf
5-
*.cmd text eol=crlf
5+
*.bat -text
6+
*.cmd -text
67

78
# Binary files are never converted.
89
*.docx binary
Collapse file

‎java/cli/src/scripts/smsd.bat‎

Copy file name to clipboard
+26-26Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
@echo off
2-
rem SPDX-License-Identifier: Apache-2.0
3-
rem Copyright (c) 2018-2026 BioInception PVT LTD
4-
rem Algorithm Copyright (c) 2009-2026 Syed Asad Rahman
5-
rem See the NOTICE file for attribution, trademark, and algorithm IP terms.
6-
rem SMSD standalone CLI launcher. JAVA_OPTS is passed to java as written.
7-
setlocal
8-
set "SMSD_JAR_PATH=%SMSD_JAR%"
9-
if defined SMSD_JAR_PATH goto run
10-
for /f "delims=" %%J in ('dir /b /a-d /o-d "%~dp0..\..\target\smsd-cli-*-jar-with-dependencies.jar" 2^>nul') do (
11-
set "SMSD_JAR_PATH=%~dp0..\..\target\%%J"
12-
goto run
13-
)
14-
for /f "delims=" %%J in ('dir /b /a-d /o-d "%~dp0smsd-cli-*-jar-with-dependencies.jar" 2^>nul') do (
15-
set "SMSD_JAR_PATH=%~dp0%%J"
16-
goto run
17-
)
18-
echo SMSD JAR not found. Run mvn package first or set SMSD_JAR. 1>&2
19-
exit /b 1
20-
:run
21-
if defined JAVA_HOME (
22-
"%JAVA_HOME%\bin\java.exe" %JAVA_OPTS% -jar "%SMSD_JAR_PATH%" %*
23-
) else (
24-
java %JAVA_OPTS% -jar "%SMSD_JAR_PATH%" %*
25-
)
26-
exit /b %ERRORLEVEL%
1+
@echo off
2+
rem SPDX-License-Identifier: Apache-2.0
3+
rem Copyright (c) 2018-2026 BioInception PVT LTD
4+
rem Algorithm Copyright (c) 2009-2026 Syed Asad Rahman
5+
rem See the NOTICE file for attribution, trademark, and algorithm IP terms.
6+
rem SMSD standalone CLI launcher. JAVA_OPTS is passed to java as written.
7+
setlocal
8+
set "SMSD_JAR_PATH=%SMSD_JAR%"
9+
if defined SMSD_JAR_PATH goto run
10+
for /f "delims=" %%J in ('dir /b /a-d /o-d "%~dp0..\..\target\smsd-cli-*-jar-with-dependencies.jar" 2^>nul') do (
11+
set "SMSD_JAR_PATH=%~dp0..\..\target\%%J"
12+
goto run
13+
)
14+
for /f "delims=" %%J in ('dir /b /a-d /o-d "%~dp0smsd-cli-*-jar-with-dependencies.jar" 2^>nul') do (
15+
set "SMSD_JAR_PATH=%~dp0%%J"
16+
goto run
17+
)
18+
echo SMSD JAR not found. Run mvn package first or set SMSD_JAR. 1>&2
19+
exit /b 1
20+
:run
21+
if defined JAVA_HOME (
22+
"%JAVA_HOME%\bin\java.exe" %JAVA_OPTS% -jar "%SMSD_JAR_PATH%" %*
23+
) else (
24+
java %JAVA_OPTS% -jar "%SMSD_JAR_PATH%" %*
25+
)
26+
exit /b %ERRORLEVEL%
Collapse file

‎scripts/tests/test_supply_chain_pins.py‎

Copy file name to clipboardExpand all lines: scripts/tests/test_supply_chain_pins.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ def test_text_files_are_checked_out_with_lf_line_endings(self):
114114
except (OSError, subprocess.CalledProcessError):
115115
self.skipTest("not a git checkout")
116116
for line in listing.splitlines():
117-
index, _, attribute = line.split(None, 3)[:3]
117+
index, _, attribute, path = line.split(None, 3)
118+
# Windows batch files are stored with CRLF and never converted.
119+
if index == "i/crlf":
120+
self.assertTrue(path.endswith((".bat", ".cmd")) and attribute == "attr/-text", line)
121+
continue
118122
self.assertIn(index, ("i/lf", "i/-text", "i/none"), line)
119123
if index == "i/-text":
120124
self.assertEqual(attribute, "attr/-text", line)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.