14

I'm trying to configure a phabricator instance, and I find that change the arcanist default template when we use arc diff can be very useful for the team.

Actually the template contains this text:

<<Replace this line with your Revision Title>>

Summary: 

Test Plan: 

Reviewers: 

Subscribers: 


# Tip: Write "Fixes T123" in your summary to automatically close the
# corresponding task when this change lands.

# NEW DIFFERENTIAL REVISION
# Describe the changes in this new revision.
#
# arc could not identify any existing revision in your working copy.
# If you intended to update an existing revision, use:
#
#   $ arc diff --update <revision>

I'm googling to find any way to change this default template, but I can't find it...

There is any way to "personalize" this template?

Ruben Aguilar
  • 1,205
  • 11
  • 19
  • 2
    I have added a bugreport for this upstream: https://secure.phabricator.com/T12276 – milianw Feb 18 '17 at 01:14
  • Any progress on this? It looks like they marked as duplicate of a rather unrelated task, then just sort of closed it after being mean to you. We also feel the need for custom arc commit messages. – youngmit Nov 06 '19 at 19:40
  • No progress :( I Stopped working with Arcanist two years ago – Ruben Aguilar Nov 19 '19 at 22:28

1 Answers1

0

As reported in Phabricator Task T12276 by a question from user @milianw, actually it seems there is not the ability to customize the commit message.

This is the official reason:

Please keep in mind Phabricator is an enterprise tool, and the majority of installs (99%) are businesses who rely on the accountability we've built into the software.

chad, Feb 18 2017, 11:55 PM

Anyway I tried to explore the class DifferentialCommitMessageField and I've found this method producing the list of all available fields:

  final public static function getAllFields() {
    return id(new PhutilClassMapQuery())
      ->setAncestorClass(__CLASS__)
      ->setUniqueMethod('getCommitMessageFieldKey')
      ->setSortMethod('getFieldOrder')
      ->execute();
  }

And look at all the class that are inheriting DifferentialCommitMessageField. Some of them:

  • DifferentialTagsCommitMessageField
  • DifferentialSubscribersCommitMessageField
  • DifferentialAuditorsCommitMessageField
  • DifferentialReviewedByCommitMessageField
  • DifferentialTestPlanCommitMessageField
  • DifferentialTitleCommitMessageField
  • DifferentialSummaryCommitMessageField
  • ...

So maybe you can customize a field changing the related class. You can change some default values, or you can try disabling a field declaring this method in one of these classes:

  /**
   * This method is inherited from DifferentialCommitMessageField
   *
   * @override
   */
  public function isFieldEnabled() {
    // return true;
    return false
  }

In short you can try to extend Phabricator to do it. Currently this feature is not a priority for their general enterprise use cases.

Anyway, do not forgot that Phabricator is a Free/Libre and Open Source software. You have all the rights to play with the code and make some improvements. If you are really interested in this feature and you have the possibility to add this customization feature, some users may be interested in your patch, so you may also consider to propose your changes to upstream, if it works and does not introduce regressions.

Valerio Bozz
  • 1,176
  • 16
  • 32