Bug 235524 - [git-webkit] Improve handling of Ctrl-C during git-webkit commands while waiting for user input
Summary: [git-webkit] Improve handling of Ctrl-C during git-webkit commands while wait...
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: 2022-01-24 09:10 PST by Aakash Jain
Modified: 2022-02-02 11:00 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 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
Comment 1 Jonathan Bedard 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
Comment 2 Aakash Jain 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.
Comment 3 Radar WebKit Bug Importer 2022-01-31 09:41:36 PST
<rdar://problem/88276494>
Comment 4 Jonathan Bedard 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.
Comment 5 Jonathan Bedard 2022-02-02 10:55:28 PST
Fixed in 246695@main (r288966)
Comment 6 Aakash Jain 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