<?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>241487</bug_id>
          
          <creation_ts>2022-06-09 13:38:50 -0700</creation_ts>
          <short_desc>[git-webkit] Incorrect common directory when not in checkout root</short_desc>
          <delta_ts>2022-06-19 11:27:34 -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>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Jonathan Bedard">jbedard</assigned_to>
          <cc>ap</cc>
    
    <cc>jbedard</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1875095</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-06-09 13:38:50 -0700</bug_when>
    <thetext>git-webkit has started printing strange errors related to git identifier cache. The error message is:

Failed to write identifier cache to &apos;/home/mcatanzaro/Projects/WebKit/../.git/identifiers.json&apos;

And it prints several times when creating a PR, e.g.:

$ git-webkit pr
&apos;main&apos; is not a pull request branch, enter issue URL or title of new issue: https://bugs.webkit.org/show_bug.cgi?id=241485
Switched to a new branch &apos;eng/GLib-Validate-proxy-URLs-passed-to-WebKitNetworkProxySettings&apos;
Created the local development branch &apos;eng/GLib-Validate-proxy-URLs-passed-to-WebKitNetworkProxySettings&apos;
branch &apos;main&apos; set up to track &apos;origin/main&apos;.
  Running status to find changed, added, or removed files.
  Reviewing diff to determine which lines changed.
  Extracting affected function names from source files.
  Change author: Michael Catanzaro &lt;mcatanzaro@redhat.com&gt;.
[eng/GLib-Validate-proxy-URLs-passed-to-WebKitNetworkProxySettings 56672a1fbb69] [GLib] Validate proxy URLs passed to WebKitNetworkProxySettings https://bugs.webkit.org/show_bug.cgi?id=241485
 Date: Thu Jun 9 15:36:15 2022 -0500
 2 files changed, 7 insertions(+), 2 deletions(-)
Failed to write identifier cache to &apos;/home/mcatanzaro/Projects/WebKit/../.git/identifiers.json&apos;
Failed to write identifier cache to &apos;/home/mcatanzaro/Projects/WebKit/../.git/identifiers.json&apos;
remote: Enumerating objects: 13069, done.
remote: Counting objects: 100% (11049/11049), done.
remote: Compressing objects: 100% (501/501), done.
remote: Total 13069 (delta 10670), reused 10770 (delta 10548), pack-reused 2020
Receiving objects: 100% (13069/13069), 12.52 MiB | 11.56 MiB/s, done.
Resolving deltas: 100% (11626/11626), completed with 1990 local objects.
From github.com:WebKit/WebKit
   ebe6780b9ba2..dfa403878762  main                                      -&gt; main
 * [new tag]                   releases/Apple/Safari-13.1.3-macOS-10.15.7-Security-Update-2020-001 -&gt; releases/Apple/Safari-13.1.3-macOS-10.15.7-Security-Update-2020-001
 * [new tag]                   releases/Apple/Safari-13.1.3-macOS-10.15.7-Security-Update-2022-004 -&gt; releases/Apple/Safari-13.1.3-macOS-10.15.7-Security-Update-2022-004
 * [new tag]                   releases/Apple/Safari-15.5-iOS-15.5       -&gt; releases/Apple/Safari-15.5-iOS-15.5
 * [new tag]                   releases/Apple/Safari-15.5-macOS-12.4     -&gt; releases/Apple/Safari-15.5-macOS-12.4
 * [new tag]                   releases/Apple/Safari-8.0.3-macOS-10.10.2 -&gt; releases/Apple/Safari-8.0.3-macOS-10.10.2
   ebe6780b9ba2..dfa403878762  main                                      -&gt; origin/main
From github.com:WebKit/WebKit
 * branch                      main       -&gt; FETCH_HEAD
Successfully rebased and updated refs/heads/eng/GLib-Validate-proxy-URLs-passed-to-WebKitNetworkProxySettings.
Failed to write identifier cache to &apos;/home/mcatanzaro/Projects/WebKit/../.git/identifiers.json&apos;
Rewrite c145a5031ab65973a8333d0cdc8a4deaff355cd7 (1/1) (0 seconds passed, remaining 0 predicted)    
WARNING: Ref &apos;refs/remotes/origin/main&apos; is unchanged
Ref &apos;refs/heads/eng/GLib-Validate-proxy-URLs-passed-to-WebKitNetworkProxySettings&apos; was rewritten
ERROR: Unexpected diff format when parsing a chunk: &apos;2.36.1&apos;
Total errors found: 0 in 2 files
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 32 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1.18 KiB | 605.00 KiB/s, done.
Total 11 (delta 10), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (10/10), completed with 10 local objects.
remote: 
remote: Create a pull request for &apos;eng/GLib-Validate-proxy-URLs-passed-to-WebKitNetworkProxySettings&apos; on GitHub by visiting:
remote:      https://github.com/mcatanzaro/WebKit/pull/new/eng/GLib-Validate-proxy-URLs-passed-to-WebKitNetworkProxySettings
remote: 
To github.com:mcatanzaro/WebKit.git
 * [new branch]                eng/GLib-Validate-proxy-URLs-passed-to-WebKitNetworkProxySettings -&gt; eng/GLib-Validate-proxy-URLs-passed-to-WebKitNetworkProxySettings
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To github.com:mcatanzaro/WebKit.git
   b860f7e425a6..dfa403878762  main -&gt; main
Failed to write identifier cache to &apos;/home/mcatanzaro/Projects/WebKit/../.git/identifiers.json&apos;
Failed to write identifier cache to &apos;/home/mcatanzaro/Projects/WebKit/../.git/identifiers.json&apos;
Created &apos;PR 1429 | [GLib] Validate proxy URLs passed to WebKitNetworkProxySettings&apos;!
Assigning associated issue to Michael Catanzaro &lt;mcatanzaro@gnome.org&gt;
Posted pull request link to https://bugs.webkit.org/show_bug.cgi?id=241485
https://github.com/WebKit/WebKit/pull/1429</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1875706</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-06-13 22:44:03 -0700</bug_when>
    <thetext>What does this print?

git rev-parse --show-toplevel --git-common-dir

I&apos;m guessing that there is a &quot;..&quot; there, but no idea where it would come from.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1875755</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-06-14 05:54:49 -0700</bug_when>
    <thetext>$ git rev-parse --show-toplevel --git-common-dir
/home/mcatanzaro/Projects/WebKit
.git</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1875807</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-06-14 10:01:43 -0700</bug_when>
    <thetext>I don&apos;t immediately see from the code how it&apos;s possible then! It&apos;s my first time looking at this code though, so surely I&apos;m missing something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876323</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-06-16 13:39:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/95327557&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876535</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2022-06-17 15:26:58 -0700</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #2)
&gt; $ git rev-parse --show-toplevel --git-common-dir
&gt; /home/mcatanzaro/Projects/WebKit
&gt; .git

Wait, how is there a newline in there? If `def common_directory(self)` in `Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py` isn&apos;t returning the right thing, that&apos;s your problem. And I think a newline from `git rev-parse --show-toplevel --git-common-dir` would be pretty unexpected</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876536</commentid>
    <comment_count>6</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2022-06-17 15:29:07 -0700</bug_when>
    <thetext>(In reply to Jonathan Bedard from comment #5)
&gt; (In reply to Michael Catanzaro from comment #2)
&gt; &gt; ...
&gt; 
&gt; Wait, how is there a newline in there? If `def common_directory(self)` in
&gt; `Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py` isn&apos;t
&gt; returning the right thing, that&apos;s your problem. And I think a newline from
&gt; `git rev-parse --show-toplevel --git-common-dir` would be pretty unexpected

Oh, you passed two arguments to `git rev-parse`, that&apos;s why. `def common_directory` is definitely the culprit, though</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876541</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-06-17 15:47:19 -0700</bug_when>
    <thetext>The .. seem to be based on which directory I am in:

$ pwd
/home/mcatanzaro/Projects/WebKit
$ git rev-parse --git-common-dir
.git
$ cd Source/
$ git rev-parse --git-common-dir
../.git
$ cd WebCore/
$ git rev-parse --git-common-dir
../../.git</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876603</commentid>
    <comment_count>8</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2022-06-17 21:51:56 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/1610</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876604</commentid>
    <comment_count>9</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2022-06-17 22:00:36 -0700</bug_when>
    <thetext>`git-webkit find HEAD` should reproduce the problem as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876666</commentid>
    <comment_count>10</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-06-19 11:27:32 -0700</bug_when>
    <thetext>Committed r295662 (251667@main): &lt;https://commits.webkit.org/251667@main&gt;

Reviewed commits have been landed. Closing PR #1610 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>