From: Jakub Narębski Date: Mon, 25 Jul 2016 22:43:19 GMT Subject: Re: [PATCH v2 7/8] status: update git-status.txt for --porcelain=v2 Message-ID: <57969607.9080206@gmail.com> In-Reply-To: <1469474750-49075-8-git-send-email-jeffhost@microsoft.com> W dniu 2016-07-25 o 21:25, Jeff Hostetler pisze: > +Porcelain Format Version 2 > +~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +Version 2 format adds more detailed information about the state of > +the worktree and the changed items. I think it should be "and changed items", but I am not a native speaker. > +If `--branch` is given, a header line showing branch tracking information > +is printed. This line begins with "### branch: ". Fields are separated > +by a single space. > + > + Field Meaning > + -------------------------------------------------------- > + | (initial) Current commit > + | (detached) Current branch > + Upstream branch, if set > + + Ahead count, if upstream present > + - Behind count, if upstream present > + -------------------------------------------------------- > + > +A series of lines are then displayed for the tracked entries. > +Ordinary changed entries have the following format; the first > +character is a 'c' to distinguish them from unmerged entries. It would be nice (though not necessary) to have an example, either here or at the end. > + > + c R [\t] > + > + Field Meaning > + -------------------------------------------------------- > + A 2 character field containing the staged and > + unstaged XY values described in the short format, > + with unchanged indicated by a "." rather than > + a space. > + A 4 character field describing the submodule state. > + "N..." when the entry is not a submodule. > + "S" when the entry is a submodule. > + is "C" if the commit changed; otherwise ".". > + is "M" if it has tracked changes; otherwise ".". > + is "U" if there are untracked changes; otherwise ".". > + The 6 character octal file modes for head, index, > + and worktree. I think it might be more readable to be explicit: "for HEAD (), index (), and worktree ()." > + The head and index SHA1 values. > + R The rename percentage score. I assume this would be C copy detection heuristics percentage score in case of copy detection, and B
break percentage score in case of breaking change into addition and deletion of file. Or am I confused? > + The current pathname. It is C-Quoted if it contains > + special control characters. I assume that "\t" tab character between and is here to be able to not C-Quote sane filenames with internal whitespace, isn't it? > + The original path. This is only present for staged renames. > + It is C-Quoted if necessary. I assume that "C-Quoted if necessary" is the same as "C-Quoted if it contains special control characters"; also: '"' quote character, '\' backlash escape character and "\t" horizontal tab are not control characters per se., but still need C-Quoting. The rules are the same as for the rest of Git, e.g. for `git diff`, isn't it? > + -------------------------------------------------------- > + > +Unmerged entries have the following format; the first character is > +a "u" to distinguish from ordinary changed entries. > + > + u

> + > + Field Meaning > + -------------------------------------------------------- > + A 2 character field describing the conflict type > + as described in the short format. > + A 4 character field describing the submodule state > + as described above. > + The 6 character octal file modes for the stage 1, > + stage 2, stage 3, and worktree. Errr... the pattern has only _3_ character octal modes, . A question: what happens during octopus merge? > + For regular entries, these are the head, index, and > + worktree modes; the fourth is zero. This is remnant of the previous version of "v2" format, isn't it? > + The stage 1, stage 2, and stage 3 SHA1 values. > + The current pathname. It is C-Quoted if necessary. > + -------------------------------------------------------- > + > +A series of lines are then displayed for untracked and ignored entries. > + > + > + > +Where is "?" for untracked entries and "!" for ignored entries. I assume that here also is C-Quoted if necessary. > + > +When the `-z` option is given, a NUL (zero) byte follows each pathname; > +serving as both a separator and line termination. No pathname quoting > +or backslash escaping is performed. All fields are output in the same > +order. > + > CONFIGURATION > ------------- > >