Commit Graph

167 Commits (e2d6fd987e17c0a099382419f76fdffffea7659a)

Author SHA1 Message Date
dsansome e2d6fd987e Prompt to delete pending edits before changing the Gerrit CL description.
BUG=641838

Review-Url: https://codereview.chromium.org/2318903002
9 years ago
tandrii 8da412cf5a Remove redundant output in git_cl.py tests.
R=agable@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2319903002
9 years ago
qyearsley 53f48a1c52 Add a --json option to git cl try-results.
For use in scripts that check try job results, this is
currently practically the same as making requests to
https://codereview.chromium.org/api/<cl-number>/<patchset-number>.

However, I think that this might be more future-proof, since
it fetches try job information from Buildbucket, and I expect
to still work after migration from Rietveld to Gerrit.

BUG=640354

Review-Url: https://codereview.chromium.org/2274743003
9 years ago
tandrii c4344b5958 Fix Gerrit git cl land and add test.
R=andybons@chromium.org
BUG=641127

Review-Url: https://codereview.chromium.org/2280563003
9 years ago
kmarshall 9249e01b70 git cl archive: Add "--dry-run" and "--notags" flags.
This CL adds a couple flags to "git cl archive".
dry-run: Lists the cleanup tasks, but exits before any changes are
made to Git.
notags: Deletes branches only; does not create archival tags.

R=tandrii@chromium.org,groby@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2276663002
9 years ago
tandrii 33a46ffb3f git cl: workaround against integer overflows of git config.
R=maruel@chromium.org,phajdan.jr@chromium.org
BUG=640115

Review-Url: https://codereview.chromium.org/2272613002
9 years ago
phajdan.jr e328cf9c78 git cl issue: add --json switch for machine-readable output
This was requested in https://chromium-review.googlesource.com/c/373499

BUG=none

Review-Url: https://codereview.chromium.org/2263103002
9 years ago
tandrii df09a46d7c git cl patch: bail out quickly if there is no branch.
This is because later calls to SetIssue() would fail.

R=michaelpg@chromium.org
BUG=611020

Review-Url: https://codereview.chromium.org/2259993002
9 years ago
tandrii 5d48c32f3d git cl: cleanup branch config get/set/unset.
Previously there was a soup with add-hoc formatting with
current branch name, which wasn't always set (see bug 611020).
This CL makes sure all such operations now:
 * properly use types --int and --bool
 * go through the *only* appropriate get/set/unset function.

Furthermore, tests were a mess wrt to raising exceptions when
git processes terminated with an exception. This CL cleaned up,
though I didn't go through all expectations, so some returns of
empty stdout instead of raising CalledProcess error are likely
remaining.

Disclaimer: this CL is not necessarily fixing the referenced bug
below, but it should at least provide better stacktrace when
the bug manifestst itself.

BUG=611020
R=agable@chromium.org

Review-Url: https://codereview.chromium.org/2259043002
9 years ago
iannucci e53c935fe7 Add --issue to set-commit and set-close too.
R=phajdan.jr@chromium.org, tandrii@chromium.org, vadimsh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2245263007
9 years ago
tandrii 99a72f2514 Gerrit git cl upload: self-lgtm on TBR.
BUG=626364
R=andybons@chromium.org
TEST=manual: https://chromium-review.googlesource.com/#/c/372138

Review-Url: https://codereview.chromium.org/2259583002
9 years ago
iannucci 3c972b9039 Add --issue flag to git cl status.
R=phajdan.jr@chromium.org, vadimsh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2250323003
9 years ago
tandrii eefe83265b Gerrit git cl upload: auto-filter patchset titles.
Without it, upload fails because ref is invalid.

BUG=622062
R=andybons@chromium.org

Review-Url: https://codereview.chromium.org/2252043002
9 years ago
wychen 3c1c172d64 Extract patchset in Rietveld URLs better
Parse URL in the form of:
https://domain/<number>/#ps<patchset>

Review-Url: https://codereview.chromium.org/2215433004
9 years ago
tandrii 4d843595aa git cl set-commit: fix for Rietveld if cq dry run is active.
If dry-run was active, git cl set-commit didn't actually trigger a
full CQ run, but was just a no-op.

TBR=machenbach@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2184643004
9 years ago
tandrii 9de9ec66b3 git cl try: Trigger CQ Dry Run by default.
If bots are specified manually on command line OR in PRESUBMIT.py,
then old behavior remains, namely triggering just those bots.

Otherwise, git cl try will now trigger CQ Dry Run. This is a good
default and also resolves several bugs:

 * https://crbug.com/581150 where git cl try used to load cq.cfg
   from infra/config, but that's not always correct for all projects.

 * https://crbug.com/625697 where even if cq.cfg is in default location.
   it might be outdated.

 * https://crbug.com/585237 where git cl try would ignore special
   in CL description CQ_INCLUDE_TRYBOTS, which is processed by CQ,
   but not git cl try.

BUG=625697,585237,581150
R=sergiyb@chromium.org,emso@chromium.org

Review-Url: https://codereview.chromium.org/2147563003
9 years ago
tandrii d9e5ce518a Fix git cl set-commit --clear.
aka sergiyb@ was right.

R=sergiyb@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2141283002
9 years ago
tandrii f9aefb774c Implement git cl upload -b BUG --bug=BUG.
CC=friedman@chromium.org
R=sergiyb@chromium.org
BUG=500658

Review-Url: https://codereview.chromium.org/2117483002
9 years ago
martiniss 6eda05f9e6 Allow git_cl to be called when no default server is given
Review-Url: https://codereview.chromium.org/2109253002
9 years ago
tandrii d0b10a0b31 Remove old compatibility for git_cl_upload branches.
R=machenbach@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2116493002
9 years ago
tandrii 9d20675998 git cl test framework: improve debuggability of expected calls.
R=phajdan.jr@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2074233002
9 years ago
tandrii a60502f2d3 Gerrit git cl upload: --squash is now default.
You can override it for all devs of repo by adding line to codereview.settings:
  GERRIT_SQUASH_UPLOADS: (True|False)

And even with that, individual devs can overide it for themselves with:
  git config [--global] --bool gerrit.override-squash-uploads (true|false)

BUG=611892

Review-Url: https://codereview.chromium.org/2072363002
9 years ago
tandrii edbf9a3e85 Gerrit git cl upload: Remove --no-squash warning message.
First, it's wrong because of instruction in it is ineffective.
Second, it was also shown during --squash upload, which is completely wrong.

TBR=sergiyb@chromium.org
BUG=611892

Review-Url: https://codereview.chromium.org/2072923002
9 years ago
tandrii 26f3e4eecb Update message for Gerrit git cl --no-squash users.
R=andybons@chromium.org
BUG=611892

Review-Url: https://codereview.chromium.org/2055233002
9 years ago
tandrii 1c67da672d Mock stdout to avoid pollutting test runner stdout.
TBR=kmarshall@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2055003003
9 years ago
tandrii 16e0b4e206 Gerrit git cl upload: warn and offer to remove Gerrit commit-msg hook.
R=andybons@chromium.org,sergiyb@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2045973002
9 years ago
kmarshall 3bff56bb49 Add "archive" command to git_cl.py.
This command archives branches whose Rietveldt status is closed by
creating new Git tags for each of the branches' heads, and then
deleting the branch. It automatically cleans up the clutter that
accumulates over time in a long-lived Git checkout.

For example, the branch "foo-bar" associated with the
closed issue 1568403002 will be archived to the tag
"git-cl-archived-1568403002-foo-bar".

BUG=616404
R=martiniss@chromium.org,tandrii@chromium.org

Review-Url: https://codereview.chromium.org/1991563005
9 years ago
tandrii@chromium.org 074c2afe94 Revert of Gerrit git cl: temporary disable cc option on upload. (patchset #1 id:1 of https://codereview.chromium.org/1895863002/ )
Reason for revert:
We've whitelisted cc-ed emails in Gerrit, and so let's try setting cc= again.

Original issue's description:
> Gerrit git cl: temporary disable cc option on upload.
> 
> Gerrit doesn't allow arbitrary non-member emails for now,
> thus removign this feature until either Gerrit allows it,
> or we have a per-repo opt-in way.
> 
> TBR=andybons@chromium.org
> BUG=604377
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=299988

TBR=andybons@chromium.org,sergiyb@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=604377

Review-Url: https://codereview.chromium.org/2034143002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300694 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 601e1d17ef git cl description: avoid appending BUG= after Change-Id.
R=yyanagisawa@chromium.org,sergiyb@chromium.org
BUG=614587

Review-Url: https://codereview.chromium.org/2038673002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300692 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org d605a51ccb git cl desc: add test that shows BUG= breaking Change-Id footer.
BUG=614587
R=yyanagisawa@chromium.org,andybons@chromium.org

Review-Url: https://codereview.chromium.org/2033783002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300690 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 9b7fd71c48 git cl issue 0 should really clear issue.
It used to clear just issue number and patchset, but that's not
all state that associates a given branch with codereview site.

R=andybons@chromium.org
BUG=609295

Review-Url: https://codereview.chromium.org/2032433003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300683 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org c2786d933b Fix & refactor git cl patch.
* Fixes a bug when issue was incorrectly over-written
  in another branch. Add a test case.
* Refactor for better flow.
* Update outdated errors on wrong arguments.

BUG=616105
R=andybons@chromium.org,sergiyb@chromium.org

Review-Url: https://codereview.chromium.org/2022183003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300681 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 8da4540381 Gerrit git cl upload: obey -s --send-mail option.
Previously, git cl upload would send email every time.
This CL changes that to send email only if -s or --send-mail is given.

R=andybons@chromium.org
BUG=612728

Review-Url: https://codereview.chromium.org/2007873002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300662 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
martiniss@chromium.org d6648e2d3a git_cl: Add the ability to set the description. (reland)
BUG=607359

Review-Url: https://codereview.chromium.org/1935653002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300366 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
martiniss@chromium.org 611cd7ab02 Revert of git_cl: Add the ability to set the description. (patchset #3 id:40001 of https://codereview.chromium.org/1922133006/ )
Reason for revert:
splitlines man

Original issue's description:
> git_cl: Add the ability to set the description.
> 
> BUG=607359
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=300357

TBR=iannucci@chromium.org,tandrii@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=607359

Review-Url: https://codereview.chromium.org/1935633002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300360 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
martiniss@chromium.org b73176a772 git_cl: Add the ability to set the description.
BUG=607359

Review-Url: https://codereview.chromium.org/1922133006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300357 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
martiniss@chromium.org 2b55fe30e6 git_cl: description fetching from code review servers.
BUG=

Review URL: https://codereview.chromium.org/1901733003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300207 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 0b2d70724f Gerrit git cl: temporary disable cc option on upload.
Gerrit doesn't allow arbitrary non-member emails for now,
thus removign this feature until either Gerrit allows it,
or we have a per-repo opt-in way.

TBR=andybons@chromium.org
BUG=604377

Review URL: https://codereview.chromium.org/1895863002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299988 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
shinyak@chromium.org 00dbccdcef Use hyphen for gerrit.skip-ensure-authenticated
git config key should consist of alphanumeric characters and '-'.
The underscore '_' is not allowed. So we're getting 'invalid key' error
when GERRIT_SKIP_ENSURE_AUTHENTICATED is set.

Let's use '-' instead of '_'.

BUG=603378

Review URL: https://codereview.chromium.org/1882833005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299952 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 2825353c97 Allow to skip EnsureAuthenticated for Gerrit.
Adding this line to codereview.settings should do the trick:
  GERRIT_SKIP_ENSURE_AUTHENTICATED: true

And I also cleaned up tests so they don't spill too much to stdout.

BUG=603378
R=machenbach@chromium.org,andybons@chromium.org
CC=shinyak@chromium.org

Review URL: https://codereview.chromium.org/1884173003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299926 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 1a8ef44ce2 Followup for git cl set-commit tests.
Based on review of https://codereview.chromium.org/1889483002.

R=sergiyb@chromium.org
BUG=599931

Review URL: https://codereview.chromium.org/1885963002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299905 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org dde6462520 git cl: add --gerrit and --rietveld options to force codereview.
This makes it possible to override the codereview set in:
 * repository codereview.settings
 * cached/set in local .git/config, either repo-wide or
   current branch only.

Examples:

    cd $SOME_RIETVELD_USING_REPO
    # Enable Gerrit codereview on it. Contact Infra-Git admin:
    # https://bugs.chromium.org/p/chromium/issues/entry?template=Infra-Git

    # Uploading
    git cl upload --gerrit --squash
    # Hack, hack, re-upload uses Gerrit automatically.
    git cl upload --squash

    # Patching
    git new-branch patched-in-issue
    git cl patch --gerrit XXXXXX

    # (Re-)setting issue
    git cl issue --gerrit 0
    git cl issue --gerrit XXXXXX

R=andybons@chromium.org,sergiyb@chromium.org
BUG=598681

Review URL: https://codereview.chromium.org/1880243003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299901 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org fa330e8012 git cl set-commit: for Gerrit + dry-run support.
This provides workaround for not functioning git cl try.

R=sergiyb@chromium.org,andybons@chromium.org,phajdan.jr@chromium.org
BUG=599931

Review URL: https://codereview.chromium.org/1889483002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299900 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 8acd833e45 Gerrit git cl upload: implement setting cc and reviewers.
R=machenbach@chromium.org,andybons@chromium.org
BUG=323819

Review URL: https://codereview.chromium.org/1885883002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299887 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org bf766ba3d3 Gerrit git cl upload: implement patchset title (message).
R=machenbach@chromium.org,andybons@chromium.org
BUG=579178

Review URL: https://codereview.chromium.org/1886433003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299886 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org fe30f18fc5 Gerrit git cl upload: add check for missing credentials.
Checks creds before uploading and running presubmit, generalizing
the case of Rietveld. If they are missing, suggests a URL to
generate them.

R=andybons@chromium.org,phajdan.jr@chromium.org
BUG=583153

Review URL: https://codereview.chromium.org/1882583003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299883 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 26c8fd2b1a Fix git cl checkout when no branch has issues.
TBR=machenbach@chromium.org
BUG=579182

Review URL: https://codereview.chromium.org/1878613003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299843 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 5df290f6af git cl checkout: implement for Gerrit + add test.
R=sergiyb@chromium.org,andybons@chromium.org
BUG=579182

Review URL: https://codereview.chromium.org/1873233002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299833 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org f86c7d3500 Reland of Gerrit git cl: implement git cl patch. (patchset #1 id:1 of https://codereview.chromium.org/1848393002/ )
Reason for revert:
nope, the windows breakage is due to apply_issue failing to connect to Rietveld.

Original issue's description:
> Revert of Gerrit git cl: implement git cl patch. (patchset #7 id:120001 of https://codereview.chromium.org/1852593002/ )
> 
> Reason for revert:
> just in case.
> 
> Original issue's description:
> > Gerrit git cl: implement git cl patch.
> > 
> > BUG=579182
> > 
> > Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=299644
> 
> TBR=andybons@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=579182
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=299645

TBR=andybons@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=579182

Review URL: https://codereview.chromium.org/1852803002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299647 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org e0a10585da Revert of Gerrit git cl: implement git cl patch. (patchset #7 id:120001 of https://codereview.chromium.org/1852593002/ )
Reason for revert:
just in case.

Original issue's description:
> Gerrit git cl: implement git cl patch.
> 
> BUG=579182
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=299644

TBR=andybons@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=579182

Review URL: https://codereview.chromium.org/1848393002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299645 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago