#294 Better display commit messages
Closed: Fixed None Opened 8 years ago by bochecha.

See this for example:

https://pagure.io/fork/bochecha/fedpkg/e972bf24b1ea23222f7349096a9661628bcb8e5b

The original commit message was:

    Drop obsolete functions

    These functions are now completely unused.

    They were overridden from pyrpkg to use our client-side and custom CA
    certificates.

    However, pyrpkg now handles that on its own with its new
    pyrpkg.lookaside module, all we need to do in fedpkg is define our
    fedpkg.Commands.cert_file and fedpkg.Commands.ca_cert properties...
    which we've been doing since forever already.

The first line is properly extracted as a title for the commit. This is great! :smile:

However, the rest of the message is all put together as a single line, because HTML eats whitespace.

There are a few ways ot fix this:

  • put the commit message into a <pre> container
  • put the commit message into a <div> container with white-space: pre; in its CSS
  • pass the commit message through Markdown, which will parse paragraphs (along with **emphasis**, etc...)

The third option has the most potential to make things look fantastic. However, it also has the most potential to break things for people who don't format their commit message perfectly.


@jcvicelli, this is looking great!
The only thing I was wondering is if we could find a way to reduce the margin/padding on the left side. If you are not interested in this question let me know, we can find something else for you :)

Such a simple patch! :thumbsup:

Sure, I'll take a look. Another thing that I noticed is if you are using a dark theme on gnome, you can't see what you are typing on the text areas.....

@jcvicelli ok found the cause, the spaces added by the template are the problem.

So removing some (not all) of the spaces in the template before the {{ message}} solves a part and using {%- (note the -) in the for and if blocks above cleans another part of the spaces added.

@pingou, it was not necessary, I've just changed text-align from pre to pre-line on the css and it worked!
white-space: pre-line;
according to w3schools site(http://www.w3schools.com/cssref/pr_text_white-space.asp)
Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary, and on line breaks

Oh that might be even easier, I'll check this but cool! :)

Ok I adjusted your patch and pushed it, thanks for fixing this!

Login to comment on this ticket.

Metadata