Skip to content

Commit

Permalink
👍 Merge branch 'devel' ; 🔖 Version bump to 1.10.0 🎂
Browse files Browse the repository at this point in the history
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:https:// 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]>
  • Loading branch information
guyzmo committed May 8, 2017
2 parents ea4fc21 + 825dd89 commit 70732ff
Show file tree
Hide file tree
Showing 106 changed files with 8,570 additions and 849 deletions.
11 changes: 7 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
test:
variables:
TRAVIS_GH3: "1"
script:
- apt-get update -qy
- apt-get install -y python-dev python-pip
- pip install zc.buildout
- buildout
- bin/py.test
- apt-get install -y python3-dev python3-pip virtualenv pandoc
- virtualenv --python=python3 var
- var/bin/pip3 install --upgrade pip
- var/bin/pip3 install -r requirements-test.txt
- var/bin/py.test --cov=git_repo --cov-report term-missing tests
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: python
# Don't use the Travis Container-Based Infrastructure
sudo: true
sudo: required
dist: trusty
matrix:
include:
- os: linux
Expand Down Expand Up @@ -41,7 +42,6 @@ before_install: |
# command to install dependencies
install:
- "pip install --upgrade pip" # upgrade to latest pip (needed on py3.4)
- "pip install zc.buildout"
- "buildout"
- "pip install -r requirements-test.txt"
# command to run tests
script: "bin/py.test"
script: "py.test --cov=git_repo --cov-report term-missing tests"
130 changes: 103 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
* https://gitlab.com/guyzmo/git-repo
* https://bitbucket.org/guyzmo/git-repo
* Issues: https://github.com/guyzmo/git-repo/issues
* Chat on IRC: [#git-repo @freenode](irc:https://irc.freenode.org/git-repo)
* Meet the community, come chat:
* on IRC: [#git-repo @freenode](https://webchat.freenode.net/?channels=#git-repo)
* on Matrix: [#git-repo:matrix.org](https://riot.im/app/#/room/#git-repo:matrix.org)
* on Gitter: [git-services/git-repo](https://gitter.im/git-services/git-repo)
* [![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)
* [![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)

### Usage

### main commands
#### main commands

Control your remote git hosting services from the `git` commandline. The usage is
very simple. To clone a new project, out of GitHub, just issue:
very simple (full usage list [in the sources][1]). To clone a new project, out of GitHub, just issue:

[1]:https://github.com/guyzmo/git-repo/blob/devel/git_repo/repo.py#L4,L35

% git hub clone guyzmo/git-repo

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

If you want to can choose the default branch to clone:
If you want to choose the default branch to clone:

% git lab clone guyzmo/git-repo master

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

### Requests for merges *(aka Pull Requests aka Merge Requests)*
#### Requests for merges *(aka Pull Requests aka Merge Requests)*

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

% git hub request guyzmo/git-repo fetch 2

Or you can create a pull-request by doing a:
Or you can create a request by doing a:

% git hub request create guyzmo/git-repo myfeature master -t 'My neat feature' -m 'So much to say about that feature…'

You can create the request also by simply calling:

% git hub request create

That command has a bit of automagic, it will:

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

### Gists or snippets
#### Gists or snippets

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

Expand Down Expand Up @@ -114,10 +134,63 @@ And when you're done you just get rid of it:
> have access to the tool using `git-repo hub …` or `git repo hub …`. For the
> `git hub …` call, you have to set up aliases, see below how to configure that.
#### Remotes

Traditionally, `origin` is being used as the remote name for the code hosted on a
service, but because of the nature of `git-repo` there is no single `origin` but
it encourages to use multiple ones, and also leave you in control of wherever
`origin` points to.

This is why when you clone from a service or create a new repo on a service,
it's using a special remote that carries the name of the service:

% git hub clone foo/bar; cd bar
% git status -sb | head -1
## master...github/master
^^^^^^
% git lab create bar
% git push gitlab master

And as a bonus, each time it's adding a new remote, it's updating the `all` remote,
so that you can push your code to all your remote repositories in one command:

% git push all master

Another special remote is the `upstream`. When you do a fork of a project, current
special remote with a service name will be renamed as `upstream` and the newly
forked project is now the one with the service name:

% git lab clone foo/bar; cd bar
% git remote
all
gitlab
% git lab fork
% git remote
all
gitlab
upstream

Finally, if you want to link other existing projects, you can, the `add` command
is there for that:

% git bb add foo/bar
% # if the name is identical to current project, you don't need to add a name
% git hub add
% git gg add foo/bar gitea --alone

Use the `--alone` switch if you don't want to add that project in the `all`
special remote.

And of course the above commands is just sugar around regular git commands,
so the above can also be done with:

% git remote add gitbucket https://gitbucket.local:8080/foo/bar
% # the command to append the URL to the all remote, --alone skips this step
% git remote set-url --add all https://gitbucket.local:8080/foo/bar

And to remove a remote, just do:

% git remote remove github

### Installation

Expand Down Expand Up @@ -150,7 +223,8 @@ section in the gitconfig:
token = YourOtherVerySecretKey

[gitrepo "bitbucket"]
token = username:password
username = ford.prefect
token = YourOtherSecretKey

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

[gitrepo "bitbucket"]
alias = bit
token = username:password
username = ford.prefect
token = YourOtherSecretKey

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

### Development

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

% pip install zc.buildout
% buildout
% virtualenv var
% var/bin/pip install -r requirements-test.txt

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

% bin/git-repo --help
% var/bin/git-repo --help

and to run the tests:

% var/bin/py.test --cov=git_repo --cov-report term-missing --capture=sys tests

N.B.: *Buildout is no longer supported for development*

#### Verbose running

Expand Down Expand Up @@ -274,20 +353,15 @@ To use your own credentials, you can setup the following environment variables:
* [x] add regression tests (and actually find a smart way to implement them…)
* [x] add travis build
* [x] show a nice progress bar, while it's fetching (cf [#15](https://github.com/guyzmo/git-repo/issues/15))
* [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))
* [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))
* [x] add application token support for bitbucket (cf [#14](https://github.com/guyzmo/git-repo/issues/14))
* [x] add support for gogs (cf [#18](https://github.com/guyzmo/git-repo/issues/18))
* [ ] add support for handling gists
* [x] github support
* [x] gitlab support (cf [#12](https://github.com/guyzmo/git-repo/issues/12))
* [ ] bitbucket support (cf [#13](https://github.com/guyzmo/git-repo/issues/13))
* [ ] add support for handling pull requests
* [x] github support
* [x] gitlab support (cf [#10](https://github.com/guyzmo/git-repo/issues/10))
* [ ] bitbucket support (cf [#11](https://github.com/guyzmo/git-repo/issues/11))
* [ ] add application token support for bitbucket (cf [#14](https://github.com/guyzmo/git-repo/issues/14))
* [x] add support for gitbucket (cf [#142](https://github.com/guyzmo/git-repo/issues/142))
* [ ] add support for managing SSH keys (cf [#22](https://github.com/guyzmo/git-repo/issues/22))
* [ ] add support for issues?
* [ ] add support for issues (cf [#104](https://github.com/guyzmo/git-repo/issues/104))
* [ ] add support for gerrit (cf [#19](https://github.com/guyzmo/git-repo/issues/19))
* [ ] do what's needed to make a nice documentation — if possible in markdown !@#$
* [ ] do what's needed to make a nice documentation [#146](https://github.com/guyzmo/git-repo/issues/146)
* for more features, write an issue or, even better, a PR!

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

### License

Expand Down
35 changes: 0 additions & 35 deletions buildout.cfg

This file was deleted.

Loading

0 comments on commit 70732ff

Please sign in to comment.