Bug 229342 - [git-webkit] Forward unknown args to log and blame
Summary: [git-webkit] Forward unknown args to log and blame
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-08-20 11:34 PDT by Jonathan Bedard
Modified: 2021-08-20 14:57 PDT (History)
3 users (show)

See Also:


Attachments
Patch (3.29 KB, patch)
2021-08-20 11:37 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (3.83 KB, patch)
2021-08-20 11:50 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch for landing (3.54 KB, patch)
2021-08-20 14:24 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].