Re: [PATCH v2 7/8] status: update git-status.txt for --porcelain=v2

2016-07-26 Thread Jeff Hostetler



On 07/25/2016 06:43 PM, Jakub Narębski wrote:

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.


fixed.


+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.
+
+FieldMeaning
+
+ | (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.


I'll try to fit that in at the bottom.


+
+cR [\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 ()."


I'll try to clarify that.



+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?


I'm updating to include rename and copied scores.  I haven't seen
anything in the code about a break percentage in this context.  I
see it listed with -B in the git-diff-* pages, but not in status.





+  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?


I'm using the same quoting routines as the existing porcelain
format.  So yes, that looks to be the case.  It only converts
if there are insane characters in pathnames.




+   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?


yes, i'm using the same quoting routine.  i'll clarify.  thanks.




+
+
+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?


yes, sorry.  I missed that one.




+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.


yes.




+
+When the `-z` option is given, a NUL (zero) by

Re: [PATCH v2 7/8] status: update git-status.txt for --porcelain=v2

2016-07-26 Thread Johannes Schindelin
Hi Kuba,

On Tue, 26 Jul 2016, Jakub Narębski wrote:

> W dniu 2016-07-25 o 21:25, Jeff Hostetler pisze:
> 
> > +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?

From git-merge-octopus.sh:

# We allow only last one to have a hand-resolvable
# conflicts.  Last round failed and we still had
# a head to merge.

In other words, octopus merges do not use higher stages than 3.

Ciao,
Dscho

Re: [PATCH v2 7/8] status: update git-status.txt for --porcelain=v2

2016-07-25 Thread Jakub Narębski
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.
> +
> +FieldMeaning
> +
> + | (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.

> +
> +cR [\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
>  -
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 7/8] status: update git-status.txt for --porcelain=v2

2016-07-25 Thread Jeff Hostetler
Update status manpage to include information about
porcelain v2 format.

Signed-off-by: Jeff Hostetler 
---
 Documentation/git-status.txt | 83 ++--
 1 file changed, 80 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index 6b1454b..e64b1b8 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -185,10 +185,10 @@ If -b is used the short-format status is preceded by a 
line
 
 ## branchname tracking info
 
-Porcelain Format
-
+Porcelain Format Version 1
+~~
 
-The porcelain format is similar to the short format, but is guaranteed
+Version 1 porcelain format is similar to the short format, but is guaranteed
 not to change in a backwards-incompatible way between Git versions or
 based on user configuration. This makes it ideal for parsing by scripts.
 The description of the short format above also describes the porcelain
@@ -210,6 +210,83 @@ field from the first filename).  Third, filenames 
containing special
 characters are not specially formatted; no quoting or
 backslash-escaping is performed.
 
+Porcelain Format Version 2
+~~
+
+Version 2 format adds more detailed information about the state of
+the worktree and the changed items.
+
+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.
+
+FieldMeaning
+
+ | (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.
+
+cR [\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.
+The head and index SHA1 values.
+R   The rename percentage score.
+  The current pathname. It is C-Quoted if it contains
+special control characters.
+   The original path. This is only present for staged renames.
+It is C-Quoted if necessary.
+
+
+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.
+For regular entries, these are the head, index, and
+worktree modes; the fourth is zero.
+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.
+
+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
 -
 
-- 
2.8.0.rc4.17.gac42084.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html