Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit message editor lies about line breaking when a line is prefixed with "Word: " #257

Closed
ghost opened this issue May 19, 2014 · 1 comment

Comments

@ghost
Copy link

ghost commented May 19, 2014

I tested the following: start the first line of the commit message body (i.e. not the subject) with something like Word: bla bla...., and make that more than 80 characters. The commit message editor will display the text as line-broken. So far this is exactly as expected.

Then press the commit button, and inspect the commit log with some other tool, like git log. You will find that the commit message wasn't actually line-broken, and doesn't contain any line breaks.

If you add a second paragraph (that doesn't contain any :), this paragraph will still be line-broken correctly.

Observed with git-cola v2.0.1 (debian unstable package).

@davvid
Copy link
Member

davvid commented May 21, 2014

Yeah.. this is cos we interpret those as special tags that shouldn't be wrapped. e.g. Signed-off-by:, Tested-by:, Reported-by:, etc. in cola/textwrap.py

# Acked-by:, Signed-off-by:, Helped-by:, etc.
special_tag_rgx = re.compile('^[a-zA-Z_-]+:')

The heuristic is probably too greedy right now. If possible, it'd be better to explicitly list the ones tags that it should special-case (and maybe later add a config knob to allow us to extend them) rather than assuming that all foo: lines shouldn't be wrapped.

@davvid davvid closed this as completed in c1c949d May 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant