status: collect per-file data for --porcelain=v2
Collect extra per-file data for porcelain V2 format. The output of `git status --porcelain` leaves out many details about the current status that clients might like to have. This can force them to be less efficient as they may need to launch secondary commands (and try to match the logic within git) to accumulate this extra information. For example, a GUI IDE might want the file mode to display the correct icon for a changed item (without having to stat it afterwards). Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
c4f596b98e
commit
1ecdecce62
@ -153,6 +153,8 @@ static int opt_parse_porcelain(const struct option *opt, const char *arg, int un
|
||||
*value = STATUS_FORMAT_PORCELAIN;
|
||||
else if (!strcmp(arg, "v1") || !strcmp(arg, "1"))
|
||||
*value = STATUS_FORMAT_PORCELAIN;
|
||||
else if (!strcmp(arg, "v2") || !strcmp(arg, "2"))
|
||||
*value = STATUS_FORMAT_PORCELAIN_V2;
|
||||
else
|
||||
die("unsupported porcelain version '%s'", arg);
|
||||
|
||||
@ -1104,6 +1106,7 @@ static struct status_deferred_config {
|
||||
static void finalize_deferred_config(struct wt_status *s)
|
||||
{
|
||||
int use_deferred_config = (status_format != STATUS_FORMAT_PORCELAIN &&
|
||||
status_format != STATUS_FORMAT_PORCELAIN_V2 &&
|
||||
!s->null_termination);
|
||||
|
||||
if (s->null_termination) {
|
||||
|
Reference in New Issue
Block a user