All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: "Marc Reilly" <marc@cpdesign.com.au>,
	linux-arm-kernel@lists.infradead.org,
	"Samuel Ortiz" <samuel.ortiz@intel.com>,
	"Ying-Chun Liu (PaulLiu)" <paulliu@debian.org>,
	"Mark Brown" <broonie@opensource.wolfsonmicro.com>,
	linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	"Philippe Rétornaz" <philippe.retornaz@epfl.ch>,
	git@vger.kernel.org
Subject: Re: [PATCH 0/7] Add support for Freescale's mc34708 to mc13xxx driver
Date: Fri, 13 Jul 2012 12:39:34 -0700	[thread overview]
Message-ID: <7vpq7z8n7t.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20120713084854.GD592@pengutronix.de> ("Uwe =?utf-8?Q?Kleine-?= =?utf-8?Q?K=C3=B6nig=22's?= message of "Fri, 13 Jul 2012 10:48:54 +0200")

Uwe Kleine-König  <u.kleine-koenig@pengutronix.de> writes:

> It doesn't move it around, that's only how it looks. I removed enum
> mc13xxx_id (above MC13XXX_NUMREGS) and added struct mc13xxx_variant
> (below MC13XXX_NUMREGS). Git choosed to use the closing brace of enum
> mc13xxx_id and struct mc13xxx_variant respectively as context (together
> with the following empty line).
> (For the new readers, here is how git represented the relevant part:
>
>  #include <linux/regmap.h>
>  #include <linux/mfd/mc13xxx.h>
>
> -enum mc13xxx_id {
> -	MC13XXX_ID_MC13783,
> -	MC13XXX_ID_MC13892,
> -	MC13XXX_ID_INVALID,
> +#define MC13XXX_NUMREGS 0x3f
> +
> +struct mc13xxx;
> +
> +struct mc13xxx_variant {
> +	const char *name;
> +	void (*print_revision)(struct mc13xxx *mc13xxx, u32 revision);
>  };
>
> -#define MC13XXX_NUMREGS 0x3f
> +extern struct mc13xxx_variant
> +		mc13xxx_variant_mc13783,
> +		mc13xxx_variant_mc13892;
>
>  struct mc13xxx {
>  	struct regmap *regmap;
> ...
> )
>
> The following would be an equivalent and (for humans) easier to review
> patch:
>
>  #include <linux/regmap.h>
>  #include <linux/mfd/mc13xxx.h>
>
> -enum mc13xxx_id {
> -	MC13XXX_ID_MC13783,
> -	MC13XXX_ID_MC13892,
> -	MC13XXX_ID_INVALID,
> -};
> -
>  #define MC13XXX_NUMREGS 0x3f
>
> +struct mc13xxx;
> +
> +struct mc13xxx_variant {
> +	const char *name;
> +	void (*print_revision)(struct mc13xxx *mc13xxx, u32 revision);
> +};
> +
> +extern struct mc13xxx_variant
> +		mc13xxx_variant_mc13783,
> +		mc13xxx_variant_mc13892;
> +
>  struct mc13xxx {
>  	struct regmap *regmap;
> ...
>
> But as this touches 17 lines compared to only 15 using the way git
> choosed to represent patch 6, git used the smaller representation.

Yes.  Useful information bits per line count is the primary thing
our default xdiff based output pays attention to (e.g. we coalesce
two adjacent hunks that are one missing context line apart into one
larger hunk by removing the "@@ linenum @@" line from the beginning
of the latter hunk for this reason).

> Usually this metric is sane, but here it's not. I don't know if you can
> do anything about it? E.g. take the number of +, - and context blocks
> into account. Then it would be 5 for the patch above vs. 7 for the
> way git did it.
> Or weight a context line containing
>
> 	#define MC13XXX_NUMREGS 0x3f
>
> more than two lines one of which is empty and the other only contains a
> }?

"GNU diff" gives the same output as ours, and "git diff --patience"
gives more redundant (it wasts lines by removing "};" and then later
adding "};" back) output.  I think this is because "patience" pays
more attention to key off unique lines in the range (e.g. the line
"#define MC13XXX_NUMREGS 0x3f" appears only once in the preimage and
also in the postimage, so it must pair with each other).

  reply	other threads:[~2012-07-13 19:39 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12  9:57 [PATCH 0/7] Add support for Freescale's mc34708 to mc13xxx driver Uwe Kleine-König
2012-07-12  9:57 ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 1/7] MFD: Fix mc13xxx SPI regmap Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 2/7] MFD: mc13xxx workaround SPI hardware bug on i.Mx Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 3/7] rtc/mc13xxx: use MODULE_DEVICE_TABLE instead of MODULE_ALIAS Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 4/7] rtc/mc13xxx: add support for the rtc in the mc34708 pmic Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 5/7] mfd/mc13xxx: drop modifying driver's id_table in probe Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 6/7] mfd/mc13xxx: change probing details for mc13xxx devices Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-13 15:22   ` Uwe Kleine-König
2012-07-13 15:22     ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 7/7] mfd/mc13xxx: add support for mc34708 Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12 23:02 ` [PATCH 0/7] Add support for Freescale's mc34708 to mc13xxx driver Marc Reilly
2012-07-12 23:02   ` Marc Reilly
2012-07-13  8:48   ` Uwe Kleine-König
2012-07-13  8:48     ` Uwe Kleine-König
2012-07-13 19:39     ` Junio C Hamano [this message]
2012-09-05 14:22   ` Fabio Estevam
2012-09-05 14:22     ` Fabio Estevam
2012-10-04 13:01     ` Fabio Estevam
2012-10-04 13:01       ` Fabio Estevam
2012-10-04 13:51       ` Samuel Ortiz
2012-10-04 13:51         ` Samuel Ortiz
2012-10-04 14:11         ` Uwe Kleine-König
2012-10-04 14:11           ` Uwe Kleine-König
2012-10-27 19:19         ` Fabio Estevam
2012-10-27 19:19           ` Fabio Estevam
2012-11-06 22:24           ` Samuel Ortiz
2012-11-06 22:24             ` Samuel Ortiz
2012-08-02 15:52 ` Fabio Estevam
2012-08-02 15:52   ` Fabio Estevam

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=7vpq7z8n7t.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=git@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc@cpdesign.com.au \
    --cc=paulliu@debian.org \
    --cc=philippe.retornaz@epfl.ch \
    --cc=samuel.ortiz@intel.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.