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

Unified Diff: git-cl

Issue 2014011: Add --field=patch to git cl status printing the patchset of the current issue. (Closed) Base URL: http://src.chromium.org/git/git-cl.git
Patch Set: updates Created 10 years, 7 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
diff --git a/git-cl b/git-cl
index fb1e91ab08bf45b4ebc915d1e520cbf01a48f528..1d0a719d1e1d3fe10cc3544232ad5ccf34a6a417 100755
--- a/git-cl
+++ b/git-cl
@@ -224,6 +224,8 @@ class Changelist(object):
self.issue = None
self.has_description = False
self.description = None
+ self.has_patchset = False
+ self.patchset = None
def GetBranch(self):
"""Returns the short branch name, e.g. 'master'."""
@@ -487,7 +489,8 @@ def CmdConfig(args):
def CmdStatus(args):
parser = optparse.OptionParser(usage='git cl status [options]')
- parser.add_option('--field', help='print only specific field (desc|id|url)')
+ parser.add_option('--field',
+ help='print only specific field (desc|id|patch|url)')
(options, args) = parser.parse_args(args)
# TODO: maybe make show_branches a flag if necessary.
@@ -506,9 +509,17 @@ def CmdStatus(args):
if options.field.startswith('desc'):
print cl.GetDescription()
elif options.field == 'id':
- print cl.GetIssue()
+ id = cl.GetIssue()
+ if id:
+ print id
+ elif options.field == 'patch':
+ patchset = cl.GetPatchset()
+ if patchset:
+ print patchset
elif options.field == 'url':
- print cl.GetIssueURL()
+ url = cl.GetIssueURL()
+ if url:
+ print url
else:
print
print 'Current branch:',
« 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