Re: [PATCH v3 04/13] refactor parse_loc
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 12, 2010, 18:32 UTC
- Message-ID
- <7vk4p0blfx.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1278829141-11900-4-git-send-email-struggleyb.nku@gmail.com>
Bo Yang <struggleyb.nku@gmail.com> 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"?
Show 15 quoted lines
> Other parts such as regexp search, line number parsing are > abstracted and re-used. > > Signed-off-by: Bo Yang <struggleyb.nku@gmail.com> > --- > 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).