# Document git status -b --porcelain

1 messages from 2023-11-14 to 2023-11-14. Participants: Ondra Medek.
Thread: https://gitlist.dev/t/60516

## Ondra Medek, 2023-11-14 09:14

Subject: Document git status -b --porcelain
Message-ID: <CAJsoDaFNxEEBuXK1o16NE-JzLeckpWbqxY_vhgqGF7MS-A85jg@mail.gmail.com>
URL: https://gitlist.dev/e/CAJsoDaFNxEEBuXK1o16NE-JzLeckpWbqxY_vhgqGF7MS-A85jg%40mail.gmail.com

```
Hi,

I am using "git status -b --porcelain" and parsing output in a code.
However, the output is not documented for an empty repository or a
missing remote branch. (And maybe a detached head, too).

Doc for Porcelain Format Version 1

https://git-scm.com/docs/git-status#_porcelain_format_version_1

references doc for Short Format

https://git-scm.com/docs/git-status#_short_format

and it says:

> If -b is used the short-format status is preceded by a line
>   ## branchname tracking info

However, when I have a fresh clone or an empty repository, "git status
-b --porcelain" results in:

## No commits yet on master...origin/master [gone]

So, it seems to me the format is something like "# [info1
]branchname...tracking[ info2]" and it should be documented what infos
may appear and when. Otherwise it's hard to write robust parsing of
such output.

Thanks
Ondra Medek

```
