git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] xdiff: replace emit_func() with type-safe
@ 2012-05-09 20:19 René Scharfe
  2012-05-09 20:20 ` [PATCH 1/5] xdiff: add hunk_func() René Scharfe
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: René Scharfe @ 2012-05-09 20:19 UTC (permalink / raw)
  To: git discussion list; +Cc: Junio C Hamano

Commit ef2e62fe added the ability to bypass the creation of textual diffs
and to access diff data directly, through the added emit_func member of
xdemitconf_t.  This function pointer has a type of "void (*)()", because
"int (*)(xdfenv_t *, xdchange_t *, xdemitcb_t *, xdemitconf_t const *)"
(its real type) would be difficult to export due to the many internal
types in that signature.

This feature is currently used twice in git blame, through the function
xdi_diff_hunks().  Both cases only need to know which lines are affected
by the different hunks of a diff, i.e. the numbers shown in hunk headers
of unified diffs.

This patch series adds a simpler mechanism to accommodate these two
callers, in a type-safe way, without exporting too many internal types
of libxdiff.  The last patch removes the old functions.

  xdiff: add hunk_func()
  blame: use hunk_func(), part 1
  blame: use hunk_func(), part 2
  blame: factor out helper for calling xdi_diff()
  xdiff: remove emit_func() and xdi_diff_hunks()

 builtin/blame.c   |   53 +++++++++++++++++++++++++++++++----------------------
 xdiff-interface.c |   44 --------------------------------------------
 xdiff-interface.h |    4 ----
 xdiff/xdiff.h     |    6 +++++-
 xdiff/xdiffi.c    |   17 +++++++++++++++--
 5 files changed, 51 insertions(+), 73 deletions(-)

-- 
1.7.10.1

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

end of thread, other threads:[~2012-05-18  8:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09 20:19 [PATCH 0/5] xdiff: replace emit_func() with type-safe René Scharfe
2012-05-09 20:20 ` [PATCH 1/5] xdiff: add hunk_func() René Scharfe
2012-05-09 20:21 ` [PATCH 2/5] blame: use hunk_func(), part 1 René Scharfe
2012-05-09 20:22 ` [PATCH 3/5] blame: use hunk_func(), part 2 René Scharfe
2012-05-09 20:23 ` [PATCH 4/5] blame: factor out helper for calling xdi_diff() René Scharfe
2012-05-09 20:24 ` [PATCH 5/5] xdiff: remove emit_func() and xdi_diff_hunks() René Scharfe
2012-05-18  8:28 ` [PATCH 0/5] xdiff: replace emit_func() with type-safe Thomas Rast

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).