Page MenuHomePhabricator

Modularize the pipeline for producing final commit messages
Open, WishlistPublic

Description

Various installs would like to have more control over final commit message formatting:

  • (Original Here) Expand all object references into full object names.
  • (T11739) Render field headers above field bodies.
  • (T11740) Wrap text to 80 characters.

We could conceivably modularize message production to support this (either on the client after T10329, or on the server, but probably after T10945).


Original Description

Eg., if you have a commit message that says:

"Fixes {T123}"

It would flatten the remarkup into:

"Fixes T123 - This is a horrible bug title"

Also, you could do other remarkup flattening, like turn:

"---"

Into:

"----------------------------------------------------------------------------------------"

And turn remarkup tables into something that looks nice in ascii.

@tonygrue requested this, so I'll let him comment if I haven't captured the request well :p.

Event Timeline

One other proposal, suggested by @euresti:

arc start T235
That would create a new branch task-name-here-t235, open up the editor but it's been populated with
Fix T235 - Task Name Here

Summary: <Enter Summary>

And it would do the starting commit for you.

When you do arc diff you can edit the commit message.
Then when you arc land everything gets closed automatically.

I would comment that the creating the new branch could also be create a new bookmark. Whatever the workflow desires.

Another cool thing about this is that you can start working on the default branch and then when you've got something you say

arc start T123

and it will do all of the above.

However I'm not a big fan of the word start. Maybe it should be

arc fix T123

to be clearer.

I split the start thing into T2928 -- this feature already exists (arc feature T123) but doesn't have integrations and I believe start would be a better name (feel free to go champion fix instead on T2928, but I think it's a poor fit for the functionality; note that you could always arc alias fix start).

epriestley triaged this task as Wishlist priority.Apr 9 2013, 4:12 PM

On the original issue by @tonygrue:

Currently, we don't flatten/render remarkup in commit messages. We have the capability to render remarkup into plain text (as of very recently) but it is nascent and doesn't yet address all the rules. We'd need to improve this before we could really do something reasonable with this feature, although such improvements are on the roadmap anyway (in order to improve plain text email).

Flattening remarkup in arc land decreases the utility of Diffusion, which renders remarkup in commit messages. (If we flatten {T123}, it will no longer embed; if we flatten tables they will no longer display nicely, if we flatten <hr> and headers they won't present properly, etc), which is why we don't do it. That said, I think it's not completely unreasonable to add a flag which causes arc land to render remarkup into text mode for installs that don't like Diffusion.

A concrete problem with expanding Fixes T123 into Fixes T123 Task Tee One Two Three is that the Fixes syntax accepts multiple arguments, so a task named T124, T125 would trigger all of T123, T124 and T125 to close. Similarly, Fixes T123, T124, T125 would become unparseable after expansion without extra escaping, and trigger only T123 to close. So we would either need to expand with escaping (which sort of defeats the original point?) or expand as a footnote (which maybe also defeats the original point?). This also makes expansion more difficult in general, because we need to capture the Fixes syntax as a remarkup rule when rendering.

So, while this is plausible, it's really complicated, involves a bunch of tradeoffs, and we end up with an optional feature of debatable value. We'll move closer to being able to implement it anyway, but I'd like to see broader demand for it before building it.

@tonygrue, is arc start good enough for your needs? seems reasonable to me... :)

epriestley renamed this task from Flatten remarkup back into commit messages on arc amend/land to Modularize the pipeline for producing final commit messages.Oct 6 2016, 5:48 PM
epriestley updated the task description. (Show Details)
epriestley changed the visibility from "All Users" to "Public (No Login Required)".
epriestley changed the edit policy from "All Users" to "Community (Project)".
epriestley added subscribers: oliverhenshaw, chad, eadler.

I merged T11740 and T11739 here since they're approximately the same problem from our perspective ("make messages adhere to project rules, where the project rules are immutable").

To date, each request (reference expansion, header formatting, wrapping) benefits approximately one install and there aren't clear objective motivations for these behaviors that would benefit a wider set of projects, so I don't expect to build any of this in the near future. If these features are important in the short term, your best bet is to fork Phabricator.