Opened 4 years ago

Closed 4 years ago

#4070 closed defect (fixed)

Mercurial commit hook produces broken markup if the commit message is more than one line long

Reported by: kvas Assignee: kvas
Priority: P3 Milestone:
Module: Sitescripts Keywords:
Cc: kzar, sebastian Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by kvas)


The issue affects mercurial commit hook installed on most repositories of

How to reproduce

Create and push a commit that references an issue with multiline commit message.

Observed behaviour

The comment that is created in the issue has broken markup. See for example this comment in #4057.

Expected behaviour

Only the first line of the commit message should be used to render the link in the issue comment. If the second line is non-empty, an ellipsis ("...") should be added to the first line to indicate that there's a continuation (if the last character of the first line is a period, it should be replaced with the ellipsis instead). If the second line is empty, the first line is assumed to be a short summary of the whole commit message and the ellipsis should not be added.

Change History (7)

comment:1 Changed 4 years ago by sebastian

There are two kind of multiline commit messages:

  1. Those that are wrapped to avoid long lines:
    Issue 1234 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur
    suscipit est urna, nec pretium arcu auctor nec. Nam hendrerit, arcu eu volutpat
    rhoncus, ipsum dui iaculis diam, quis volutpat diam diam nec dolor.
  1. Those that have a second paragraph with additional information:
    Issue 1234 - Changed A to B
    Due to issue C with A it had to be changed to B for compatibility with D.

I think as for 1. we should replace the subsequent line with an ellipsis to indicate that there is more, otherwise it reads weird or the commit message might even be misinterpreted. However for 2. I think we can simply omit the subsequent lines without any indication. Do you agree, or do I overthink it?

Last edited 4 years ago by sebastian (previous) (diff)

comment:2 Changed 4 years ago by kvas

  • Description modified (diff)

You're right. Issue updated.

comment:3 Changed 4 years ago by sebastian

  • Priority changed from Unknown to P3
  • Ready set

comment:4 Changed 4 years ago by kvas

  • Owner set to kvas

comment:5 Changed 4 years ago by kvas

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:7 Changed 4 years ago by kvas

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.