# Explicitly add new lines in message content

**URL:** <https://discourse.slicer.org/t/explicitly-add-new-lines-in-message-content/141>\
**Category:** Development\
**Created:** [April 18, 2017, 7:08pm UTC](https://discourse.slicer.org/t/explicitly-add-new-lines-in-message-content/141 "2017-04-18T19:08:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 18, 2017, 7:08pm UTC](https://discourse.slicer.org/t/explicitly-add-new-lines-in-message-content/141/1 "2017-04-18T19:08:28Z")

</div>

To facilitate reading of history using either `git log`, `gitk`, … I suggest we consistently format commit messages by explicitly adding newlines.

### without newlines:

 ![](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/0/700c6685e325e1fbe226d4a0a28a8b16949a137c.png)

### with newlines

 ![](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/2/72a73e6abca92394e2ad78c633b5d46c1ff452b5.png)

 ![](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/2/329312df04a106a526debe9415085105c7f6be03.png)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [April 18, 2017, 9:28pm UTC](https://discourse.slicer.org/t/explicitly-add-new-lines-in-message-content/141/2 "2017-04-18T21:28:44Z")

</div>

Is there a commit hook that can do that?

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 18, 2017, 9:33pm UTC](https://discourse.slicer.org/t/explicitly-add-new-lines-in-message-content/141/3 "2017-04-18T21:33:31Z")

</div>

Not that I am aware.

Using `git gui` (or any git frontend) should allow to easily format the message before running `git svn dcommit`.

Text editor like vim, emacs can also be configured to wrap lines while editing.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 18, 2017, 10:24pm UTC](https://discourse.slicer.org/t/explicitly-add-new-lines-in-message-content/141/4 "2017-04-18T22:24:40Z")

</div>

I like that I can take advantage of whatever screen size I have (if I make my window wider I see longer lines) and adding line breaks manually is a chore, but if everybody prefers short lines then I’m OK with it.

We have some hooks for checking commit message format (starts with ENH: …) but maybe that’s only for SVN?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [April 18, 2017, 10:34pm UTC](https://discourse.slicer.org/t/explicitly-add-new-lines-in-message-content/141/5 "2017-04-18T22:34:59Z")

</div>

> [@jcfr](#):
>
> (or any git frontend) should allow to easily format the message

Not true for TortoiseGit, which is the one I use (and most of the Windows people I know).

In general I find these limitations about line length unreasonable, especially introducing new ones. That said I can hit enter once in a while if that’s what the community requires.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [April 19, 2017, 12:34pm UTC](https://discourse.slicer.org/t/explicitly-add-new-lines-in-message-content/141/6 "2017-04-19T12:34:49Z")

</div>

Just one more note here. I think the deficiency of the Git GUI application is not that it doesn’t hard-break the lines, but that it doesn’t wrap them when displaying. For example this is how I see it:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/4/3420223ca34f11fe265c042eb8c27dcaae9b8faf.png)
