Skip to content

Commit 70732ff

Browse files
committed
👍 Merge branch 'devel' ; 🔖 Version bump to 1.10.0 🎂
First anniversary release 🎂 This release marks the first anniversary and 10th release of git-repo 🎉 Now git-repo supports 6 git services: github, gitlab, bitbucket, gogs, gitea and gitbucket It supports the following commands: clone, fork, create, delete, add, open, ls, request, gist And it's becoming relatively stable (keep sending bug reports 🙏) ♥ Contributors Thanks to @kounoike for the gitbucket support 🙌 Now there are three contributors promoted to collaborators: * @kounoike, @pyhedgehog and @Crazybus 🚧 Features * When add has no parameters, add default remote #100 #141 * When add has 'upstream' parameter, add the upstream remote #99 #141 * Use default branch instead of hardcoded 'master' #91 * Refactor and complete bitbucket support #43 #11 #80 #14 #89 #90 #79 * Loosen versions of dependencies #133 * Report if the service is already setup #136 * Adds GitBucket support #142 #144 * Adds support for ssh:// URL #148 🚒 Bugfixes * fix various crashes #152 * fix gitlab clone crash #129 * fix request create command #147 #127 * fix request fetch command #138 #131 * fix wizard crash #149 * fix mishandling of renamed gitlab project urls #137 📝 Documentation * documentation #145 Signed-off-by: Guyzmo <[email protected]>
2 parents ea4fc21 + 825dd89 commit 70732ff

File tree

106 files changed

+8570
-849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+8570
-849
lines changed

.gitlab-ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
test:
2+
variables:
3+
TRAVIS_GH3: "1"
24
script:
35
- apt-get update -qy
4-
- apt-get install -y python-dev python-pip
5-
- pip install zc.buildout
6-
- buildout
7-
- bin/py.test
6+
- apt-get install -y python3-dev python3-pip virtualenv pandoc
7+
- virtualenv --python=python3 var
8+
- var/bin/pip3 install --upgrade pip
9+
- var/bin/pip3 install -r requirements-test.txt
10+
- var/bin/py.test --cov=git_repo --cov-report term-missing tests

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: python
22
# Don't use the Travis Container-Based Infrastructure
3-
sudo: true
3+
sudo: required
4+
dist: trusty
45
matrix:
56
include:
67
- os: linux
@@ -41,7 +42,6 @@ before_install: |
4142
# command to install dependencies
4243
install:
4344
- "pip install --upgrade pip" # upgrade to latest pip (needed on py3.4)
44-
- "pip install zc.buildout"
45-
- "buildout"
45+
- "pip install -r requirements-test.txt"
4646
# command to run tests
47-
script: "bin/py.test"
47+
script: "py.test --cov=git_repo --cov-report term-missing tests"

README.md

Lines changed: 103 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@
55
* https://gitlab.com/guyzmo/git-repo
66
* https://bitbucket.org/guyzmo/git-repo
77
* Issues: https://github.com/guyzmo/git-repo/issues
8-
* Chat on IRC: [#git-repo @freenode](irc://irc.freenode.org/git-repo)
8+
* Meet the community, come chat:
9+
* on IRC: [#git-repo @freenode](https://webchat.freenode.net/?channels=#git-repo)
10+
* on Matrix: [#git-repo:matrix.org](https://riot.im/app/#/room/#git-repo:matrix.org)
11+
* on Gitter: [git-services/git-repo](https://gitter.im/git-services/git-repo)
912
* [![Issues in Ready](https://badge.waffle.io/guyzmo/git-repo.png?label=ready&title=Ready)](https://waffle.io/guyzmo/git-repo) [![Issues in Progress](https://badge.waffle.io/guyzmo/git-repo.png?label=in%20progress&title=Progress)](https://waffle.io/guyzmo/git-repo) [![Show Travis Build Status](https://travis-ci.org/guyzmo/git-repo.svg)](https://travis-ci.org/guyzmo/git-repo)
1013
* [![Pypi Version](https://img.shields.io/pypi/v/git-repo.svg) ![Pypi Downloads](https://img.shields.io/pypi/dm/git-repo.svg)](https://pypi.python.org/pypi/git-repo)
1114

1215
### Usage
1316

14-
### main commands
17+
#### main commands
1518

1619
Control your remote git hosting services from the `git` commandline. The usage is
17-
very simple. To clone a new project, out of GitHub, just issue:
20+
very simple (full usage list [in the sources][1]). To clone a new project, out of GitHub, just issue:
21+
22+
[1]:https://github.com/guyzmo/git-repo/blob/devel/git_repo/repo.py#L4,L35
1823

1924
% git hub clone guyzmo/git-repo
2025

@@ -25,7 +30,7 @@ But that works also with a project from GitLab, Bitbucket, your own GitLab or Go
2530
% git myprecious clone guyzmo/git-repo
2631
% git gg clone guyzmo/git-repo
2732

28-
If you want to can choose the default branch to clone:
33+
If you want to choose the default branch to clone:
2934

3035
% git lab clone guyzmo/git-repo master
3136

@@ -57,7 +62,7 @@ Also, you can open the repository's page, using the `open` command:
5762
% git lab open guyzmo/git-repo
5863
Successfully fetched branch `2` of `guyzmo/git-repo` into `request-2`!
5964

60-
### Requests for merges *(aka Pull Requests aka Merge Requests)*
65+
#### Requests for merges *(aka Pull Requests aka Merge Requests)*
6166

6267
Once you're all set with your repository, you can check requests to merge
6368
(aka Pull Requests on github) using the `request` command:
@@ -71,11 +76,26 @@ And fetch it locally to check and/or amend it before merging:
7176

7277
% git hub request guyzmo/git-repo fetch 2
7378

74-
Or you can create a pull-request by doing a:
79+
Or you can create a request by doing a:
80+
81+
% git hub request create guyzmo/git-repo myfeature master -t 'My neat feature' -m 'So much to say about that feature…'
82+
83+
You can create the request also by simply calling:
84+
85+
% git hub request create
86+
87+
That command has a bit of automagic, it will:
7588

76-
% git hub request create guyzmo/git-repo myfeature master 'My neat feature' -m 'So much to say about that feature…'
89+
1. lookup the namespace and project of the current branch (or at least on the `github`
90+
remote, if called with `hub`), and take this as the source of the request ;
91+
2. for the target of the request it will lookup and take:
92+
* the parent if current project has a parent
93+
* or itself, if does not ;
94+
3. it will take the currently loaded branch for the source
95+
4. and the default one for the target
96+
5. call the service to ask for a request to merge from source onto target.
7797

78-
### Gists or snippets
98+
#### Gists or snippets
7999

80100
Finally, another extra feature you can play with is the gist handling:
81101

@@ -114,10 +134,63 @@ And when you're done you just get rid of it:
114134
> have access to the tool using `git-repo hub …` or `git repo hub …`. For the
115135
> `git hub …` call, you have to set up aliases, see below how to configure that.
116136
137+
#### Remotes
138+
139+
Traditionally, `origin` is being used as the remote name for the code hosted on a
140+
service, but because of the nature of `git-repo` there is no single `origin` but
141+
it encourages to use multiple ones, and also leave you in control of wherever
142+
`origin` points to.
143+
144+
This is why when you clone from a service or create a new repo on a service,
145+
it's using a special remote that carries the name of the service:
146+
147+
% git hub clone foo/bar; cd bar
148+
% git status -sb | head -1
149+
## master...github/master
150+
^^^^^^
151+
% git lab create bar
152+
% git push gitlab master
153+
117154
And as a bonus, each time it's adding a new remote, it's updating the `all` remote,
118155
so that you can push your code to all your remote repositories in one command:
119156

120157
% git push all master
158+
159+
Another special remote is the `upstream`. When you do a fork of a project, current
160+
special remote with a service name will be renamed as `upstream` and the newly
161+
forked project is now the one with the service name:
162+
163+
% git lab clone foo/bar; cd bar
164+
% git remote
165+
all
166+
gitlab
167+
% git lab fork
168+
% git remote
169+
all
170+
gitlab
171+
upstream
172+
173+
Finally, if you want to link other existing projects, you can, the `add` command
174+
is there for that:
175+
176+
% git bb add foo/bar
177+
% # if the name is identical to current project, you don't need to add a name
178+
% git hub add
179+
% git gg add foo/bar gitea --alone
180+
181+
Use the `--alone` switch if you don't want to add that project in the `all`
182+
special remote.
183+
184+
And of course the above commands is just sugar around regular git commands,
185+
so the above can also be done with:
186+
187+
% git remote add gitbucket https://gitbucket.local:8080/foo/bar
188+
% # the command to append the URL to the all remote, --alone skips this step
189+
% git remote set-url --add all https://gitbucket.local:8080/foo/bar
190+
191+
And to remove a remote, just do:
192+
193+
% git remote remove github
121194

122195
### Installation
123196

@@ -150,7 +223,8 @@ section in the gitconfig:
150223
token = YourOtherVerySecretKey
151224

152225
[gitrepo "bitbucket"]
153-
token = username:password
226+
username = ford.prefect
227+
token = YourOtherSecretKey
154228

155229
[gitrepo "gogs"]
156230
fqdn = UrlOfYourGogs
@@ -165,7 +239,8 @@ You also have the ability to set up an alias:
165239

166240
[gitrepo "bitbucket"]
167241
alias = bit
168-
token = username:password
242+
username = ford.prefect
243+
token = YourOtherSecretKey
169244

170245
that will change the command you use for a name you'll prefer to handle actions
171246
for the service you use:
@@ -209,16 +284,20 @@ if you want to use another path, you can change the defaults:
209284

210285
### Development
211286

212-
For development, I like to use `buildout`, and the repository is already configured
213-
for that. All you have to do, is install buildout, and then call it from the root of
214-
the repository:
287+
For development, start a virtualenv and from within install the devel requirements:
215288

216-
% pip install zc.buildout
217-
% buildout
289+
% virtualenv var
290+
% var/bin/pip install -r requirements-test.txt
218291

219292
and then you'll have the executable in `bin`:
220293

221-
% bin/git-repo --help
294+
% var/bin/git-repo --help
295+
296+
and to run the tests:
297+
298+
% var/bin/py.test --cov=git_repo --cov-report term-missing --capture=sys tests
299+
300+
N.B.: *Buildout is no longer supported for development*
222301

223302
#### Verbose running
224303

@@ -274,20 +353,15 @@ To use your own credentials, you can setup the following environment variables:
274353
* [x] add regression tests (and actually find a smart way to implement them…)
275354
* [x] add travis build
276355
* [x] show a nice progress bar, while it's fetching (cf [#15](https://github.com/guyzmo/git-repo/issues/15))
356+
* [x] add support for handling gists (cf [#12](https://github.com/guyzmo/git-repo/issues/12), cf [#13](https://github.com/guyzmo/git-repo/issues/13))
357+
* [x] add support for handling pull requests (cf [#10](https://github.com/guyzmo/git-repo/issues/10), [#11](https://github.com/guyzmo/git-repo/issues/11))
358+
* [x] add application token support for bitbucket (cf [#14](https://github.com/guyzmo/git-repo/issues/14))
277359
* [x] add support for gogs (cf [#18](https://github.com/guyzmo/git-repo/issues/18))
278-
* [ ] add support for handling gists
279-
* [x] github support
280-
* [x] gitlab support (cf [#12](https://github.com/guyzmo/git-repo/issues/12))
281-
* [ ] bitbucket support (cf [#13](https://github.com/guyzmo/git-repo/issues/13))
282-
* [ ] add support for handling pull requests
283-
* [x] github support
284-
* [x] gitlab support (cf [#10](https://github.com/guyzmo/git-repo/issues/10))
285-
* [ ] bitbucket support (cf [#11](https://github.com/guyzmo/git-repo/issues/11))
286-
* [ ] add application token support for bitbucket (cf [#14](https://github.com/guyzmo/git-repo/issues/14))
360+
* [x] add support for gitbucket (cf [#142](https://github.com/guyzmo/git-repo/issues/142))
287361
* [ ] add support for managing SSH keys (cf [#22](https://github.com/guyzmo/git-repo/issues/22))
288-
* [ ] add support for issues?
362+
* [ ] add support for issues (cf [#104](https://github.com/guyzmo/git-repo/issues/104))
289363
* [ ] add support for gerrit (cf [#19](https://github.com/guyzmo/git-repo/issues/19))
290-
* [ ] do what's needed to make a nice documentation — if possible in markdown !@#$
364+
* [ ] do what's needed to make a nice documentation [#146](https://github.com/guyzmo/git-repo/issues/146)
291365
* for more features, write an issue or, even better, a PR!
292366

293367
# Contributors
@@ -304,6 +378,8 @@ With code contributions coming from:
304378
* [@peterazmanov](https://github.com/peterazmanov)[commits](https://github.com/guyzmo/git-repo/commits?author=peterazmanov)
305379
* [@Crazybus](https://github.com/Crazybus)[commits](https://github.com/guyzmo/git-repo/commits?author=Crazybus)
306380
* [@rnestler](https://github.com/rnestler)[commits](https://github.com/guyzmo/git-repo/commits/devel?author=rnestler)
381+
* [@jayvdb](https://github.com/jayvdb)[commits](https://github.com/guyzmo/git-repo/commits/devel?author=jayvdb)
382+
* [@kounoike](https://github.com/kounoike)[commits](https://github.com/guyzmo/git-repo/commits/devel?author=kounoike)
307383

308384
### License
309385

buildout.cfg

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)