Bug 229342

Summary: [git-webkit] Forward unknown args to log and blame
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, andresg_22, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Description Jonathan Bedard 2021-08-20 11:34:50 PDT
git-webkit log and git-webkit blame do not correctly forward options that begin with '-' as an artifact of Python's argparser. As the below example shows, that can be a problem:

git blame -L1474,1484 Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
Comment 1 Radar WebKit Bug Importer 2021-08-20 11:36:24 PDT
<rdar://problem/82178743>
Comment 2 Jonathan Bedard 2021-08-20 11:37:38 PDT
Created attachment 436011 [details]
Patch
Comment 3 Jonathan Bedard 2021-08-20 11:39:47 PDT
Comment on attachment 436011 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=436011&action=review

> Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/__init__.py:87
> +            parsed = parser.parse_args(args=args)

Open to other thoughts here, but in general, if the command in question doesn't have args, we want to parse it normally. If it does have args, we want to treat all unknown values as args. The trouble is, we can't figure out which case we're in until we parse the command in the first place.
Comment 4 Jonathan Bedard 2021-08-20 11:50:56 PDT
Created attachment 436014 [details]
Patch
Comment 5 Aakash Jain 2021-08-20 13:15:25 PDT
Comment on attachment 436014 [details]
Patch

rs=me
Comment 6 Jonathan Bedard 2021-08-20 14:24:13 PDT
Created attachment 436029 [details]
Patch for landing
Comment 7 EWS 2021-08-20 14:57:07 PDT
Committed r281339 (240756@main): <https://commits.webkit.org/240756@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 436029 [details].