All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff Hostetler <jeffhost@microsoft.com>
Cc: git@vger.kernel.org, git@jeffhostetler.com, peff@peff.net,
	Johannes.Schindelin@gmx.de
Subject: Re: [PATCH v2 5/8] status: print per-file porcelain v2 status data
Date: Mon, 25 Jul 2016 13:23:49 -0700	[thread overview]
Message-ID: <xmqqwpk94gbu.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1469474750-49075-6-git-send-email-jeffhost@microsoft.com> (Jeff Hostetler's message of "Mon, 25 Jul 2016 15:25:47 -0400")

Jeff Hostetler <jeffhost@microsoft.com> writes:

> +static void wt_porcelain_v2_print(struct wt_status *s);
> +

There is no point in this forward declaration, if you just place the
implementation of these functions here, no?

> +/*
> + * Print porcelain v2 info for tracked entries with changes.
> + */
> +static void wt_porcelain_v2_print_changed_entry(
> +	struct string_list_item *it,
> +	struct wt_status *s)
> +{
> +...
> +	fprintf(s->fp, "%c %s %s %06o %06o %06o %s %s R%d %s",

It is misleading to always say R in the output when there is no
rename, isn't it?

> +	 * Note that this is a last-one-wins for each the individual
> +	 * stage [123] columns in the event of multiple cache rows
> +	 * for a stage.

Just FYI, the usual lingo we use for that is "multiple cache entries
for the same stage", I would think.

> +	 */
> +	memset(stages, 0, sizeof(stages));
> +	sum = 0;
> +	pos = cache_name_pos(it->string, strlen(it->string));
> +	assert(pos < 0);
> +	pos = -pos-1;
> +	while (pos < active_nr) {
> +		ce = active_cache[pos++];
> +		stage = ce_stage(ce);
> +		if (strcmp(ce->name, it->string) || !stage)
> +			break;
> +		stages[stage - 1].mode = ce->ce_mode;
> +		hashcpy(stages[stage - 1].oid.hash, ce->sha1);
> +		sum++;
> +	}
> +	if (!sum)
> +		die("BUG: unmerged entry without any stages");

Hmm, we seem to already have d->stagemask; if you call that variable
"sum" anyway, perhaps its computation can be more like

	sum |= 1 << (stage - 1);

so that you can compare it with d->stagemask for this sanity check?


  reply	other threads:[~2016-07-25 20:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 19:25 [PATCH v2 0/8] status: V2 porcelain status Jeff Hostetler
2016-07-25 19:25 ` [PATCH v2 1/8] status: rename long-format print routines Jeff Hostetler
2016-07-25 19:25 ` [PATCH v2 2/8] status: cleanup API to wt_status_print Jeff Hostetler
2016-07-25 20:05   ` Junio C Hamano
2016-07-25 19:25 ` [PATCH v2 3/8] status: support --porcelain[=<version>] Jeff Hostetler
2016-07-25 19:51   ` Jakub Narębski
2016-07-25 19:25 ` [PATCH v2 4/8] status: per-file data collection for --porcelain=v2 Jeff Hostetler
2016-07-25 20:14   ` Junio C Hamano
2016-07-26 13:31     ` Jeff Hostetler
2016-07-25 19:25 ` [PATCH v2 5/8] status: print per-file porcelain v2 status data Jeff Hostetler
2016-07-25 20:23   ` Junio C Hamano [this message]
2016-07-26 13:53     ` Jeff Hostetler
2016-07-25 19:25 ` [PATCH v2 6/8] status: print branch info with --porcelain=v2 --branch Jeff Hostetler
2016-07-25 20:30   ` Junio C Hamano
2016-07-25 19:25 ` [PATCH v2 7/8] status: update git-status.txt for --porcelain=v2 Jeff Hostetler
2016-07-25 22:43   ` Jakub Narębski
2016-07-26 15:34     ` Johannes Schindelin
2016-07-26 19:42     ` Jeff Hostetler
2016-07-25 19:25 ` [PATCH v2 8/8] status: tests " Jeff Hostetler
2016-07-26 16:07   ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqwpk94gbu.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=jeffhost@microsoft.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.