<?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>266028</bug_id>
          
          <creation_ts>2023-12-07 15:21:52 -0800</creation_ts>
          <short_desc>`Co-authored-by` doesn’t work because (non-trailer) `Canonical link` gets added by the merge queue</short_desc>
          <delta_ts>2025-11-11 07:32:06 -0800</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>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=282792</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=282952</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>
          <dependson>301444</dependson>
    
    <dependson>301469</dependson>
    
    <dependson>301471</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Antoine Quint">graouts</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aperez</cc>
    
    <cc>ap</cc>
    
    <cc>bfan2</cc>
    
    <cc>emw</cc>
    
    <cc>gsnedders</cc>
    
    <cc>jbedard</cc>
    
    <cc>repstein</cc>
    
    <cc>ryanhaddad</cc>
    
    <cc>slewis</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1997799</commentid>
    <comment_count>0</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2023-12-07 15:21:52 -0800</bug_when>
    <thetext>A recent patch of mine (271692@main) was meant to credit not just me as the author but a colleague as well. We used `Co-authored-by` as specified in https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors and this looked fine in the PR’s commits tab, but once the patch landed, the last line of the commit became the `Canonical link` and thus the co-author credit was no longer picked up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1998773</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-12-11 13:15:58 -0800</bug_when>
    <thetext>AFAIK our tooling requires for canonical link to be the last line, so it wouldn&apos;t be easy to change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1999741</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-12-14 15:22:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/119691076&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2018003</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-03-01 06:55:51 -0800</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #1)
&gt; AFAIK our tooling requires for canonical link to be the last line, so it
&gt; wouldn&apos;t be easy to change.

It isn&apos;t quite a simple as &quot;the last line&quot;, because e.g. git-svn-id appears after it (see 200001@main). I think we might just treat git-svn-id as a special-case though?

At this point when everything is using git, we should just be using git-interpret-trailers, which would also solve the underlying problem.

*However*, git changed their behaviour to disallow whitespace in trailer names in 2016, https://github.com/git/git/commit/e4319562bc2834096fade432fd90c985b96476db, in git 2.12.0, though wasn&apos;t properly documented until 2022, https://github.com/git/git/commit/b46dd1726c139c930d7b4b7c3262e3f2699987d3, git v2.38.0, thus our &quot;apparent&quot; trailer of &quot;Canonical Link&quot; is no longer a valid trailer name.

Our path forward here is probably a multi-step one:

1. Allow *either* a final line of &quot;Canonical Link: XXX&quot; (or followed by a git-svn-id line?) _or_ a &quot;Canonical-Link&quot; trailer in the trailers block.

2. Migrate to outputting a Canonical-Link trailer once we believe (1) has landed long enough ago.

Long term, this would allow us to do things like `git log --pretty=&apos;format:%(trailers:key=Canonical-Link)&apos;` once we rarely care about the history commits with a space.

That said, different vendors may have their own tooling hard-coding &quot;Canonical Link&quot; which would also need changed (e.g. Apple&apos;s perf infrastructure apparently does this), so this probably does need some broader communication *especially* before step 2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2018047</commentid>
    <comment_count>4</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2024-03-01 10:39:44 -0800</bug_when>
    <thetext>I&apos;m not sure whether we intended the &quot;Canonical Link&quot; line to be a trailer and got the format wrong, or whether we did not design it with trailers in mind. But regardless, it&apos;s *so close* to a well-formed trailer that I would appreciate it being fixed up.

That said, I don&apos;t think we have ever made a &quot;breaking&quot; change to the commit metadata format since the project migrated to Git. It&apos;s possible that this isn&apos;t useful enough to merit such a break, or that it should wait until we have other changes we want to make to the formatting.

We do already have &quot;Originally-landed-as&quot; which is used during the merge-back process and is a well-formed trailer.

&gt; Our path forward here is probably a multi-step one:
&gt; 
&gt; 1. Allow *either* a final line of &quot;Canonical Link: XXX&quot; (or followed by a git-svn-id line?) _or_ a &quot;Canonical-Link&quot; trailer in the trailers block.
&gt; 
&gt; 2. Migrate to outputting a Canonical-Link trailer once we believe (1) has landed long enough ago.

One thing I&apos;d suggest adding is a period when we write *both* a &quot;Canonical Link&quot; line and a &quot;Canonical-Link&quot; trailer, to help tooling that looks for the former.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2018090</commentid>
    <comment_count>5</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-03-01 12:55:17 -0800</bug_when>
    <thetext>(In reply to Elliott Williams from comment #4)
&gt; One thing I&apos;d suggest adding is a period when we write *both* a &quot;Canonical
&gt; Link&quot; line and a &quot;Canonical-Link&quot; trailer, to help tooling that looks for
&gt; the former.

The trailers by definition come at the end, and we also require the &quot;Canonical Link&quot; to come at the end, so we can&apos;t really do both. One of them will fail to parse as a result.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2052401</commentid>
    <comment_count>6</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-08-13 10:49:22 -0700</bug_when>
    <thetext>(Changing the title so this is more easily found searching for &quot;trailer&quot;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2073636</commentid>
    <comment_count>7</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-11-07 16:05:46 -0800</bug_when>
    <thetext>We currently have &quot;Canonical link&quot; hardcoded in:

Tools/CISupport/ews-build/steps.py
Tools/CISupport/ews-build/steps_unittest.py
Tools/Scripts/git-webkit
Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/canonicalize/message.py
Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/command.py
Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/canonicalize_unittest.py
Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/land_unittest.py
Tools/Scripts/webkitpy/tool/commands/suggestnominations.py
Tools/Scripts/webkitpy/tool/commands/suggestnominations_unittest.py
Tools/glib/apply-build-revision-to-files.py
Websites/perf.webkit.org/tools/sync-commits.py

Some of these are probably pretty easy to change and have confidence the behaviour is correct, others are likely harder.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2157921</commentid>
    <comment_count>8</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2025-11-11 07:32:06 -0800</bug_when>
    <thetext>(In reply to Sam Sneddon [:gsnedders] from comment #7)
&gt; We currently have &quot;Canonical link&quot; hardcoded in:
&gt; 
&gt; [...]
&gt; Tools/glib/apply-build-revision-to-files.py

This one does not need changing: it only reads the commit log messages
to extract the revision identifier from the &quot;Canonical link:&quot; entry.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>