Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Fwd: possible Improving diff algoritm

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:55:30

Junio C Hamano [off-list ref] writes:
Kevin [off-list ref] writes:
quoted
Regularly I notice that the diffs that are provided (through diff, or
add -p) tend to disconnect changes that belong to each other and
report lines being changed that are not changed.

An example for this is:

     /**
+     * Default parent
+     *
+     * @var int
+     * @access protected
+     * @index
+     */
+    protected $defaultParent;
+
+    /**

I understand this is a valid view of what is changed, but not a very
logical view from the point of the user.

I wondered if there is a way to improve this, or would that have other
consequences.
I forgot to mention consequences.  Changing it obviously changes the
shape of the diff, hence changes the patch id.  Anything that caches
output from "git cherry" to match up "identical patches" will need
to discard and repopulate its cache.  Your "rerere" database will go
stale.

Also "kup" tool used at k.org allows an uploader to pretend to
upload an incremental diff between two known commits by only sending
the GPG signature of the diff the uploader generates.  The actual
diff is generated on the k.org machine locally and deposited next to
the GPG signature file, with the expectation that the signture
matches the diff.  Changing the output from diff between two
versions will break the optimization and force the uploader to
upload the diff over the wire.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help