Opened on 05/25/2016 at 12:54:56 PM

Closed on 05/27/2016 at 08:16:39 AM

#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.

Attachments (0)

Change History (7)

comment:1 Changed on 05/25/2016 at 01:14:59 PM 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 on 05/25/2016 at 01:16:05 PM by sebastian

comment:2 Changed on 05/25/2016 at 04:02:37 PM by kvas

  • Description modified (diff)

You're right. Issue updated.

comment:3 Changed on 05/25/2016 at 04:06:02 PM by sebastian

  • Priority changed from Unknown to P3
  • Ready set

comment:4 Changed on 05/25/2016 at 05:15:28 PM by kvas

  • Owner set to kvas

comment:5 Changed on 05/25/2016 at 05:15:41 PM by kvas

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

comment:6 Changed on 05/27/2016 at 08:15:08 AM by abpbot

comment:7 Changed on 05/27/2016 at 08:16:39 AM by kvas

  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from kvas.
Note: See TracTickets for help on using tickets.