summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2016-04-06 10:46:51 +0200
committerThibault Saunier <tsaunier@gnome.org>2016-04-06 12:18:18 +0200
commit629b3d800b2ab634180e4ca69f3dbdb9105716c8 (patch)
tree7891b01be0cab26f1c4e2fe5569e1b4a2da9c118
parent4077ec07b2d7dc0b28c6ffde3c7dc5d897c77e83 (diff)
Add a setup.py file so user can install with pip1.0.01.0
And fix the README markdown so it can be used by setuptools Differential Revision: https://phabricator.freedesktop.org/D891
-rw-r--r--MANIFEST.in1
-rw-r--r--README.md (renamed from README)38
-rw-r--r--setup.cfg2
-rw-r--r--setup.py23
4 files changed, 62 insertions, 2 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..bb3ec5f
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1 @@
+include README.md
diff --git a/README b/README.md
index a39311b..60c5177 100644
--- a/README
+++ b/README.md
@@ -1,16 +1,28 @@
INSTALL
=======
-Copy or symlink executables into your $PATH.
- $ ln -s $PWD/git-phab ~/.local/bin/
+```
+ $ pip3 install git-phab
+ $ pip3 install --upgrade git-phab
+ $ pip3 uninstall git-phab
+```
Optionaly generate and copy or symlink manpage into your $MANPATH
+
+```
$ a2x --doctype manpage --format manpage git-phab.txt
$ ln -s $PWD/git-phab.1 ~/.local/share/man/man1/
+```
Optionaly enable bash completion:
+
+```
$ sudo activate-global-python-argcomplete3
+```
+
And add this in your ~/.bash_completion:
+
+```
function _git_phab()
{
COMP_WORDS=(git-phab ${COMP_WORDS[@]:2})
@@ -18,6 +30,7 @@ And add this in your ~/.bash_completion:
COMP_LINE=${COMP_LINE/git phab/git-phab}
_python_argcomplete_global git-phab
}
+```
REQUIREMENTS
============
@@ -36,12 +49,19 @@ WORKFLOW EXAMPLE
================
First, configure where to push WIP branches:
+
+```
$ git config phab.remote xclaesse
+```
Before starting your work, create a branch:
+
+```
$ git checkout -b fix-bugs origin/master
Branch fix-bugs set up to track remote branch master from origin.
Switched to a new branch 'fix-bugs'
+```
+
Note that is it important to set the tracking remote branch, git-phab will use
it to set the default commit range to attach.
@@ -49,6 +69,8 @@ Now fix your bugs...
When the branch is ready for review, attach it (requesting the creation of a
new task):
+
+```
$ git phab attach --task
Using revision range 'origin/master..'
a3beba9 — Not attached — Truncate all_commits when filtering already proposed commits
@@ -62,26 +84,38 @@ new task):
New: 66b48b9 — D483 — Truncate all_commits when filtering already proposed commits
Branch pushed to xclaesse/wip/phab/T3436-fix-bugs
Branch T3436-fix-bugs created and checked out
+```
+
Note that the current branch name wasn't starting with a task ID, so it proposed
to create a new one. If you already had a task for it, just pass `--task`
option. But it created a new branch prefixed with the task ID so future git-phab
commands will know which task this branch refers to:
+
+```
$ git branch
* T3436-fix-bugs
fix-bugs
master
+```
When your commits have been accepted, merge them:
+
+
+```
$ git checkout master
$ git merge T3436-fix-bugs
$ git phab land
66b48b9 — D483 Accepted — Truncate all_commits when filtering already proposed commits
Do you want to push above commits? [yn] y
Do you want to close 'T3436'? [yn] y
+```
You can now cleanup your branches:
+
+```
$ git phab clean
Task 'T3436' has been closed, do you want to delete branch 'T3436-fix-bugs'? [yn] y
-> Branch T3436-fix-bugs was deleted
Task 'T3436' has been closed, do you want to delete branch 'xclaesse/wip/phab/T3436-fix-a-bug'? [yn] y
-> Branch xclaesse/wip/phab/T3436-fix-a-bug was deleted
+```
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..b88034e
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,2 @@
+[metadata]
+description-file = README.md
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..6616010
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,23 @@
+import os
+
+from setuptools import setup
+
+
+setup(
+ name="git-phab",
+ version="1.0",
+ author="Xavier Claessens",
+ author_email="xavier.claessens@collabora.com",
+ description=("Git subcommand to integrate with phabricator"),
+ license="GPL",
+ keywords="phabricator tool git",
+ url="http://packages.python.org/git-phab",
+ long_description_markdown_filename='README.md',
+ setup_requires=['setuptools-markdown'],
+ classifiers=[
+ "Topic :: Utilities",
+ "License :: OSI Approved :: GNU General Public License (GPL)"
+ ],
+ install_requires=['GitPython', 'appdirs', 'argcomplete'],
+ scripts=['git-phab'],
+)