We need a function which provides machine-readable access to the git config.
<rdar://problem/81283644>
Created attachment 434553 [details] Patch
Created attachment 434554 [details] Patch
Created attachment 434758 [details] Patch
Comment on attachment 434758 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=434758&action=review > Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:280 > + if command.returncode: should log a warning/error here about failure. > Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:286 > + result[parts[0]] = '='.join(parts[1:]) why join? can there be more than one = in a line in the output of 'git config -l' > Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:597 > + RE_SINGLE_TOP = re.compile(r'^\[\s*(?P<key>\S+)\s*\]') might be a good idea to put an example of expected strings in a comment along-with all these REs.
Comment on attachment 434758 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=434758&action=review >> Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py:286 >> + result[parts[0]] = '='.join(parts[1:]) > > why join? can there be more than one = in a line in the output of 'git config -l' Git allows it, although I'm not sure if it happens in practice. Do something like `git config --global user.name "foo=bar"`and then `git config -l` to see what I mean. >> Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:597 >> + RE_SINGLE_TOP = re.compile(r'^\[\s*(?P<key>\S+)\s*\]') > > might be a good idea to put an example of expected strings in a comment along-with all these REs. Ok
Created attachment 434837 [details] Patch
Comment on attachment 434837 [details] Patch rs=me
Committed r280604 (240222@main): <https://commits.webkit.org/240222@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 434837 [details].