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:',
|
|