{"thread":{"id":"60516","subject":"Document git status -b --porcelain","startedAt":"2023-11-14T09:14:36Z","lastAt":"2023-11-14T09:14:36Z","messageCount":1,"participants":["Ondra Medek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"484854","messageId":"CAJsoDaFNxEEBuXK1o16NE-JzLeckpWbqxY_vhgqGF7MS-A85jg@mail.gmail.com","threadId":"60516","inReplyTo":null,"subject":"Document git status -b --porcelain","fromName":"Ondra Medek","fromEmail":"xmedeko@gmail.com","sentAt":"2023-11-14T09:14:21Z","receivedAt":"2023-11-14T09:14:36Z","isPatch":false,"sender":{"key":"xmedeko@gmail.com","avatar":"https://gravatar.com/avatar/09ec305680e81ade2e3617fd245cda7136f6d5e859b5120feb9436e0725f6e1d?d=mp&s=160"},"body":"Hi,\n\nI am using \"git status -b --porcelain\" and parsing output in a code.\nHowever, the output is not documented for an empty repository or a\nmissing remote branch. (And maybe a detached head, too).\n\nDoc for Porcelain Format Version 1\n\nhttps://git-scm.com/docs/git-status#_porcelain_format_version_1\n\nreferences doc for Short Format\n\nhttps://git-scm.com/docs/git-status#_short_format\n\nand it says:\n\n> If -b is used the short-format status is preceded by a line\n>   ## branchname tracking info\n\nHowever, when I have a fresh clone or an empty repository, \"git status\n-b --porcelain\" results in:\n\n## No commits yet on master...origin/master [gone]\n\nSo, it seems to me the format is something like \"# [info1\n]branchname...tracking[ info2]\" and it should be documented what infos\nmay appear and when. Otherwise it's hard to write robust parsing of\nsuch output.\n\nThanks\nOndra Medek\n"}]}