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.

Needless to say, I've never done this before.

From: llvm-dev <llvm-dev-bounces@lists.llvm.org> On Behalf Of Paul C.
Anagnostopoulos via llvm-dev
Sent: Thursday, January 28, 2021 10:45 AM
To: llvm-dev@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.

Once it's committed, do the usual build/test/push.

HTH,
--paulr

And make sure the Differential Revision line has exactly one space between the colon and the URL.

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.

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@quicinc.com AI tools development

From: llvm-dev <llvm-dev-bounces@lists.llvm.org> On Behalf Of via llvm-dev
Sent: Thursday, January 28, 2021 10:01 AM
To: paul@windfall.com; llvm-dev@lists.llvm.org
Subject: [EXT] Re: [llvm-dev] Pushing a patch for someone else

From: llvm-dev <llvm-dev-bounces@lists.llvm.org> On Behalf Of Paul C.
Anagnostopoulos via llvm-dev
Sent: Thursday, January 28, 2021 10:45 AM
To: llvm-dev@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: Login

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, Login 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.