All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2 v4] xdiff: implement empty line chunk heuristic
@ 2016-04-18 21:12 Stefan Beller
  2016-04-18 21:12 ` [PATCH 1/2] xdiff: add recs_match helper function Stefan Beller
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Stefan Beller @ 2016-04-18 21:12 UTC (permalink / raw)
  To: gitster; +Cc: git, jacob.keller, Stefan Beller

> OK, so perhaps either of you two can do a final version people can
> start having fun with?

Here we go. I squashed in your patch, although with a minor change:

-               if ((flags & XDF_SHORTEST_LINE_HEURISTIC)) {
+               if ((flags & XDF_COMPACTION_HEURISTIC) && blank_lines) {

We did not need that in the "shortest line" heuristic as we know
a line with the shortest line length must exist. We do not know about
empty lines though.

Thanks,
Stefan

Jacob Keller (1):
  xdiff: add recs_match helper function

Stefan Beller (1):
  xdiff: implement empty line chunk heuristic

 Documentation/diff-config.txt  |  5 +++++
 Documentation/diff-options.txt |  6 ++++++
 diff.c                         | 11 +++++++++++
 xdiff/xdiff.h                  |  2 ++
 xdiff/xdiffi.c                 | 40 ++++++++++++++++++++++++++++++++++++----
 5 files changed, 60 insertions(+), 4 deletions(-)

-- 
2.8.0.26.gba39a1b.dirty

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [PATCHv5 0/2] xdiff: implement empty line chunk heuristic
@ 2016-04-19 15:21 Stefan Beller
  2016-04-19 15:21 ` [PATCH 1/2] xdiff: add recs_match helper function Stefan Beller
  0 siblings, 1 reply; 22+ messages in thread
From: Stefan Beller @ 2016-04-19 15:21 UTC (permalink / raw)
  To: gitster, git, jacob.keller, peff; +Cc: Stefan Beller

Thanks Jeff for pointing out issues in the comment!

Thanks,
Stefan

diff to origin/jk/diff-compact-heuristic:
diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
index 5a02b15..b3c6848 100644
--- a/xdiff/xdiffi.c
+++ b/xdiff/xdiffi.c
@@ -515,12 +515,12 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
 		}
 
 		/*
-		 * If a group can be moved back and forth, see if there is an
+		 * If a group can be moved back and forth, see if there is a
 		 * blank line in the moving space. If there is a blank line,
 		 * make sure the last blank line is the end of the group.
 		 *
-		 * As we shifted the group forward as far as possible, we only
-		 * need to shift it back if at all.
+		 * As we already shifted the group forward as far as possible
+		 * in the earlier loop, we need to shift it back only if at all.
 		 */
 		if ((flags & XDF_COMPACTION_HEURISTIC) && blank_lines) {
 			while (ixs > 0 &&


Jacob Keller (1):
  xdiff: add recs_match helper function

Stefan Beller (1):
  xdiff: implement empty line chunk heuristic

 Documentation/diff-config.txt  |  5 +++++
 Documentation/diff-options.txt |  6 ++++++
 diff.c                         | 11 +++++++++++
 xdiff/xdiff.h                  |  2 ++
 xdiff/xdiffi.c                 | 40 ++++++++++++++++++++++++++++++++++++----
 5 files changed, 60 insertions(+), 4 deletions(-)

-- 
2.4.11.2.g96ed4e5.dirty

^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [RFC PATCH, WAS: "weird diff output?" v3a 0/2] implement shortest line diff chunk heuristic
@ 2016-04-15 23:01 Stefan Beller
  2016-04-15 23:01 ` [PATCH 1/2] xdiff: add recs_match helper function Stefan Beller
  0 siblings, 1 reply; 22+ messages in thread
From: Stefan Beller @ 2016-04-15 23:01 UTC (permalink / raw)
  To: jacob.keller; +Cc: git, gitster, peff, Jens.Lehmann, davidel, Stefan Beller

This is a version based on Jacobs v2, with the same fixes as in his v3 (hopefully),
changing the heuristic, such that CRLF confusion might be gone.

TODO:
* add some tests
* think about whether we need a git attribute or not (I did some
  thinking, and if we do need to configure this at all, this is where I
  would put it)
  
Later on we want to have git attributes I'd think. For now let's just keep
the `git config diff.shortestlineheuristic true` config option for testing?
  
Changes since Jacobs v2:
 * s/empty line/shortest line/g
   That new heuristic is a superset of the empty line heuristic as empty lines
   are shortest lines.  This solves the "What is an empty line?" question
   (Think of CRLF vs LF)
 * fixed Jacobs rebase mistake (which is also fixed in Jacobs v3)

Changes since my v1:
* rename xdl_hash_and_recmatch to recs_match
* remove counting empty lines in the first section of the looping

Changes since Stefan's v1:
* Added a patch to implement xdl_hash_and_recmatch as Junio suggested.
* Fixed a segfault in Stefan's patch
* Added XDL flag to configure the behavior
* Used an int and counted empty lines via += instead of |=
* Renamed starts_with_emptyline to is_emptyline
* Added diff command line and config options

Jacob Keller (1):
  xdiff: add recs_match helper function

Stefan Beller (1):
  xdiff: implement empty line chunk heuristic

 Documentation/diff-config.txt  |  6 ++++++
 Documentation/diff-options.txt |  6 ++++++
 diff.c                         | 11 +++++++++++
 xdiff/xdiff.h                  |  2 ++
 xdiff/xdiffi.c                 | 43 ++++++++++++++++++++++++++++++++++++++----
 5 files changed, 64 insertions(+), 4 deletions(-)

-- 
2.8.1.189.gd13d43c

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-04-20 16:17 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-18 21:12 [PATCH 0/2 v4] xdiff: implement empty line chunk heuristic Stefan Beller
2016-04-18 21:12 ` [PATCH 1/2] xdiff: add recs_match helper function Stefan Beller
2016-04-18 21:12 ` [PATCH 2/2] xdiff: implement empty line chunk heuristic Stefan Beller
2016-04-18 22:04   ` Jacob Keller
2016-04-18 22:24     ` Junio C Hamano
2016-04-19  5:03   ` Jeff King
2016-04-19  6:47     ` Stefan Beller
2016-04-19  7:00       ` Jeff King
2016-04-19  7:05         ` Stefan Beller
2016-04-19 15:17     ` Stefan Beller
2016-04-19 17:06       ` Jeff King
2016-04-19 23:02         ` Jacob Keller
2016-04-19 23:07           ` Junio C Hamano
2016-04-20 13:12             ` Michael S. Tsirkin
2016-04-20 16:09               ` Junio C Hamano
2016-04-20 16:17                 ` Jeff King
2016-04-20  6:00         ` Junio C Hamano
2016-04-19 16:51     ` Junio C Hamano
2016-04-18 21:22 ` [PATCH 0/2 v4] " Junio C Hamano
2016-04-18 23:53   ` Stefan Beller
  -- strict thread matches above, loose matches on Subject: below --
2016-04-19 15:21 [PATCHv5 0/2] " Stefan Beller
2016-04-19 15:21 ` [PATCH 1/2] xdiff: add recs_match helper function Stefan Beller
2016-04-15 23:01 [RFC PATCH, WAS: "weird diff output?" v3a 0/2] implement shortest line diff chunk heuristic Stefan Beller
2016-04-15 23:01 ` [PATCH 1/2] xdiff: add recs_match helper function Stefan Beller

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.