Re: [PATCH 2/3] blame: refactor porcelain output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 9, 2011 at 10:34 AM, Jeff King <peff@xxxxxxxx> wrote:
> This is in preparation for adding more porcelain output
> options. The three changes are:
>
> Â1. emit_porcelain now receives the format option flags
>
> Â2. emit_one_suspect_detail takes an optional "repeat"
> Â Â parameter to suppress the "show only once" behavior
>
> Â3. The code for emitting porcelain suspect is factored
> Â Â into its own function for repeatability.
>
> There should be no functional changes.
>
> Signed-off-by: Jeff King <peff@xxxxxxxx>
> ---
> I broke this out for readability. I can break each of the 3 out into a
> separate patch if that helps, but it seemed excessive.
>
> Âbuiltin/blame.c | Â 25 ++++++++++++++++---------
> Â1 files changed, 16 insertions(+), 9 deletions(-)
>
> diff --git a/builtin/blame.c b/builtin/blame.c
> index 4242e4b..d74e18f 100644
> --- a/builtin/blame.c
> +++ b/builtin/blame.c
> @@ -1484,13 +1484,14 @@ static void write_filename_info(const char *path)
> Â/*
> Â* Porcelain/Incremental format wants to show a lot of details per
> Â* commit. ÂInstead of repeating this every line, emit it only once,
> - * the first time each commit appears in the output.
> + * the first time each commit appears in the output (unless the
> + * user has specifically asked for us to repeat).
> Â*/
> -static int emit_one_suspect_detail(struct origin *suspect)
> +static int emit_one_suspect_detail(struct origin *suspect, int repeat)
> Â{
> Â Â Â Âstruct commit_info ci;
>
> - Â Â Â if (suspect->commit->object.flags & METAINFO_SHOWN)
> + Â Â Â if (!repeat && suspect->commit->object.flags & METAINFO_SHOWN)

Maybe would be worth adding parentheses here:

if (!repeat && (...))
  return 0;

?

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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]