<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>248304</bug_id>
          
          <creation_ts>2022-11-24 04:31:55 -0800</creation_ts>
          <short_desc>[webkitpy] REGRESSION(250550@main): GitTest.test_rename_files &amp; GitTest.test_create_patch_with_git_index</short_desc>
          <delta_ts>2024-05-10 13:02:42 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=240256</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=244292</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sam Sneddon [:gsnedders]">gsnedders</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jbedard</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1914459</commentid>
    <comment_count>0</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-11-24 04:31:55 -0800</bug_when>
    <thetext>As of commit 9fb799e7c5567af8bba18ec5c8be92e028d8d3ff (250550@main), bug 240256, we get:

____________________________________________________ GitTest.test_create_patch_with_git_index ____________________________________________________

self = &lt;webkitpy.common.checkout.scm.scm_unittest.GitTest testMethod=test_create_patch_with_git_index&gt;

    def test_create_patch_with_git_index(self):
        # First change. Committed.
        write_into_file_at_path(&apos;test_file_commit1&apos;, &apos;first cat&apos;)
        run_command([&apos;git&apos;, &apos;add&apos;, &apos;test_file_commit1&apos;])
        scm = self.tracking_scm
        scm.commit_locally_with_message(&apos;message&apos;)
    
        # Second change. Staged but not committed.
        write_into_file_at_path(&apos;test_file_commit1&apos;, &apos;second dog&apos;)
        run_command([&apos;git&apos;, &apos;add&apos;, &apos;test_file_commit1&apos;])
    
        # Third change. Not even staged.
        write_into_file_at_path(&apos;test_file_commit1&apos;, &apos;third unicorn&apos;)
    
&gt;       patch = scm.create_patch(None, None, True)

common/checkout/scm/scm_unittest.py:1105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
common/checkout/scm/git.py:378: in create_patch
    return self.run(command, decode_output=False, cwd=self.checkout_root)
common/checkout/scm/scm.py:73: in run
    return self._executive.run_command(args,
common/system/executive.py:445: in run_command
    (error_handler or self.default_error_handler)(script_error)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

error = ScriptError(&apos;Failed to run &quot;[\&apos;git\&apos;, \&apos;format-patch\&apos;, \&apos;--stdout\&apos;, \&apos;--binary\&apos;, \&apos;-O\&apos;, \&apos;/Volumes/gsnedders/proje...-cached\&apos;]&quot; exit_code: 128 cwd: /private/var/folders/9f/mkrrck9s5kjg6_vlds37v0g40000gn/T/tmpy7784jn_git_test_checkout&apos;)

    @staticmethod
    def default_error_handler(error):
&gt;       raise error
E       webkitpy.common.system.executive.ScriptError: Failed to run &quot;[&apos;git&apos;, &apos;format-patch&apos;, &apos;--stdout&apos;, &apos;--binary&apos;, &apos;-O&apos;, &apos;/Volumes/gsnedders/projects/Safari-LayoutTestFinder/OpenSource/Tools/Scripts/webkitpy/common/config/orderfile&apos;, &apos;--cached&apos;]&quot; exit_code: 128 cwd: /private/var/folders/9f/mkrrck9s5kjg6_vlds37v0g40000gn/T/tmpy7784jn_git_test_checkout

common/system/abstractexecutive.py:98: ScriptError
___________________________________________________________ GitTest.test_rename_files ____________________________________________________________

self = &lt;webkitpy.common.checkout.scm.scm_unittest.GitTest testMethod=test_rename_files&gt;

    def test_rename_files(self):
        scm = self.tracking_scm
    
        run_command([&apos;git&apos;, &apos;mv&apos;, &apos;foo_file&apos;, &apos;bar_file&apos;])
        scm.commit_locally_with_message(&apos;message&apos;)
    
        patch = scm.create_patch()
&gt;       self.assertNotRegexpMatches(patch, b&apos;rename from &apos;)
E       AssertionError: Regex matched: b&apos;rename from &apos; matches b&apos;rename from &apos; in b&apos;From ab3c2736e533b78eb094fb91ee26cf72560d0354 Mon Sep 17 00:00:00 2001\nFrom: scm_unittest &lt;scm_unittest@example.com&gt;\nDate: Thu, 24 Nov 2022 12:30:17 +0000\nSubject: [PATCH] message\n\n---\n foo_file =&gt; bar_file | 0\n 1 file changed, 0 insertions(+), 0 deletions(-)\n rename foo_file =&gt; bar_file (100%)\n\ndiff --git a/foo_file b/bar_file\nsimilarity index 100%\nrename from foo_file\nrename to bar_file\n-- \n2.37.1 (Apple Git-137.1)\n\n&apos;

common/checkout/scm/scm_unittest.py:1191: AssertionError</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1915888</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-12-01 04:32:17 -0800</bug_when>
    <thetext>&lt;rdar://problem/102855556&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2026416</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2024-04-05 16:49:59 -0700</bug_when>
    <thetext>I think this is the same bug reported in https://bugs.webkit.org/show_bug.cgi?id=268060, although I am unable to reproduce the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2026550</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-04-06 15:49:07 -0700</bug_when>
    <thetext>This still repros; they were just gardened in 257437@main.

```
tox -e py39 -- -k &apos;test_create_patch_with_git_index or test_rename_files&apos; --run-slow --runxfail common/checkout/scm 
py311: commands[0]&gt; pytest -k &apos;test_create_patch_with_git_index or test_rename_files&apos; --run-slow --runxfail common/checkout/scm
```

gives the same failures.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2034597</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2024-05-10 13:02:42 -0700</bug_when>
    <thetext>I&apos;ve started to take a look at this. We really need to unwind much of webkit-patch. There are a number of actions it owns which no longer make sense. I&apos;m not sure if that unwinding will fix this. but it will likely fix a few other broken tests.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>