Page MenuHomePhorge

Let ArcanistBundle print some Git patch headers
AcceptedPublic

Authored by avivey on Jul 26 2023, 04:36.

Details

Summary

To allow git am to accept patches produced using this, let ArcanistBundle produce the right headers.

Ref T15249.

Test Plan

See D25359.

Diff Detail

Repository
rARC Arcanist
Branch
raw-diff-more-data
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 691
Build 691: arc lint + arc unit

Unit TestsFailed

TimeTest
1,792 msArcanistBundleTestCase::testGitRepository
EXCEPTION (RuntimeException): strlen(): Passing null to parameter #1 ($string) of type string is deprecated #0 /home/avivey/devtools/arcanist/src/parser/ArcanistBundle.php(852): PhutilErrorHandler::handleError(8192, '...', '...', 852) #1 /home/avivey/devtools/arcanist/src/parser/ArcanistBundle.php(432): ArcanistBundle->buildBinaryChange(Object(ArcanistDiffChange), NULL)
1 msArcanistBaseCommitParserTestCase::testBasics
2 assertion(s) passed.
0 msArcanistBaseCommitParserTestCase::testHalt
1 assertion(s) passed.
0 msArcanistBaseCommitParserTestCase::testJump
1 assertion(s) passed.
0 msArcanistBaseCommitParserTestCase::testJumpReturn
1 assertion(s) passed.
View Full Test Results (1 Failed · 74 Passed)

Event Timeline

avivey requested review of this revision.Jul 26 2023, 04:36
src/workflow/ArcanistExportWorkflow.php
206

This is not related, but I was already here. git config ... adds a newline to the output.

src/workflow/ArcanistExportWorkflow.php
206

If the need is to remove a newline, note that trim() removes spaces

src/workflow/ArcanistExportWorkflow.php
206

close enough - email shouldn't have any whitespace in it, afaik.

src/workflow/ArcanistExportWorkflow.php
206

Oh sorry - I'm wrong! trim() as default removes that since always

http://web.archive.org/web/20010215013717/https://www.php.net/manual/en/function.trim.php

And now I have to fix some other trims in other projects...

Thanks again \o/

Note for other people: it is normal that sometime the user's email is not exposed even after this change: for example it happens when uploading a patch from the web interface (since Phorge is nice and respects users' privacy and we do not publish their emails as default).

The problem is, Phorge is nice and may not expose the email as default, but the user cannot add this information later. This is not nice, and this can indeed be discussed to further improvement. For example, allowing users to explicitly mark some personal email addresses as public, and so, we could start exposing them from Differential. Or, adding an explicit "email" field to Differential - but I don't know.

I'm just saying that this is nice as-is. Thanks

This revision is now accepted and ready to land.Aug 20 2023, 07:20