Skip to content

Commit 15ba44f

Browse files
committed
Merge branch 'ps/fetch-output-format'
"git fetch" learned the "--porcelain" option that emits what it did in a machine-parseable format. * ps/fetch-output-format: fetch: introduce machine-parseable "porcelain" output format fetch: move option related variables into main function fetch: lift up parsing of "fetch.output" config variable fetch: introduce `display_format` enum fetch: refactor calculation of the display table width fetch: print left-hand side when fetching HEAD:foo fetch: add a test to exercise invalid output formats fetch: split out tests for output format fetch: fix `--no-recurse-submodules` with multi-remote fetches
2 parents ef06676 + dd781e3 commit 15ba44f

File tree

6 files changed

+607
-250
lines changed

6 files changed

+607
-250
lines changed

Documentation/fetch-options.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ linkgit:git-config[1].
7878
--dry-run::
7979
Show what would be done, without making any changes.
8080

81+
--porcelain::
82+
Print the output to standard output in an easy-to-parse format for
83+
scripts. See section OUTPUT in linkgit:git-fetch[1] for details.
84+
+
85+
This is incompatible with `--recurse-submodules=[yes|on-demand]` and takes
86+
precedence over the `fetch.output` config option.
87+
8188
ifndef::git-pull[]
8289
--[no-]write-fetch-head::
8390
Write the list of remote refs fetched in the `FETCH_HEAD`

Documentation/git-fetch.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,15 @@ representing the status of a single ref. Each line is of the form:
204204
<flag> <summary> <from> -> <to> [<reason>]
205205
-------------------------------
206206

207+
When using `--porcelain`, the output format is intended to be
208+
machine-parseable. In contrast to the human-readable output formats it
209+
thus prints to standard output instead of standard error. Each line is
210+
of the form:
211+
212+
-------------------------------
213+
<flag> <old-object-id> <new-object-id> <local-reference>
214+
-------------------------------
215+
207216
The status of up-to-date refs is shown only if the --verbose option is
208217
used.
209218

0 commit comments

Comments
 (0)