Homebrew/homebrew — pull request #25230 by chrisk (2013-12-15 17:08:34+00:00)
Title: doctor: check for uncommitted local changes is tripped up by certain user gitconfig settings

I have my `~/.gitconfig` set up so that `git status` defaults to `--short` and `--branch`:

```toml
[status]
short = true
branch = true
```

...which looks like this:

```bash
/usr/local $ git status
## master
M Library/Homebrew/cmd/doctor.rb
/usr/local $
```

Meanwhile, `brew doctor` has a check for uncommitted modifications to Homebrew that relies on whether or not the output of `git status -s` is empty. My `git status` prints e.g. `## master` by default, which trips up the check.

`git status` has a `--porcelain` option for just this situation, so this patch switches the `brew doctor` check to use that. From `git-status(1)`:

> The porcelain format is similar to the short format, but is guaranteed not to change in a backwards-incompatible way between Git versions or based on user configuration. This makes it ideal for parsing by scripts. The description of the short format above also describes the porcelain format, with a few exceptions:
>
> 1. The user’s color.status configuration is not respected; color will always be off.
>
> 2. The user’s status.relativePaths configuration is not respected; paths shown will always be relative to the repository root.

While testing this, I found a git config setting that still affects `--porcelain`, `status.showUntrackedFiles`. I don't know if that's intentional or not, but I went ahead and added `--untracked-files=all` to our check to override it.