File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,6 +129,24 @@ class GitBugJavaCli(object):
129129 for bug in self .__projects [ppid ].get_bugs ():
130130 print (bug .bid )
131131
132+ def info (self , bid : str ):
133+ """
134+ Get information about a specific bug in GitBug-Java
135+ """
136+ # Split bid on the last occurence of "-"
137+ pid , _ = bid .rsplit ("-" , 1 )
138+
139+ # Check the pid and bid exist
140+ if pid not in self .__projects :
141+ raise ValueError (f"Unknown project id { pid } " )
142+
143+ project = self .__projects [pid ]
144+ bug = project .get_bug (bid )
145+ if bug is None :
146+ raise ValueError (f"Unknown bug id { bid } for project { pid } " )
147+
148+ print (bug .info ())
149+
132150 def checkout (self , bid : str , workdir : str , fixed : bool = False ):
133151 """
134152 Checkout a specific bug in GitBug-Java
Original file line number Diff line number Diff line change @@ -310,5 +310,26 @@ def flat_failed_tests(runs):
310310 else 1
311311 )
312312
313+ def info (self ) -> str :
314+ return f"""
315+ ### Bug ID
316+ { self .bid }
317+
318+ ### Bug Patch
319+ ```diff
320+ { self .bug_patch }
321+ ```
322+
323+ ### Non-Code Patch
324+ ```diff
325+ { self .non_code_patch }
326+ ```
327+
328+ ### Test Patch
329+ ```diff
330+ { self .test_patch }
331+ ```
332+ """
333+
313334 def __str__ (self ) -> str :
314335 return self .bid
You can’t perform that action at this time.
0 commit comments