2

Is there a public official (or maybe not) list of git commands, for which --porcelain option is available? Or should I manually review each of them in the porcelain commands list?

I've managed to google the following three:

git status --porcelain
git push --porcelain
git blame --porcelain

But is there any more? And if not, can I find somewhere the information on whether any additional would appear and when?

UPD: So here is the full list of collected currently available commands with --porcelain option (based on the answers below):

git annotate --porcelain
git blame --porcelain
git commit --porcelain
git push --porcelain
git status --porcelain
git worktree list --porcelain

Will try to keep it up-to-date with the new information available. Please if you find any new, leave a response in comments or as an answer.

dumbledad
  • 16,305
  • 23
  • 120
  • 273
Scadge
  • 9,380
  • 3
  • 30
  • 39
  • What are you trying to do? what do you need it for? – CodeWizard Aug 29 '16 at 09:12
  • @CodeWizard Nothing yet, just curious whether there is a full list. I know that in case of parsing it's recommended to use plumbing commands, but the commands with `--porcelain` option also implicitly guarantee the stability. – Scadge Aug 29 '16 at 09:14
  • It will only effect the output to stdout not more than that – CodeWizard Aug 29 '16 at 09:16
  • @CodeWizard I know that too :) I'm not yet doing anything, but I suppose it's easier to use the shorter `--porcelain` option, than compose a probably long plumbing command which would do effectively the same. – Scadge Aug 29 '16 at 09:18
  • 1
    You can always use aliases instead. that's what im doing – CodeWizard Aug 29 '16 at 09:18
  • There is only one more command with the `--porcelain` which is git worktree – CodeWizard Aug 29 '16 at 09:26
  • In the manual there is a "Main porcelain commands" section if it can help. It is not a list of commands accepting the --porcelain option though. – Zermingore Aug 29 '16 at 09:28
  • @J.P.Quenord-Zermingore that's a different thing. – eis Aug 29 '16 at 09:30
  • 1
    Run `git --html-path` to find where the docs are. Then run `grep '\-\-porcelain' *.html` in that folder, which I think can give you the answer. – ElpieKay Aug 29 '16 at 09:32
  • @ElpieKay almost. That will include `git ls-files` which does not have a `--porcelain` option but does have a discussion about `git status --porcelain` in its man page. – dumbledad Jan 18 '18 at 14:55

2 Answers2

3

You can combine:

That will confirm you also have:

git commit --porcelain
git worktree list --porcelain

For more on the meaning of porcelain, see my answer "What does the term “porcelain” mean in Git?"

The meaning of --porcelain here is "produce output suitable for consumption by porcelain scripts".

Note that git blame options can be passed around to other commands. That is why git annotate also has a --porcelain option.

Also, grepping for porcelain in Documentation would return git ls-files, which has not such an option, but refers instead to git-status --porcelain and git-diff-files --name-status as more user-friendly alternatives.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

As far as i know there is no documentation covering it.

Lets explain what it does for all of those who doesn't know so they can learn something new:

--porcelain

Produce machine-readable output.
The output status line for each ref will be tab-separated and sent to stdout instead of stderr.

The full symbolic names of the refs will be given.

More commands:

You can also use git status -z which is equivalent to git status --porcelain

Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • 1
    Actually, the `-z` option rather includes `--porcelain`, than is equivalent. From the docs: "Terminate entries with NUL, instead of LF. This implies the --porcelain output format if no other format is given." – Scadge Aug 29 '16 at 09:45
  • I agree its exactly what it does – CodeWizard Aug 29 '16 at 11:32