Bug 225889

Summary: [webkitscmpy] Support branch queries in mock git log
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, dean_johnson, dewei_zhu, 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=225616
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch for landing none

Description Jonathan Bedard 2021-05-17 14:34:10 PDT
Our `git log` mocks do not support branches, which has some major downsides when developing additional git tooling.
Comment 1 Radar WebKit Bug Importer 2021-05-17 14:34:26 PDT
<rdar://problem/78122705>
Comment 2 Jonathan Bedard 2021-05-17 14:37:37 PDT
Created attachment 428873 [details]
Patch
Comment 3 Jonathan Bedard 2021-05-17 16:49:11 PDT
Created attachment 428891 [details]
Patch
Comment 4 Jonathan Bedard 2021-05-17 16:57:37 PDT
Created attachment 428894 [details]
Patch
Comment 5 Jonathan Bedard 2021-05-19 12:14:57 PDT
Created attachment 429084 [details]
Patch
Comment 6 Jonathan Bedard 2021-06-08 13:27:34 PDT
Created attachment 430883 [details]
Patch
Comment 7 Dean Johnson 2021-06-08 13:36:03 PDT
LGTM; unofficial r+.
Comment 8 Jonathan Bedard 2021-06-16 11:09:18 PDT
Created attachment 431568 [details]
Patch
Comment 9 Stephanie Lewis 2021-06-16 13:49:26 PDT
Comment on attachment 431568 [details]
Patch

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

> Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:532
> +                if commit.hash.startswith(end) or end == branch:

is it ever passible that the first commit will be in the middle of the range? This code would treat it as out of range
Comment 10 Jonathan Bedard 2021-06-16 14:23:52 PDT
Comment on attachment 431568 [details]
Patch

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

>> Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:532
>> +                if commit.hash.startswith(end) or end == branch:
> 
> is it ever passible that the first commit will be in the middle of the range? This code would treat it as out of range

Not if tests are well constructed. This change is entirely in unit testing code, so if begin is older than end, this function shouldn't return anything.
Comment 11 Jonathan Bedard 2021-06-16 15:15:55 PDT
Created attachment 431612 [details]
Patch for landing
Comment 12 EWS 2021-06-16 15:41:43 PDT
Committed r278963 (238890@main): <https://commits.webkit.org/238890@main>

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