The " -z -porcelain" format is much more so, and I would recommend it to anyone scripting around "git status" So yeah, while -porcelain by itself is stable and scriptable, it is perhaps not the most friendly to parsers. The idea was to prevent people from scripting around -short, because it was never intended to be stable. Some people wanted a scriptable status output, too, so I slapped a " -porcelain" on the same format that turns off configurable features like relative pathnames and colorizing, and makes an implicit promise that we won't make further changes to the format. The "short-status" form is meant for human eyeballs, and was designed by Junio. This is similar to the short output, but will remain stable across git versions and regardless of user configuration. Give the output in an easy-to-parse format for scripts. Note: A porcelain command can have a -porcelain option.įor instance: git status -porcelain, which designates an output meant to be parsed. See " How do I programmatically determine if there are uncommitted changes?" as an example to using plumbing commands instead of porcelain ones. The interface to Porcelain commands on the other hand are subject to change in order to improve the end user experience. The interface (input, output, set of options and the semantics) to these low-level commands are meant to be a lot more stable than Porcelain level commands, because these commands are primarily for scripted use. However, you can use the output of a porcelain command which has a -porcelain option in script (see below), like: git status -porcelainĪlthough git includes its own porcelain layer, its low-level commands are sufficient to support development of alternative porcelains. That is key: if you script, you should use if possible plumbing commands, with stable outputs. More importantly, the term "porcelain" applies to high-level commands, with output:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |