akalongman/sublimetext-codeformatter

Exclude files that are from scratch

Open

#259 opened on Sep 2, 2016

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Python (133 forks)batch import
Hacktoberfest

Repository metrics

Stars
 (775 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I've aliased Sublime Text as my editor for terminal stuff, so when I create a commit, it's opened in Sublime Text for me to write the commit message. This works great, except CodeFormatter throws an error when it opens, "File is From Scratch".

Is there any way to disable that error/notification in these sort of circumstances?

EDIT: steps to reproduce:

  1. set Sublime as your primary editor for Git via the following guide: https://help.github.com/articles/associating-text-editors-with-git/#using-sublime-text-as-your-editor
$ git config --global core.editor "subl -n -w"
  1. modify an existing git repository and commit your changes:
git add .
git commit

( this should open sublime for you to write the commit message. )

  1. hit save (I'm on mac so cmd + s). The error from these lines of the plugin will be thrown.

The save / commit are successful, however the error is really annoying and ruins my workflow ( I have a dedicated virtual desktop for my terminal and the error message causes the active desktop to fling back to my editor ).

This also occurs on save if you amend a commit message (git commit --amend)

Contributor guide