Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
42caddb2
Commit
42caddb2
authored
Mar 21, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new commands: push-branches and delete-remote-branches.
parent
9f482f8d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
1 deletion
+48
-1
CHANGELOG
CHANGELOG
+4
-0
VERSION
VERSION
+1
-1
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+43
-0
No files found.
CHANGELOG
View file @
42caddb2
v2.6.13
- Add push-branches command
- Add delete-remote-branches command
v2.6.12
v2.6.12
- Fix git-annex issue not working using custom SSH port repositories
- Fix git-annex issue not working using custom SSH port repositories
...
...
VERSION
View file @
42caddb2
2.6.1
2
2.6.1
3
lib/gitlab_projects.rb
View file @
42caddb2
...
@@ -61,6 +61,8 @@ class GitlabProjects
...
@@ -61,6 +61,8 @@ class GitlabProjects
when
'fork-project'
;
fork_project
when
'fork-project'
;
fork_project
when
'fetch-remote'
;
fetch_remote
when
'fetch-remote'
;
fetch_remote
when
'update-head'
;
update_head
when
'update-head'
;
update_head
when
'push-branches'
;
push_branches
when
'delete-remote-branches'
;
delete_remote_branches
when
'gc'
;
gc
when
'gc'
;
gc
else
else
$logger
.
warn
"Attempt to execute invalid gitlab-projects command
#{
@command
.
inspect
}
."
$logger
.
warn
"Attempt to execute invalid gitlab-projects command
#{
@command
.
inspect
}
."
...
@@ -71,6 +73,47 @@ class GitlabProjects
...
@@ -71,6 +73,47 @@ class GitlabProjects
protected
protected
def
push_branches
remote_name
=
ARGV
.
shift
$logger
.
info
"Pushing branches from
#{
full_path
}
to remote
#{
remote_name
}
:
#{
ARGV
}
"
cmd
=
%W(git --git-dir=
#{
full_path
}
push --tags --
#{
remote_name
}
)
.
concat
(
ARGV
)
pid
=
Process
.
spawn
(
*
cmd
)
begin
Process
.
wait
(
pid
)
$?
.
exitstatus
.
zero?
rescue
=>
exception
$logger
.
error
"Pushing branches to remote
#{
remote_name
}
failed due to:
#{
exception
.
message
}
"
Process
.
kill
(
'KILL'
,
pid
)
Process
.
wait
false
end
end
def
delete_remote_branches
remote_name
=
ARGV
.
shift
branches
=
ARGV
.
map
{
|
branch_name
|
":
#{
branch_name
}
"
}
$logger
.
info
"Pushing deleted branches from
#{
full_path
}
to remote
#{
remote_name
}
:
#{
ARGV
}
"
cmd
=
%W(git --git-dir=
#{
full_path
}
push --
#{
remote_name
}
)
.
concat
(
branches
)
pid
=
Process
.
spawn
(
*
cmd
)
begin
Process
.
wait
(
pid
)
$?
.
exitstatus
.
zero?
rescue
=>
exception
$logger
.
error
"Pushing deleted branches to remote
#{
remote_name
}
failed due to:
#{
exception
.
message
}
"
Process
.
kill
(
'KILL'
,
pid
)
Process
.
wait
false
end
end
def
create_branch
def
create_branch
branch_name
=
ARGV
.
shift
branch_name
=
ARGV
.
shift
ref
=
ARGV
.
shift
||
"HEAD"
ref
=
ARGV
.
shift
||
"HEAD"
...
...
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