Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
67f55d9b
Commit
67f55d9b
authored
Mar 12, 2015
by
Zeger-Jan van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let the server fix unconfigured git
parent
bacb05c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
10 deletions
+32
-10
CHANGELOG
CHANGELOG
+1
-0
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+15
-10
lib/tasks/gitlab/task_helpers.rake
lib/tasks/gitlab/task_helpers.rake
+16
-0
No files found.
CHANGELOG
View file @
67f55d9b
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.9.0 (unreleased)
v 7.9.0 (unreleased)
- Update documentation for object_kind field in Webhook push and tag push Webhooks (Stan Hu)
- Update documentation for object_kind field in Webhook push and tag push Webhooks (Stan Hu)
- Fix broken email images (Hannes Rosenögger)
- Fix broken email images (Hannes Rosenögger)
- Automaticly config git if user forgot, where possible
- Fix mass SQL statements on initial push (Hannes Rosenögger)
- Fix mass SQL statements on initial push (Hannes Rosenögger)
- Add tag push notifications and normalize HipChat and Slack messages to be consistent (Stan Hu)
- Add tag push notifications and normalize HipChat and Slack messages to be consistent (Stan Hu)
- Add comment notification events to HipChat and Slack services (Stan Hu)
- Add comment notification events to HipChat and Slack services (Stan Hu)
...
...
lib/tasks/gitlab/check.rake
View file @
67f55d9b
...
@@ -329,16 +329,20 @@ namespace :gitlab do
...
@@ -329,16 +329,20 @@ namespace :gitlab do
if
correct_options
.
all?
if
correct_options
.
all?
puts
"yes"
.
green
puts
"yes"
.
green
else
else
puts
"no"
.
red
print
"Trying to fix Git error automatically. ..."
try_fixing_it
(
if
auto_fix_git_config
(
options
)
sudo_gitlab
(
"
\"
#{
Gitlab
.
config
.
git
.
bin_path
}
\"
config --global user.name
\"
#{
options
[
"user.name"
]
}
\"
"
),
puts
"Success"
.
green
sudo_gitlab
(
"
\"
#{
Gitlab
.
config
.
git
.
bin_path
}
\"
config --global user.email
\"
#{
options
[
"user.email"
]
}
\"
"
),
else
sudo_gitlab
(
"
\"
#{
Gitlab
.
config
.
git
.
bin_path
}
\"
config --global core.autocrlf
\"
#{
options
[
"core.autocrlf"
]
}
\"
"
)
puts
"Failed"
.
red
)
try_fixing_it
(
for_more_information
(
sudo_gitlab
(
"
\"
#{
Gitlab
.
config
.
git
.
bin_path
}
\"
config --global user.name
\"
#{
options
[
"user.name"
]
}
\"
"
),
see_installation_guide_section
"GitLab"
sudo_gitlab
(
"
\"
#{
Gitlab
.
config
.
git
.
bin_path
}
\"
config --global user.email
\"
#{
options
[
"user.email"
]
}
\"
"
),
)
sudo_gitlab
(
"
\"
#{
Gitlab
.
config
.
git
.
bin_path
}
\"
config --global core.autocrlf
\"
#{
options
[
"core.autocrlf"
]
}
\"
"
)
fix_and_rerun
)
for_more_information
(
see_installation_guide_section
"GitLab"
)
end
end
end
end
end
end
end
...
@@ -806,3 +810,4 @@ namespace :gitlab do
...
@@ -806,3 +810,4 @@ namespace :gitlab do
end
end
end
end
end
end
lib/tasks/gitlab/task_helpers.rake
View file @
67f55d9b
...
@@ -112,4 +112,20 @@ namespace :gitlab do
...
@@ -112,4 +112,20 @@ namespace :gitlab do
@warned_user_not_gitlab
=
true
@warned_user_not_gitlab
=
true
end
end
end
end
# Tries to configure git itself
#
# Returns true if all subcommands were successfull (according to their exit code)
# Returns false if any or all subcommands failed.
def
auto_fix_git_config
(
options
)
if
!
@warned_user_not_gitlab
&&
options
[
'user.email'
]
!=
'example@example.com'
# default email should be overridden?
command_success
=
options
.
map
do
|
name
,
value
|
system
(
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
config --global
#{
name
}
#{
value
}
)
)
end
command_success
.
all?
else
false
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment