News for hackers. Stuff that matters.
Re:Nano 5.7 by jejones3141 on Thursday April 29, 2021 @12:06PM (#26982932)
One thing I've found nano useful for: git commit messages.

If the commit file is empty, that cancels the commit. Nano will tell me how many lines it actually wrote, so if I have second thoughts I can cancel with certainty. Nano may well not be unique in that regard, but I tripped over another editor that saved what I thought was an empty file as a single line with just the EOL character.

Re:Nano 5.7 by MayeulC on Thursday April 29, 2021 @01:57PM (#26984295)
I like to quit vim with a non-zero return value in some exceptional cases. git and most other tools will interpret this as "something bad happened" and won't do anything further

    :cq
Re:Nano 5.7 by jolmg on Thursday April 29, 2021 @12:16PM (#26983056)
You can have a bunch of comments and empty lines, even with spaces, and git will still abort if you don't have anything else in the commit message. An EOL/newline character shouldn't cause the commit to continue.
Re:Nano 5.7 by chungy on Thursday April 29, 2021 @01:27PM (#26983973)
There are overrides to make empty messages or including otherwise-comments, but yeah... you have to do such things rather explicitly. No way you can do it by accident.
Re:Nano 5.7 by jolmg on Thursday April 29, 2021 @02:55PM (#26985013)
But none accept a single newline as a message while at the same time rejecting truly empty messages.
Re:Nano 5.7 by hiq on Thursday April 29, 2021 @12:44PM (#26983421)
I rarely write commit messages until they're ready, so I usually :q! when I realize I actually don't want to commit just yet.