Document git-review specific options
in the Git configuration system.
Currently we have only gitreview.username,
but another one (gitreview.rebase) is
pending in change I96dfab1af48d8f1592766fea4b97e0f35c03d8a5.
Change-Id: I5b34effee355e0075fa3c2c2acea4429198d7e85
- Call "git-rev-parse" only once, not twice
- In case where current directory is unreadable,
the current message is:
No '.gitreview' file found in this repository.
We don't know where your gerrit is. Please manually create
a remote named gerrit and try again.
(which is not true, because .gitreview *is* present)
After this change it fails a bit better:
Cannot determine where .git directory is
The following command failed with exit code 128
"git rev-parse --show-toplevel --git-dir"
-----------------------
fatal: Unable to read current working directory: No such
file or directory
-----------------------
Change-Id: Idbb1e68b689f226d9434db131db5d9765752a315
The assert_one_change code checks your changes against the set of changes in
the branch that you're submitting to. It's not necessary to have the absolute
latest changes to do the safety check ... the worst that will happen is that
you'll be prompted about a patch that's already merged.
However, if you run without -R, you'll get the update fetched anyway.
If you run _WITH_ -R, then we're doing a network access that you don't need
anyway.
Change-Id: I466aa81a521f784d9afc1dbae914c68a33ff79f5
Option -d already makes it possible to get a change into a separate
branch, but for large projects and trivial changes, it makes sense to
also be able to just cherry-pick the change to the currently active
local branch.
Also add modes that invokes "git cherry-pick -n" or "git cherry-pick
-x". Program exits with exit code 69 whenever "git cherry-pick" fails.
This feature was subsequently amended by Marcin Cieślak
<saper@saper.info>.
Change-Id: I0a30052fb2baf357ed81e3f1ef4618bf786cb7ee
Sometimes Gerrit might not return owner name
due to some internal misconfiguration or database
problem. Since we are using owner name here to
generate the name of a local git branch, instead
of failing here we should try to just go ahead
with 'unknown'.
More information about this error:
https://bugzilla.wikimedia.org/show_bug.cgi?id=40061#c5https://gerrit.wikimedia.org/r/#/c/37771/
Change-Id: Icaa9baa453e3fd7d54adf9138a9435e4271cee0a
When setting up git-review, it tries to acquire a topic name although
that is of no use to setup. A side effect is that git-review can not be
setup whenever the git remote is a fresh repository since it get no
branch. Solve this by moving it after the setup routines.
Inform the user why the particular topic name has been selected.
Change-Id: Iaa942b8dc77b0c3f720085358c38e8295138025a
Fixes bug 1092943.
* git-review(download_review): Earlier refactoring in commit 4511318
resulted in checking the wrong output for existing branch errors,
since it moved into the exception data. Fixed in this commit.
Change-Id: I761b01c70ab93e77b112ddf85c63a829d5334196
Don't check for status of finish_remote()
since an exception will be returned.
Remove else: blocks and use return to
make logic a bit more readable with
less intendation.
Change-Id: I83172dfeb786adc3e925116c39e7ffdc616de893
Add exceptions to errors that might
happend when listing open changes
for review.
Use exit codes 32 and 33 for exceptions.
Change-Id: I8a94fd0e13bbf1dbc9f01ca03a319628ca497d81
Add exceptions to errors that might
happend when closing a branch.
Allocate exit codes 67,68 for
for errors related to removing
the branch.
Change-Id: I9ba37ca5a69ded1421845a8d1a40bd6be22addca
Add exceptions to errors that might
happend when fetching a change
for review.
Handle non-existing changeset number
better (don't fail on KeyError).
Better error message when the change
number is correct, but cannot be
fetched into the current project.
Allocate exit codes 34,35,36,37 and
64,65 for errors related to patchset
download.
Change-Id: I8bb7dd9418dc9488ff80b572a4494afa39472128
32..63 - remote communication with gerrit/git repository
>64 - problems with local git repository
[reintroduction of previously reverted 78b6ace]
Change-Id: I0dbd87fd7566ff7c659bc1066643f347801daaa3
GitReviewException:
Handle also exceptions that are
not related to the failed external
commands at toplevel.
ChangeSetException:
For exceptions not related to the
execution of the external command;
such an exception is associated
with a change set identifier.
[reintroduction of previously re-re-reverted b744111]
Change-Id: I8b850ba0b611b452acbacb21393f86858e72099a
This should fix the error I get when trying to update from git-review 1.19:
alex@alex:/var/www/MediaWiki/Git/core$ sudo pip install -U git-review
[sudo] password for alex:
Downloading/unpacking git-review from http://pypi.python.org/packages/source/g/git-review/git-review-1.20.tar.gz#md5=d8446f99fd4ef2cc8090bef2c9eac294
Downloading git-review-1.20.tar.gz
Running setup.py egg_info for package git-review
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build/git-review/setup.py", line 25, in <module>
exec(open("git-review").read())
File "<string>", line 864
except CommandFailed, e:
^
SyntaxError: invalid syntax
[...]
Change-Id: I1aa43f7bb14bbf68c3a63f2225fb91d1ad53124b
* setup.py: This works around bug 1073766, what appears to be an
upstream installer issue exposed by e7b8dc61. When attempting to
idempotently create the full destination path, it will fail cryptically
on any existing symlink it finds (expecting only real directories).
Change-Id: I1e502b86854fd6ac57974b579af48cd75d3e7752
GitReviewException:
Handle also exceptions that are
not related to the failed external
commands at toplevel.
ChangeSetException:
For exceptions not related to the
execution of the external command;
such an exception is associated
with a change set identifier.
Change-Id: I8d165d1dfee5ec4e61487565e90b033fb6f58acf
When asking for a list of review, the decimal change number can have a
vary length which could cause the list to not be properly aligned.
This patch keeps track of the widths of particular fields,
applies color control characters and crafs a format string.
Change# and branch are right justified, commit entry is
left justified.
Change-Id: I2d9114ed76a40cd029e96b69f5e1c2df9ff430f9
as shown by `groff -mdoc git-review.1`
* avoid warnings about empty input lines
* avoid warnings about .Bd not having a matching .Ed
Change-Id: Iba775f72f2ac7c6f694d2b89165fed27984641f3
- #!/usr/bin/python -> #!/usr/bin/env python
BSD OS use /usr/local/bin/python
- Man pages location is OS specific.
For example, this is /usr/local/man on FreeBSD
or /usr/share/man on Debian.
I checked several Python projects like Nose-devs,
it seems there is a consensus to use 'man/manN'.
Change-Id: I584c80c23b1fb9cfe77025d8c93ab9494a7b6cf0
Old argument description:
-l, --list list available reviews for the current project
New argument description:
-l, --list List available reviews for the current project
Change-Id: Ic7b46bed61944113549b9a98711ba6407ab5c9f0
This exception should print the error message
as well as the offending command with the parameters
and its output.
This way lots of status checking code (if (status != 0))
can be removed in the future.
An example CannotInstallHook exception has been introduced.
Example output in case of failure:
Problems encountered installing commit-msg hook
The following command failed with exit code 1
"scp -P 29418 saper@blabla:hooks/commit-msg .git/hooks/commit-msg"
-----------------------
ssh: Could not resolve hostname blabla: Name or service not known
-----------------------
This way only one place will be used to control output of errors,
it is also simple to introduce separate exit code for every error
in git-review.
Change-Id: I92b8637c87df3bdc328faef456a8391305fb92cb
Refactor all ssh and scp invocations to use
the same form of run_command_status
Now SSH/SCP code duplication seems to be obvious
Change-Id: Id924746df65a615516dd7cb1dee249f2d59d0e78
Allow both
run_command("command", "arg1", "arg2")
and
run_command("command arg1 arg2")
Avoid nasty env=dict(ENVAR='sth') and use
ENVAR='sth' instead.
Change-Id: I75ea0ce5c12b9b1d9c62528db1be82145a19a409