Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: git_cl.py

Issue 1764453002: Gerrit: announce deprecation of auto-download of commit-msg hook. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@G075
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 2025835b6a21915b733293ad33804deb67ca0602..8a8dd95ad4c1fde78267ab75672bf436c894a0bd 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -602,9 +602,9 @@ class Settings(object):
if autoupdate != 'false' and cr_settings_file:
LoadCodereviewSettingsFromFile(cr_settings_file)
# set updated to True to avoid infinite calling loop
- # through DownloadHooks
+ # through DownloadGerritHook
self.updated = True
- DownloadHooks(False)
+ DownloadGerritHook(False)
self.updated = True
def GetDefaultServerUrl(self, error_ok=False):
@@ -1570,8 +1570,8 @@ def hasSheBang(fname):
return f.read(2).startswith('#!')
-def DownloadHooks(force):
- """downloads hooks
+def DownloadGerritHook(force):
+ """Download and install Gerrit commit-msg hook.
Args:
force: True to update hooks. False to install hooks if not present.
@@ -1585,6 +1585,10 @@ def DownloadHooks(force):
if not force:
return
try:
+ print(
+ 'WARNING: installing Gerrit commit-msg hook.\n'
+ ' This behavior of git cl will soon be disabled.\n'
+ ' See bug http://crbug.com/579176.')
urlretrieve(src, dst)
if not hasSheBang(dst):
DieWithError('Not a script: %s\n'
@@ -1623,7 +1627,7 @@ def CMDconfig(parser, args):
if len(args) == 0:
GetCodereviewSettingsInteractively()
- DownloadHooks(True)
+ DownloadGerritHook(True)
return 0
url = args[0]
@@ -1632,7 +1636,7 @@ def CMDconfig(parser, args):
# Load code review settings and download hooks (if available).
LoadCodereviewSettingsFromFile(urllib2.urlopen(url))
- DownloadHooks(True)
+ DownloadGerritHook(True)
return 0
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698