[llvm-dev] Pushing a patch for someone else

Fangrui Song via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 28 17:10:22 PST 2021


On 2021-01-28, Krzysztof Parzyszek via llvm-dev wrote:
>> You want to add two lines to it:
>>
>> Patch by <name of author>
>
>You can just set the original author in the commit.  Git distinguishes between the author and the committer.
>
>
>--
>Krzysztof Parzyszek  kparzysz at quicinc.com   AI tools development
>
>-----Original Message-----
>From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of via llvm-dev
>Sent: Thursday, January 28, 2021 10:01 AM
>To: paul at windfall.com; llvm-dev at lists.llvm.org
>Subject: [EXT] Re: [llvm-dev] Pushing a patch for someone else
>
>
>
>> -----Original Message-----
>> From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Paul C.
>> Anagnostopoulos via llvm-dev
>> Sent: Thursday, January 28, 2021 10:45 AM
>> To: llvm-dev at lists.llvm.org
>> Subject: [llvm-dev] Pushing a patch for someone else
>>
>> Could someone explain the best way to push a patch for someone else? I
>> don't use Arcanist, but add the Differential Revision line by hand.
>> Please include the method of downloading the person's patch to my machine.
>
>It's a bit of a manual process given that we don't use branches and a pull-request model as GitHub favors, but it's not hard.
>I don't think I've done this myself since the move to github so I might be missing a step, hopefully others will chime in to fix my mistakes.
>
>Assuming the patch is in a Phabricator review, there should be a "Download Raw Diff" link on the right-hand side at the top.  This, oddly enough, should download a diff file, which you can then apply to your working tree with "patch" or similar utility.
>
>What I do then is copy the summary into a text file, making sure the formatting looks reasonable.  You want to add two lines to it:
>
>Patch by <name of author>
>
>Differential Revision: https://reviews.llvm.org/Dxxxxx
>
>filling in the author and actual review number.  Make sure there's a blank line before the Differential Revision line.
>
>Then you commit this as usual, but add the --author option to provide (I think) the email address of the author.  (This might be redundant with the "Patch by" information, so the current practice might be to leave out "Patch by", not sure.)  And of course -F to specify the file where you put the commit message.

The current practice is to use `git commit --amend --author=....`
https://llvm.org/docs/DeveloperPolicy.html#commit-messages
There should be no `Patch by`.

Personally I use `git commit --amend --date=now` to reset the author date to commit date.
The author dates most just serve as a confusion source.

Many things can change between when the author asked you to commit and
when you push the commit, so last-minute testing is important.

When committing on behalf of others (new contributors), it is common
that the messages need to be adjusted.

"Differential Revision: " is important. It makes the commit connect to
the Differential and closes the Differential automatically.



If you use arc, arc patch Dxxxxx can download the Differential.
If the author supplied authorship, then you don't need --amend --author.

If you don't use arc, https://reviews.llvm.org/settings/user/$user/page/apitokens/ can give a CLI token.

   curl https://reviews.llvm.org/api/differential.getrawdiff -d api.token=cli-.... -d diffID=xxxxxx (currently the number is larger than 320000; you can get the ID in "Revision Contents - History")

can download the raw diff.

>Once it's committed, do the usual build/test/push.
>
>HTH,
>--paulr
>
>>
>> Needless to say, I've never done this before.
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://urldefense.com/v3/__https://lists.llvm.org/cgi-
>> bin/mailman/listinfo/llvm-
>> dev__;!!JmoZiZGBv3RvKRSx!tzZMDG77DN4la7BtUuhj60VZ9kl3C0IjWwiVXob43-
>> plBKeksKvrSBLMQZZzx0ZT0Q$
>_______________________________________________
>LLVM Developers mailing list
>llvm-dev at lists.llvm.org
>https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>_______________________________________________
>LLVM Developers mailing list
>llvm-dev at lists.llvm.org
>https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list