[RFC] Blank lines at the end of files
Martin
gzlist at googlemail.com
Fri Jun 29 09:56:25 BST 2007
On 29/06/07, Martin Pool <mbp at sourcefrog.net> wrote:
> On 6/29/07, Andrew Bennetts <andrew at canonical.com> wrote:
> > John Arbash Meinel wrote:
> > >
> > > I've noticed Aaron comment on blank lines at the end of files. I wasn't
> > > aware that it was a strict requirement/anything we have ever discussed.
> > >
> > > Obviously Aaron feel like they shouldn't be there. I don't really care.
> >
> > I basically don't care. I've never seen their presence or absence have any
> > significant effect on anything. In my own code I tend to have them, but out of
> > habit rather than for a reason.
> >
> > I can't see a reason for caring either way, so I can't see a reason to even
> > standardise on whether not they should be there. It just doesn't matter AFAICT,
> > so I'd be happiest not caring about it (both as a developer and as a reviewer).
> > That is, not only do I not mind if we have them or not, I don't mind if we're
> > inconsistent.
>
> I don't care much about them either. I use vim so it's visible if
> they're there. I do tend to trim them, but on the other hand I would
> probably be slightly unhappy if a patch was knocked back only because
> it had trailing newlines.
On 28/06/07, John Arbash Meinel <john at arbash-meinel.com> wrote:
> I've noticed Aaron comment on blank lines at the end of files. I wasn't
> aware that it was a strict requirement/anything we have ever discussed.
>
> Obviously Aaron feel like they shouldn't be there. I don't really care.
> For me, I feel like they actually 'terminate' the file, rather than
> ending in the middle of a sentence. Maybe I'm just used to other
> languages where you have a closing brace. But without the trailing
> newline, it actually feels like the file isn't finished yet.
>
> I'm not pushing strongly, but I would like to have at least discussed it
> as a project, so we are all thinking along the same lines.
>
> John
I am confused by this conversation. From a \r\n is-a-line-seperator
perspective, there's always a blank line at the end of the file. But
everyone is on the \n is-a-line-terminator side surely, so this is a
debate just about \n vs. \n\n+ as terminal bytes which... does seem
trivial.
Isn't the real issue that diff histories with lots of meaningless
changes back and forth are bad? No one accidentally renames every
variable whenever they make a change to a file, or has an editor that
renames variables without them noticing, but that is the case with
spacing characters. Hence wars around tabs and spaces and style guides
that need to be super-specific about how to space things correctly.
Solving ancient problems like these is probably beyond the job of a
version control system, but couldn't at least this one be resolved a
la <http://bazaar-vcs.org/LineEndings> suggestions with something like
a NormaliseFileTrailingSpace rule?
Martin
More information about the bazaar
mailing list