Bug 228619

Summary: [git-webkit] Not all platforms support more -F
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, ap, dewei_zhu, don.olmstead, slewis, 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=228027
https://bugs.webkit.org/show_bug.cgi?id=228621
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Jonathan Bedard 2021-07-29 16:14:43 PDT
Seems like not all platforms support -F being passed to 'more'
Comment 1 Radar WebKit Bug Importer 2021-07-29 16:14:58 PDT
<rdar://problem/81296290>
Comment 2 Jonathan Bedard 2021-07-29 16:18:14 PDT
Created attachment 434584 [details]
Patch
Comment 3 Aakash Jain 2021-07-30 08:17:58 PDT
rs=me
Comment 4 Jonathan Bedard 2021-07-30 08:40:42 PDT
Created attachment 434633 [details]
Patch for landing
Comment 5 EWS 2021-07-30 09:35:18 PDT
Committed r280478 (240113@main): <https://commits.webkit.org/240113@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434633 [details].
Comment 6 Alexey Proskuryakov 2021-07-30 22:26:59 PDT
Comment on attachment 434633 [details]
Patch for landing

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

> Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/command.py:124
> +            more = subprocess.Popen([which('more')] + ['-F'] if platform.system() == 'Darwin' else [], stdin=child.stdout)

Not new with this patch, but what is `which` doing here?
Comment 7 Jonathan Bedard 2021-08-02 08:25:18 PDT
Comment on attachment 434633 [details]
Patch for landing

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

>> Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/command.py:124
>> +            more = subprocess.Popen([which('more')] + ['-F'] if platform.system() == 'Darwin' else [], stdin=child.stdout)
> 
> Not new with this patch, but what is `which` doing here?

It's coming a library, whichcraft (import on line 31), basically the cross-platform equivalent of running `/usr/bin/which more`. It's giving us the path to the `more` executable. I think it was Don Olmstead that recommended this approach for Windows when I was working on some of the git and svn stuff last year, and I've been doing it whenever we need to run shell commands on multiple platforms.
Comment 8 Alexey Proskuryakov 2021-08-02 10:26:34 PDT
it's almost certainly useless on Unix, as "which" won't find anything that Popen can't find on its own. Not sure what good it could be doing on Windows, but maybe there is some... witchcraft there.