Re: [PATCH v3 04/13] refactor parse_loc
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:07
Bo Yang [off-list ref] 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"?
quoted hunk ↗ jump to hunk
Other parts such as regexp search, line number parsing are abstracted and re-used. Signed-off-by: Bo Yang <redacted> --- 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).