From: Ondra Medek <xmedeko@gmail.com>
To: git@vger.kernel.org
Subject: Document git status -b --porcelain
Date: Tue, 14 Nov 2023 10:14:21 +0100 [thread overview]
Message-ID: <CAJsoDaFNxEEBuXK1o16NE-JzLeckpWbqxY_vhgqGF7MS-A85jg@mail.gmail.com> (raw)
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
reply other threads:[~2023-11-14 9:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJsoDaFNxEEBuXK1o16NE-JzLeckpWbqxY_vhgqGF7MS-A85jg@mail.gmail.com \
--to=xmedeko@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).