Bug 235524

Summary: [git-webkit] Improve handling of Ctrl-C during git-webkit commands while waiting for user input
Product: WebKit Reporter: Aakash Jain <aakash_jain>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=235655

Aakash Jain
Reported 2022-01-24 09:10:46 PST
Improve handling of Ctrl-C during git-webkit commands. Currently it prints a stack-trace which might not be very readable. e.g.: [WebKit]$git-webkit pr Branch name: ^CTraceback (most recent call last): File "/Volumes/Apple/code/WebKit/Tools/Scripts/git-webkit", line 69, in <module> sys.exit(program.main( File "/Volumes/Apple/code/WebKit/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/__init__.py", line 134, in main return parsed.main( File "/Volumes/Apple/code/WebKit/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py", line 111, in main if Branch.main(args, repository, **kwargs): File "/Volumes/Apple/code/WebKit/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/branch.py", line 79, in main args.issue = Terminal.input('Branch name: ') File "/Volumes/Apple/code/WebKit/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/terminal.py", line 39, in input return (input if sys.version_info > (3, 0) else raw_input)(*args, **kwargs) KeyboardInterrupt
Attachments
Jonathan Bedard
Comment 1 2022-01-24 09:19:53 PST
In most cases, I think the stack-trace is the right option. However, a Ctrl-C during input seems like a special case (as the example stack-trace is), and one we could pretty easily handle differently
Aakash Jain
Comment 2 2022-01-24 09:22:15 PST
(In reply to Jonathan Bedard from comment #1) > In most cases, I think the stack-trace is the right option. However, a Ctrl-C during input seems like a special case (as the example stack-trace is), and one we could pretty easily handle differently Yeah, the specific use-case I had in mind was pressing Ctrl-C when user was asked for an input. Re-titled the bug appropriately.
Radar WebKit Bug Importer
Comment 3 2022-01-31 09:41:36 PST
Jonathan Bedard
Comment 4 2022-01-31 12:28:35 PST
At the moment, one of the series of commits in https://github.com/WebKit/WebKit/pull/99 has this fix.
Jonathan Bedard
Comment 5 2022-02-02 10:55:28 PST
Fixed in 246695@main (r288966)
Aakash Jain
Comment 6 2022-02-02 11:00:15 PST
Thanks! Seems to be working fine. e.g.: [/Volumes/Apple/code/WebKit/Tools/CISupport/ews-build]$git-webkit pr 'main' is not a pull request branch, enter name of new branch: ^C User interrupted program
Note You need to log in before you can comment on or make changes to this bug.