From: Junio C Hamano Date: Sun, 2 Jun 2013 23:00:44 +0000 (-0700) Subject: Merge branch 'tr/line-log' X-Git-Tag: v1.8.4-rc0~225 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed73fe56428eecd2b635473f6a517a183c4713a3;p=thirdparty%2Fgit.git Merge branch 'tr/line-log' * tr/line-log: git-log(1): remove --full-line-diff description line-log: fix documentation formatting log -L: improve comments in process_all_files() log -L: store the path instead of a diff_filespec log -L: test merge of parallel modify/rename t4211: pass -M to 'git log -M -L...' test log -L: fix overlapping input ranges log -L: check range set invariants when we look it up Speed up log -L... -M log -L: :pattern:file syntax to find by funcname Implement line-history search (git log -L) Export rewrite_parents() for 'log -L' Refactor parse_loc --- ed73fe56428eecd2b635473f6a517a183c4713a3 diff --cc Documentation/git-log.txt index a976534ab8,65707ce13c..4687fe8192 --- a/Documentation/git-log.txt +++ b/Documentation/git-log.txt @@@ -62,15 -69,19 +62,28 @@@ produced by --stat etc Note that only message is considered, if also a diff is shown its size is not included. + -L ,:, -L :::: + + Trace the evolution of the line range given by "," + (or the funcname regex ) within the . You may + not give any pathspec limiters. This is currently limited to + a walk starting from a single revision, i.e., you may only + give zero or one positive revision arguments. + You can specify this option more than once. + + + and can take one of these forms: + + include::line-range-format.txt[] + +:: + Show only commits in the specified revision range. When no + is specified, it defaults to `HEAD` (i.e. the + whole history leading to the current commit). `origin..HEAD` + specifies all the commits reachable from the current commit + (i.e. `HEAD`), but not from `origin`. For a complete list of + ways to spell , see the "Specifying Ranges" + section of linkgit:gitrevisions[7]. + [\--] ...:: Show only commits that are enough to explain how the files that match the specified paths came to be. See "History diff --cc builtin/log.c index 6e56a50002,d584ff1a39..9e2123295f --- a/builtin/log.c +++ b/builtin/log.c @@@ -98,13 -117,17 +118,17 @@@ static void cmd_log_init_finish(int arg { struct userformat_want w; int quiet = 0, source = 0, mailmap = 0; + static struct line_opt_callback_data line_cb = {NULL, NULL, STRING_LIST_INIT_DUP}; const struct option builtin_log_options[] = { - OPT_BOOLEAN(0, "quiet", &quiet, N_("suppress diff output")), - OPT_BOOLEAN(0, "source", &source, N_("show source")), - OPT_BOOLEAN(0, "use-mailmap", &mailmap, N_("Use mail map file")), + OPT_BOOL(0, "quiet", &quiet, N_("suppress diff output")), + OPT_BOOL(0, "source", &source, N_("show source")), + OPT_BOOL(0, "use-mailmap", &mailmap, N_("Use mail map file")), { OPTION_CALLBACK, 0, "decorate", NULL, NULL, N_("decorate options"), PARSE_OPT_OPTARG, decorate_callback}, + OPT_CALLBACK('L', NULL, &line_cb, "n,m:file", + "Process line range n,m in file, counting from 1", + log_line_range_callback), OPT_END() }; diff --cc log-tree.c index 1946e9ce8d,793d2c8e99..2eb69bcfed --- a/log-tree.c +++ b/log-tree.c @@@ -9,7 -9,7 +9,8 @@@ #include "string-list.h" #include "color.h" #include "gpg-interface.h" +#include "sequencer.h" + #include "line-log.h" struct decoration name_decoration = { "object names" };