Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot_input
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CbmSoft
cbmroot_input
Merge requests
!13
Test file type
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Closed
Test file type
f.uhlig/cbmroot_input:test_file_type
into
master
Overview
0
Commits
8
Pipelines
0
Changes
3
Closed
Florian Uhlig
requested to merge
f.uhlig/cbmroot_input:test_file_type
into
master
4 years ago
Overview
0
Commits
8
Pipelines
0
Changes
3
0
0
Merge request reports
Compare
master
version 1
e3b8f71d
4 years ago
master (base)
and
latest version
latest version
440debc5
8 commits,
4 years ago
version 1
e3b8f71d
7 commits,
4 years ago
3 files
+
85
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
.scripts/check-file-format.sh
0 → 100755
+
38
−
0
View file @ 440debc5
#!/bin/bash
if
[[
$#
-eq
1
]]
;
then
UPSTREAM
=
$1
else
if
[
-z
$UPSTREAM
]
;
then
UPSTREAM
=
$(
git remote
-v
|
grep
git.cbm.gsi.de[:/]computing/cbmroot |
cut
-f1
|
uniq
)
if
[
-z
$UPSTREAM
]
;
then
echo
"Error: Name of upstream repository not provided and not found by automatic means"
echo
'Please provide if by checking your remotes with "git remote -v" and exporting UPSTREAM'
echo
"or passing as an argument"
exit
-1
fi
fi
fi
echo
"Upstream name is :"
$UPSTREAM
BASE_COMMIT
=
$UPSTREAM
/master
CHANGED_FILES
=
$(
git diff
--name-only
$BASE_COMMIT
)
for
file
in
$CHANGED_FILES
;
do
result
=
$(
file
$file
|
grep
CRLF
)
if
[[
"
$result
"
!=
""
]]
;
then
echo
""
echo
"File
$file
has wrong file format"
echo
"
$result
"
echo
""
okay
=
false
fi
done
if
[[
"
$okay
"
=
"false"
]]
;
then
echo
""
echo
"Not all files have the correct file format"
echo
"Test failed"
exit
1
else
exit
0
fi
Loading