Having a gerrit remote means that we fetch changes twice. It's also
not necessary since the push-url can be set on the origin remote. As
a first step, add a config option that changes the default for defaultremote
to origin and then reworks the logic to add the remote url to origin as a
push-url instead of creating a gerrit remote.
Since this will cause people with an existing gerrit remote to have a
push url added and the gerrit remote orpahned, a follow on commit will
come that will look for a gerrit remote and, if it exists, use it as the
source of url for the push-url and then delete the old remote.
Change-Id: Ief5d092a796516de9605b7df64e7b902c3b47351
When looking for candidate topic in bug or blueprint ID, get the
git log without header lines, e.g., commit hash, author, committer,
dates, so that accidental matches such as commit hash (which could look
like a bug ID) or user name (which could look like anything) don't
accidentally get taken as the topic.
Change-Id: Ie45ed7509e7f873e566f078b55cadd547da704dd
Closes-Bug: #2000296
Looks like possibly new setuptools has started leaving a .eggs
directory in the workspace. Add it to .gitignore with extreme
prejudice.
Change-Id: If53d9a2f03c8064265a6915a116983fb34de5f9a
Add the --reviewers argument which allows specifying reviewers to be
added to each patch uploaded. This simplifies the upload process by not
requiring an additional step of adding reviewers to changes.
Gerrit supports specifying reviewers to be added to changes by appending
a list of r='email' options to the refspec being pushed to. For
example, from the Gerrit 'Uploading Changes' documentation:
git push tr:kernel/common HEAD:refs/for/experimental%r=a@a.com,cc=b@o.com
The --reviewers argument can be passed multiple reviewers to add to the
patch set. Reviewers containing whitespace are rejected, as whitespace
cannot be added to the refspec.
Change-Id: I8c2f9453a90dd78aa47f7996f2502f9f6cf2d66d
The documentation link was a 404.
A read-only git web interface is not a suitable project home page.
Change-Id: Ib3a459ffb61990b2e412a9eff0247a33afb42441
Related-Bug: 2000006
On test platforms where the default hostname is not an FQDN, git
fails to guess a usable E-mail address. We don't actually care what
E-mail address these tests see, so override it with a known working
value.
Change-Id: Id65af4876b9658c34a10d1a8f5c72813830725c4
It is not clear why git-review might attempt a rebase and fail,
so provide a helpful error message with suggested next steps in
that case.
Co-Authored-By: Clark Boylan <clark.boylan@gmail.com>
Change-Id: I195554ed5c577c39687d9001a177dadf107bab61
Convert to using the requests module which supports proxying of 'https'
connections for retriving the gerrit war file when behind a corporate
proxy.
Change-Id: Id368cb6aa7058970ad6ac10caacea2aec9bfe48b
Git plumbing command rev-parse is able to return the current branch
symbolic name in a machine readable manner and will return the rev
inputted (HEAD in this case) if no corresponding branch can be found
(detached HEAD).
This works on all versions of git since 1.6.3 and alternatively can be
replaced with 'git symbolic-ref --short -q HEAD' on versions 1.7.10 and
newer.
Change-Id: I486dcad4b73f9f06d7196e6888a4da79c7d574ad
Prevent user or system configuration from impacting the output of git
commands through custom configuration options. Example is enabling of
"branch.autosetuprebase=always" will result a different message being
outputted by git when creating branches causing some tests to fail when
attempting to match against the expected output.
Change-Id: Ic6526217b598abfef0a272bc7cd1852c5821163a
There are more things that break if we run git with i18n on. Make sure
that we always set LANG and LANGUAGE to C so that we get predictable
output.
Change-Id: I1bf1124f0b09d6658a7b0703e3b9e74ed80f4eea
Sometimes it's difficult to understand reason
why git review -s failed since error description
in code is not streamed to stdout.
Change-Id: I59c0deef5f32d10f9e3e7c50dbaffc6a9f59a466
Closes-Bug: #2000234
When choosing the branch to submit a changeset against, and
against which to rebase a changeset if it is being rebased, a new
gerrit.track configuration item and corresponding --track command
line option indicate to use the upstream branch being tracked as the
source of branch information, in preference to configuration. When
downloading a changeset, always set it up to track the matching
remote branch to make --track work for downloaded changesets.
If a branch name is provided explicitly on the command line, it
overrides the tracked branch.
Rationale:
Workflows with multiple active branches are common. For example,
there may be one development branch (master) and multiple branches
representing prior releases to which bug fixes are still being
made. Then a common workflow is to fix bugs in the earliest
affected branch still maintained and merge forward or cherry-pick
to master. The commits being made to the earlier released branches
should not be rebased against master.
A typical usage pattern in this workflow is:
git checkout -b my-feature origin/master
... implement feature ...
git review -f
git checkout -b my-bug-fix origin/maintenancebranch
... implement bug fix ...
git review -f maintenancebranch
git checkout -b my-bug-fix-merge origin/master
git merge maintenancebranch / git cherry-pick -x ... / git review -x ...
git review -f
The developer, who is usually implementing features and therefore
used to working against master, may accidentally forget to name
the release branch when running git review for the bug fix to the
release branch. Mananging .gitreview files across branches and
repositories scales poorly with larger numbers of repositories
and branches and can be vulnerable to missed bad merges altering
configuration to point at wrong branches.
This change rebases changesets against the tracked remote and branch,
or if no branch is tracked, against the previously-specified branch,
instead of against <defaultremote>/master, only if gerrit.track has
been set to true. With this change, the developer can safely omit
to specify the branch name when committing changes to non-default
branches such as "maintenancebranch" in the example.
When downloading a changeset, it will always be set up to track the
matching remote branch. That way, whether or not the gerrit.track
configuration item is set when the changeset is downloaded, the right
branch will be chosen when it is submitted if gerrit.track is set
after the changeset is downloaded, or if the --track command line
option is specified.
Closes-Bug: #883176
Story: #883176
Story: #2000176
Change-Id: I25f22b9e3cda38598681d720a2f2ac534baec5a6
The manpage is no more installed when invoking 'python setup.py install'
since the pbr migration (d73c473 https://review.openstack.org/35486/ ).
Digging in pbr code, I eventually found out the setup.cfg file needs to
list the manpages to be installed (pbr.manpages). The feature has been
introduced in pbr 0.5.7.
Closes-Bug: 1387174
Change-Id: I9105cff65e830ec2b7800311ed400707feb96a77
As a follow up to https://review.openstack.org/109851, we also need to
respect the "url.<base>.pushInsteadOf" setting like git remote show
did.
Change-Id: I6c4cb9e11dcc5f096af03b2b2356216365eaf111
Authentication could be required when performing REST API authenticated
queries over http(s) (done by run_http_exc). Typically, it appends with
gerrit behind apache2.
This change queries git credential for gerrit password when http request
returns a 401.
Change-Id: Iad60eea938c42210ba8c5df4a1b76f8d2f4dd76d
Split up the README into separate documentation files so we can publish
the documentation for git-review.
Change-Id: Idcdf43e73c5ca5b8cb239606236e3b2a660c46b7
Currently http errors are raised inside a try bloc and transformed in
a more generic exception. This change raises http errors outside the
try bloc.
Change-Id: Iece270ac84925625e848f3049072f39e19e068cc
The encoding header is semi-invalid has the encoding name should be
"utf-8" and not "utf8", which is not the official name of the encoding
and is not recognized by all tools.
Change-Id: I4db673fe86f643f5e1b3e5135d8b0cb72407253e
Replace URLs for workflow documentation to appropriate parts of the
OpenStack Project Infrastructure Manual.
Change-Id: If393085cacf4d2fa21ae6c49ffa6290e02659588
Gerrit 2.9 adds the '--all-reviewers' option to 'gerrit query', which
allows testing that reviewers have been successfully added to a patch
set in tests for new reviewer functionality.
Change-Id: I17f37c8fd46578b4a8cbfacee4eb8073972b2eee