Page MenuHomePhorge

Fix Arcanist commit in PHP 8.1 (Subversion)
Closed, ResolvedPublic

Description

Premising that `arc commit" is a beautiful Workflow dedicated to Subversion repositories,

I tried it at work, causing the usual PHP 8.1 deprecation warning:

$ arc diff
$ arc commit
[2023-12-14 17:02:54] ERROR 8192: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated at [/home/boz/personal/arcanist/src/workflow/ArcanistWorkflow.php:1520]
arcanist(head=master, ref.master=e46025f7a914)ave and exit.
  #0 preg_replace(string, string, NULL) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1520]
  #1 ArcanistWorkflow::normalizeRevisionID(NULL) called at [<arcanist>/src/workflow/ArcanistCommitWorkflow.php:68]
  #2 ArcanistCommitWorkflow::run() called at [<arcanist>/scripts/arcanist.php:427]
Usage Exception: Unable to identify the revision in the working copy. Use '--revision <revision_id>' to select a revision.

It seems there is a function that always normalizes the Revision ID, but sometime that is unknown (null):

https://we.phorge.it/source/arcanist/browse/master/src/workflow/ArcanistCommitWorkflow.php;e46025f7a9146f9918bab9d6fbdf6ed1816db5b5$68

And so, NULL ends inside a preg_replace():

https://we.phorge.it/source/arcanist/browse/master/src/workflow/ArcanistWorkflow.php;e46025f7a9146f9918bab9d6fbdf6ed1816db5b5$1519-1521

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.