summaryrefslogtreecommitdiff
path: root/line-range.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-09-09 21:35:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-09-09 21:35:11 (GMT)
commitde9a25354aa22aa6796787f3ef3af276fba82339 (patch)
tree9cfa7f20323b853773576582322b4d209f40e93e /line-range.h
parent4ab4a6dfb414230bb3e13ba65a1aa2606c6102f3 (diff)
parent5ce922a014f78684a96c3d03a51decf0d21fa58d (diff)
downloadgit-de9a25354aa22aa6796787f3ef3af276fba82339.zip
git-de9a25354aa22aa6796787f3ef3af276fba82339.tar.gz
git-de9a25354aa22aa6796787f3ef3af276fba82339.tar.bz2
Merge branch 'es/blame-L-twice'
Teaches "git blame" to take more than one -L ranges. * es/blame-L-twice: line-range: reject -L line numbers less than 1 t8001/t8002: blame: add tests of -L line numbers less than 1 line-range: teach -L^:RE to search from start of file line-range: teach -L:RE to search from end of previous -L range line-range: teach -L^/RE/ to search from start of file line-range-format.txt: document -L/RE/ relative search log: teach -L/RE/ to search from end of previous -L range blame: teach -L/RE/ to search from end of previous -L range line-range: teach -L/RE/ to search relative to anchor point blame: document multiple -L support t8001/t8002: blame: add tests of multiple -L options blame: accept multiple -L ranges blame: inline one-line function into its lone caller range-set: publish API for re-use by git-blame -L line-range-format.txt: clarify -L:regex usage form git-log.txt: place each -L option variation on its own line
Diffstat (limited to 'line-range.h')
-rw-r--r--line-range.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/line-range.h b/line-range.h
index ae3d012..83ba3c2 100644
--- a/line-range.h
+++ b/line-range.h
@@ -9,6 +9,9 @@
* line 'lno' inside the 'cb_data'. The caller is expected to already
* have a suitable map at hand to make this a constant-time lookup.
*
+ * 'anchor' is the 1-based line at which relative range specifications
+ * should be anchored. Absolute ranges are unaffected by this value.
+ *
* Returns 0 in case of success and -1 if there was an error. The
* actual range is stored in *begin and *end. The counting starts
* at 1! In case of error, the caller should show usage message.
@@ -18,7 +21,7 @@ typedef const char *(*nth_line_fn_t)(void *data, long lno);
extern int parse_range_arg(const char *arg,
nth_line_fn_t nth_line_cb,
- void *cb_data, long lines,
+ void *cb_data, long lines, long anchor,
long *begin, long *end,
const char *path);