Bo Yang <struggleyb.nku@xxxxxxxxx> writes: > Both 'git blame -L' and 'git log -L' parse the same style > of line number arguments, so put the 'parse_loc' function > to line.c and export it. > The caller of parse_loc should provide a callback function > which is used to calculate the nth line start position. "the start position of the nth line"? > Other parts such as regexp search, line number parsing are > abstracted and re-used. > > Signed-off-by: Bo Yang <struggleyb.nku@xxxxxxxxx> > --- > builtin/blame.c | 89 +++++------------------------------------------------- > line.c | 35 ++++++++++++--------- > line.h | 5 +++ > 3 files changed, 34 insertions(+), 95 deletions(-) > > diff --git a/builtin/blame.c b/builtin/blame.c > index 01e62fd..17b71cd 100644 > --- a/builtin/blame.c > +++ b/builtin/blame.c > @@ -21,6 +21,7 @@ Nice code reduction. The abstraction feels right (but I didn't read it very carefully). -- 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