Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which are the plumbing and porcelain commands?

Tags:

git

For git commands there is this distinction between "plumbing" and "porcelain" commands. How can I determine what would be classified as a plumbing one or a porcelain one? i.e. What is the border line that allows me to differentiate?

I'm not asking what a porcelain or plumbing command is, but rather how, given a command, I can say which type it is.

like image 571
zer0uno Avatar asked Oct 04 '16 08:10

zer0uno


People also ask

What are porcelain commands?

Porcelain commands are designed for human consumption, as opposed to commands whose output is easy for computers to parse.

What is Git plumbing command?

Git divides commands into porcelain and plumbing. Porcelain is the ceramic material usually used to make sinks or toilets, while plumbing is the actual pipes carrying the water. The porcelain fixtures provide a human-friendly interface to the plumbing.


1 Answers

As blue112 noted, the dividing line is fuzzy. The very first documentation page, however, has an explicit list (and as R.M. notes below, one primary criterion is, or at least is supposed to be, stability of interface—for which some nominally-porcelain commands have --porcelain1 to force a more stable and/or more machine-readable output). You can choose to use their list, or decide that some commands are too high level to be low level, or too low level to be high level. For instance you might disagree that git apply is a plumbing command, yet the Git page says it is. Or, you might consider things like git fast-import to be something you would only use inside a script.

Edit, 31 May 2020: The Git documentation has changed since 2016 to reassign commands to new sections; the data below are now out of date. Consult the documentation for your own Git version (via git help git for instance) to see what your own system says. See also VonC's answer with a link to a 2018 change to the documentation.

The list below is simply extracted from the documentation, with descriptions and additional classifications stripped to leave only "porcelain" vs "plumbing". (Sub-classifications remain visible as inversions in the alphabetic sort order. I did not construct links for each entry, as this would be considerably more difficult with StackOverflow markdown—this just needed a simple <pre>...</pre> wrapper.)

porcelain

 git-add                 git-rebase              git-cherry git-am                  git-reset               git-count-objects git-archive             git-revert              git-difftool git-bisect              git-rm                  git-fsck git-branch              git-shortlog            git-get-tar-commit-id git-bundle              git-show                git-help git-checkout            git-stash               git-instaweb git-cherry-pick         git-status              git-merge-tree git-citool              git-submodule           git-rerere git-clean               git-tag                 git-rev-parse git-clone               git-worktree            git-show-branch git-commit              gitk                    git-verify-commit git-describe            git-config              git-verify-tag git-diff                git-fast-export         git-whatchanged git-fetch               git-fast-import         gitweb git-format-patch        git-filter-branch       git-archimport git-gc                  git-mergetool           git-cvsexportcommit git-grep                git-pack-refs           git-cvsimport git-gui                 git-prune               git-cvsserver git-init                git-reflog              git-imap-send git-log                 git-relink              git-p4 git-merge               git-remote              git-quiltimport git-mv                  git-repack              git-request-pull git-notes               git-replace             git-send-email git-pull                git-annotate            git-svn git-push                git-blame 

plumbing

 git-apply               git-for-each-ref        git-receive-pack git-checkout-index      git-ls-files            git-shell git-commit-tree         git-ls-remote           git-upload-archive git-hash-object         git-ls-tree             git-upload-pack git-index-pack          git-merge-base          git-check-attr git-merge-file          git-name-rev            git-check-ignore git-merge-index         git-pack-redundant      git-check-mailmap git-mktag               git-rev-list            git-check-ref-format git-mktree              git-show-index          git-column git-pack-objects        git-show-ref            git-credential git-prune-packed        git-unpack-file         git-credential-cache git-read-tree           git-var                 git-credential-store git-symbolic-ref        git-verify-pack         git-fmt-merge-msg git-unpack-objects      git-daemon              git-interpret-trailers git-update-index        git-fetch-pack          git-mailinfo git-update-ref          git-http-backend        git-mailsplit git-write-tree          git-send-pack           git-merge-one-file git-cat-file            git-update-server-info  git-patch-id git-diff-files          git-http-fetch          git-sh-i18n git-diff-index          git-http-push           git-sh-setup git-diff-tree           git-parse-remote        git-stripspace 

1It would seem more logical to call this --plumbing, but as VonC notes in this answer to a related question, one can view this instead as a request: "I am implementing porcelain so please give me plumbing-style output." The flaw in this argument is that you might be implementing complex plumbing, and want to use simple plumbing to do it: now there's no porcelain in sight, and yet, your complex plumbing passes --porcelain to some simple plumbing.

like image 171
torek Avatar answered Oct 16 '22 18:10

torek