In Bugmail & Bug History for User Story edits, there's a warning about "\ No newline at end of file" for user-entered values, even though the submitted value included a trailing newline
Categories
(bugzilla.mozilla.org :: Bug Creation/Editing, defect)
Tracking
()
People
(Reporter: dholbert, Assigned: dkl)
Details
User Story
abc def ghi
Attachments
(6 files)
STR (based on observations so far; haven't directly tested yet)
- Expand the User Story section for some bug.
- Type in a few lines of text to the User Story, being sure to end with a newline.
- Submit your changes.
- Look at the bugmail that you receive for the change.
ACTUAL RESULTS:
The bugmail shows \ No newline at end of file
at the end of the line that represents the diff for the change to the User Story field.
EXPECTED RESULTS:
No warning about no newline at end of file; that seems to not be an accurate representation of the user-submitted change.
I noticed this most recently for denschub's update on https://bugzilla.mozilla.org/show_bug.cgi?id=1891380#a64528_421268 , where he's sure he copypasted the new User Story
value from a tool that includes a newline at the end; and yet, the bugmail has a warning about "No newline at end of file".
Reporter | ||
Updated•1 year ago
|
Reporter | ||
Comment 1•1 year ago
|
||
To test this, I'm updating this bug's user story field; I typed in the following (with a trailing newline after def
):
abc
def
Reporter | ||
Updated•1 year ago
|
Reporter | ||
Comment 2•1 year ago
|
||
Reporter | ||
Comment 3•1 year ago
|
||
Reporter | ||
Comment 4•1 year ago
•
|
||
My edit in comment 1 did successfully trigger the bug, as shown in screenshots.
I'm making one further edit (adding ghi[newline]
) to see if additional edits to the user story still show the problem, or if it's only the first edit.
Reporter | ||
Comment 5•1 year ago
|
||
This is worse for cases where we edit the User Story in-place; it shows "No newline at end of file twice" (for the field's old contents as well as new contents, I guess).
So:
- Bugzilla seems to be stripping the newline itself (I did include one in the values that I submitted)
- And then Bugzilla is warning about a newline not being present.
- Twice per message, in some cases (as in this screenshot)
Reporter | ||
Comment 6•1 year ago
|
||
This same warning shows up in the bug history (i.e. at https://bugzilla.mozilla.org/show_activity.cgi?id=1891527 ) , as shown in this screenshot, too.
Reporter | ||
Comment 7•1 year ago
|
||
A few possible remedies that come to mind here:
(1) don't strip newlines at the end of the user story; or at least, leave 1 behind when we're stripping them. (Maybe even insert one manually, as part of whatever post-processing we're doing?)
Or:
(2) To generate the diff that we're showing in email and Bug History, use a diff command that ignores trailing newlines.
(remedy #1 is probably preferable, unless there's some important reason that we need that trailing newline to be removed...)
Reporter | ||
Updated•1 year ago
|
Reporter | ||
Updated•1 year ago
|
Comment 8•1 year ago
|
||
Updated•1 year ago
|
Assignee | ||
Comment 9•1 year ago
|
||
Description
•