* Document git status -b --porcelain
@ 2023-11-14 9:14 Ondra Medek
0 siblings, 0 replies; only message in thread
From: Ondra Medek @ 2023-11-14 9:14 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-14 9:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-14 9:14 Document git status -b --porcelain Ondra Medek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).