From 34fb6b15ee6fe3c69d07662304d184873a289d27 Mon Sep 17 00:00:00 2001 From: "smut@google.com" Date: Mon, 13 Jul 2015 20:03:26 +0000 Subject: [PATCH] Add --display option to git cl description A flag for showing the description instead of opening the editor to modify it. BUG=493885 Review URL: https://codereview.chromium.org/1237483003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296000 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git_cl.py b/git_cl.py index 28f99fad4..e46b66097 100755 --- a/git_cl.py +++ b/git_cl.py @@ -1816,6 +1816,8 @@ def CMDcomments(parser, args): def CMDdescription(parser, args): """Brings up the editor for the current CL's description.""" + parser.add_option('-d', '--display', action='store_true', + help='Display the description instead of opening an editor') auth.add_auth_options(parser) options, _ = parser.parse_args(args) auth_config = auth.extract_auth_config_from_options(options) @@ -1823,6 +1825,9 @@ def CMDdescription(parser, args): if not cl.GetIssue(): DieWithError('This branch has no associated changelist.') description = ChangeDescription(cl.GetDescription()) + if options.display: + print description.description + return 0 description.prompt() if cl.GetDescription() != description.description: cl.UpdateDescription(description.description)