gitlab-branch-rename 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -3
- data/Gemfile.lock +1 -18
- data/Makefile +2 -6
- data/README.md +41 -21
- data/gitlab-branch-rename.gemspec +2 -4
- data/lib/gitlab_branch_rename/configuration.rb +5 -0
- data/lib/gitlab_branch_rename/version.rb +1 -1
- metadata +1 -5
- data/.rspec +0 -3
- data/.travis.yml +0 -6
- data/Rakefile +0 -6
- data/bin/setup +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d02aa63f9aa10433d20701e09795bc748f4b642ffe628c9ea5bfbc962939e85f
|
4
|
+
data.tar.gz: 5c5b106cd879f3a7f676b6013e6be7dfa2c8005951b75e34f6d09ba52e64462e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 626949e870d91827b5901ff5e62ffbe1a93e7972a00918425feba2960b61893ce6b15d0861da45db2e1ba61d7f30b821d51b97b4d908aaf2e703732d07b99a0c
|
7
|
+
data.tar.gz: dea4861e80089beb216cf3295d16d61ca3e5e8e5f5f380f4d28ca22514d052d1d3d2b07afbfefe7411fbcd16a8845ea3e04f348c62db5733ae300084f9e99578
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab-branch-rename (0.
|
4
|
+
gitlab-branch-rename (0.3.0)
|
5
5
|
gitlab (~> 4.16)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
diff-lcs (1.4.4)
|
11
10
|
gitlab (4.16.1)
|
12
11
|
httparty (~> 0.14, >= 0.14.0)
|
13
12
|
terminal-table (~> 1.5, >= 1.5.1)
|
@@ -18,20 +17,6 @@ GEM
|
|
18
17
|
mime-types-data (~> 3.2015)
|
19
18
|
mime-types-data (3.2020.0512)
|
20
19
|
multi_xml (0.6.0)
|
21
|
-
rake (12.3.3)
|
22
|
-
rspec (3.9.0)
|
23
|
-
rspec-core (~> 3.9.0)
|
24
|
-
rspec-expectations (~> 3.9.0)
|
25
|
-
rspec-mocks (~> 3.9.0)
|
26
|
-
rspec-core (3.9.2)
|
27
|
-
rspec-support (~> 3.9.3)
|
28
|
-
rspec-expectations (3.9.2)
|
29
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.9.0)
|
31
|
-
rspec-mocks (3.9.1)
|
32
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
-
rspec-support (~> 3.9.0)
|
34
|
-
rspec-support (3.9.3)
|
35
20
|
terminal-table (1.8.0)
|
36
21
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
37
22
|
unicode-display_width (1.7.0)
|
@@ -41,8 +26,6 @@ PLATFORMS
|
|
41
26
|
|
42
27
|
DEPENDENCIES
|
43
28
|
gitlab-branch-rename!
|
44
|
-
rake (~> 12.0)
|
45
|
-
rspec (~> 3.0)
|
46
29
|
|
47
30
|
RUBY VERSION
|
48
31
|
ruby 2.7.0p0
|
data/Makefile
CHANGED
@@ -1,16 +1,12 @@
|
|
1
|
-
all:
|
2
|
-
rake
|
3
|
-
|
4
1
|
build:
|
5
|
-
rake
|
6
2
|
gem build ./gitlab-branch-rename.gemspec
|
7
3
|
|
8
4
|
clean:
|
9
|
-
rm .rspec_status
|
10
5
|
rm gitlab-branch-rename-*.gem
|
11
6
|
|
12
7
|
install: build
|
13
8
|
gem install ./gitlab-branch-rename-*.gem
|
14
9
|
|
15
10
|
push: clean build
|
16
|
-
gem push gitlab-branch-rename-*.gem
|
11
|
+
gem push gitlab-branch-rename-*.gem
|
12
|
+
open https://rubygems.org/gems/gitlab-branch-rename
|
data/README.md
CHANGED
@@ -1,48 +1,68 @@
|
|
1
|
-
# Gitlab
|
1
|
+
# Gitlab Branch Rename
|
2
2
|
|
3
|
-
|
3
|
+
This is a simple tool to rename your Gitlab project branches en-mass.
|
4
4
|
|
5
|
-
|
5
|
+
## Motivation
|
6
6
|
|
7
|
-
|
7
|
+
To support Black Lives Matter and create safer spaces, I wanted to rename all of the default branches in my Gitlab
|
8
|
+
account. I wasn't able to find any tools to do that, so I wrote this one. If you're unsure why this is important or
|
9
|
+
want to better understand why I wanted to make these changes, see this great [Twitter thread].
|
8
10
|
|
9
|
-
|
11
|
+
## Installation
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
```
|
13
|
+
This gem is designed to be used from the command line and not currently incorporated into your own projects. If you
|
14
|
+
wish to do that, happy to help make that happen.
|
14
15
|
|
15
|
-
|
16
|
+
Install this with RVM:
|
16
17
|
|
17
|
-
$
|
18
|
+
$ rvm @global do gem install gitlab-branch-rename
|
18
19
|
|
19
|
-
|
20
|
+
or install to your system ruby installation:
|
20
21
|
|
21
|
-
$ gem install gitlab-branch-rename
|
22
|
+
$ sudo gem install gitlab-branch-rename
|
22
23
|
|
23
24
|
## Usage
|
24
25
|
|
25
|
-
|
26
|
+
```
|
27
|
+
Usage: gitlab-branch-rename --from <branch to rename> --to <new branch name> [options]
|
28
|
+
|
29
|
+
Specific options:
|
30
|
+
--from OLD_BRANCH Branch to rename
|
31
|
+
--to NEW_BRANCH New branch name
|
32
|
+
--endpoint ENDPOINT Gitlab server endpoint. default: Gitlab cloud
|
33
|
+
--token-env-var ENV_VAR_NAME Environment variable to pull token out of
|
34
|
+
--only-if-default Rename only if it is the default branch
|
35
|
+
--visibility VISIBILITIES Comma-separated list of project visibilities default: public,internal,private
|
36
|
+
--skip-confirm Skip confirmation before executing rename
|
37
|
+
--pretend Pretend to perform actions. Overrides confirm option
|
38
|
+
--logfile LOGFILE Logfile destination. Use - for STDOUT
|
39
|
+
```
|
26
40
|
|
27
41
|
## Development
|
28
42
|
|
29
|
-
|
43
|
+
To setup your development environment, run `bundle install` and `make` to run tests.
|
30
44
|
|
31
|
-
To
|
45
|
+
To release a new version, update the version number in `lib/gitlab_branch_rename/version.rb`, and then run `make push`.
|
32
46
|
|
33
47
|
During development, I used these references:
|
34
|
-
|
35
|
-
|
48
|
+
* https://docs.gitlab.com/ce/api/projects.html#edit-project
|
49
|
+
* https://www.rubydoc.info/gems/gitlab/Gitlab/Client/Projects
|
36
50
|
|
37
51
|
## Contributing
|
38
52
|
|
39
|
-
Bug reports and pull requests are welcome on
|
40
|
-
|
53
|
+
Bug reports and pull requests are welcome on [Gitlab]. This project is intended to be a safe, welcoming space for
|
54
|
+
collaboration, and contributors are expected to adhere to the [code of conduct].
|
41
55
|
|
42
56
|
## License
|
43
57
|
|
44
|
-
The gem is available as open source under the terms of the [MIT License]
|
58
|
+
The gem is available as open source under the terms of the [MIT License].
|
45
59
|
|
46
60
|
## Code of Conduct
|
47
61
|
|
48
|
-
Everyone interacting in the Gitlab::Branch::Rename project's codebases, issue trackers, chat rooms and mailing lists
|
62
|
+
Everyone interacting in the Gitlab::Branch::Rename project's codebases, issue trackers, chat rooms and mailing lists
|
63
|
+
is expected to follow the [code of conduct].
|
64
|
+
|
65
|
+
[code of conduct]: https://gitlab.com/apfritts/gitlab-branch-rename/blob/master/CODE_OF_CONDUCT.md
|
66
|
+
[Gitlab]: https://gitlab.com/apfritts/gitlab-branch-rename
|
67
|
+
[MIT License]: https://opensource.org/licenses/MIT
|
68
|
+
[Twitter thread]: https://twitter.com/mislav/status/1270388510684598272
|
@@ -23,11 +23,9 @@ Gem::Specification.new do |spec|
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
24
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
25
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
26
|
-
`git ls-files -z`.split("\x0")
|
26
|
+
`git ls-files -z`.split("\x0")
|
27
27
|
end
|
28
28
|
spec.bindir = "exe"
|
29
|
-
executables
|
30
|
-
puts executables
|
31
|
-
spec.executables = executables
|
29
|
+
spec.executables = "gitlab-branch-rename"
|
32
30
|
spec.require_paths = ["lib"]
|
33
31
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "optparse"
|
2
|
+
require "gitlab_branch_rename/version"
|
2
3
|
|
3
4
|
module GitlabBranchRename
|
4
5
|
class Configuration
|
@@ -61,6 +62,10 @@ module GitlabBranchRename
|
|
61
62
|
configuration.logfile = logfile
|
62
63
|
end
|
63
64
|
end
|
65
|
+
opts.on("--version", "Print version and exit") do
|
66
|
+
puts(GitlabBranchRename::VERSION)
|
67
|
+
exit 0
|
68
|
+
end
|
64
69
|
opts.separator ""
|
65
70
|
opts.separator "Visit https://gitlab.com/apfritts/gitlab-branch-rename for more details."
|
66
71
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-branch-rename
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AP Fritts
|
@@ -37,18 +37,14 @@ extensions: []
|
|
37
37
|
extra_rdoc_files: []
|
38
38
|
files:
|
39
39
|
- ".gitignore"
|
40
|
-
- ".rspec"
|
41
40
|
- ".ruby-version"
|
42
|
-
- ".travis.yml"
|
43
41
|
- CODE_OF_CONDUCT.md
|
44
42
|
- Gemfile
|
45
43
|
- Gemfile.lock
|
46
44
|
- LICENSE.txt
|
47
45
|
- Makefile
|
48
46
|
- README.md
|
49
|
-
- Rakefile
|
50
47
|
- bin/console
|
51
|
-
- bin/setup
|
52
48
|
- exe/gitlab-branch-rename
|
53
49
|
- gitlab-branch-rename.gemspec
|
54
50
|
- gitlab-branch-rename.gemspec.lock
|
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Rakefile
DELETED