Subject: [PATCH v8 0/5] git log -L

From: Thomas Rast <[email-masked]>
Date: Thu, 28 Feb 2013 17:38:18 +0100

Here's another shot :-)

For an instructive example, apply it and run

  git log -L:archiver:archive.h

in your git.git.

Last time around, apart from some minor issues, there was one main
point discussed[1]: it should be possible to do the line-log in two
separate steps, one for filtering and one for the diffing.

That would have some really nice advantages, in particular it would
let us generate the diff within the usual diff chain.  That way it
would work together with e.g. --word-diff automatically.

However, with the whole diff chain IMHO already being in some
disarray, that's such a far-off goal (and a good example of gsoc scope
creep!) that I can't see myself working on it in the near future
unless someone decides to pay me for working on Git.  Meanwhile, this
seems to be the only blocker for the inclusion of a feature for which
all feedback has been "WANT!" since it worked for the first time.

So I'd rather settle for including this slightly hacky version, and
then improving on it incrementally.

There are more things that need to be done: my rewrite for readability
(see [1] again) lost the support for -C and -C -C, so it no longer is
any use with big code moves.  The only thing that currently works is
-M, which will track the ranges across a file rename that can be
detected by the diff engine (i.e., it works by letting the diff engine
form a rename filepair).

Changes since v7 include:

- An all-new patch that allows for funcname matching: -L:pattern:file.
  I find it makes calling line-log (or blame, for that matter) much
  more natural.  I'm not exactly married to the syntax; in particular
  it feels weird in blame where you have to say 'git blame -L:foo file'.
  If you have better ideas, please shout.

- Tests!  Yay.  Also fixes for bugs found by the tests ;-)

- Dropped the unnecessary patch "Export three functions from diff.c".

Bo Yang (2):
  Refactor parse_loc
  Export rewrite_parents() for 'log -L'

Thomas Rast (3):
  blame: introduce $ as "end of file" in -L syntax
  Implement line-history search (git log -L)
  log -L: :pattern:file syntax to find by funcname

 Documentation/blame-options.txt     |   19 +-
 Documentation/git-log.txt           |   22 +
 Documentation/line-range-format.txt |   31 +
 Makefile                            |    2 +
 builtin/blame.c                     |   99 +--
 builtin/log.c                       |   31 +
 line-log.c                          | 1433 +++++++++++++++++++++++++++++++++++
 line-log.h                          |   80 ++
 log-tree.c                          |    4 +
 revision.c                          |   22 +-
 revision.h                          |   16 +-
 t/t4211-line-log.sh                 |   42 +
 t/t4211/expect.beginning-of-file    |   43 ++
 t/t4211/expect.end-of-file          |   62 ++
 t/t4211/expect.move-support-f       |   40 +
 t/t4211/expect.simple-f             |   59 ++
 t/t4211/expect.simple-f-to-main     |  100 +++
 t/t4211/expect.simple-main          |   68 ++
 t/t4211/expect.simple-main-to-end   |   70 ++
 t/t4211/expect.two-ranges           |  102 +++
 t/t4211/expect.vanishes-early       |   39 +
 t/t4211/history.export              |  330 ++++++++
 t/t8003-blame-corner-cases.sh       |    6 +
 23 files changed, 2601 insertions(+), 119 deletions(-)
 create mode 100644 Documentation/line-range-format.txt
 create mode 100644 line-log.c
 create mode 100644 line-log.h
 create mode 100755 t/t4211-line-log.sh
 create mode 100644 t/t4211/expect.beginning-of-file
 create mode 100644 t/t4211/expect.end-of-file
 create mode 100644 t/t4211/expect.move-support-f
 create mode 100644 t/t4211/expect.simple-f
 create mode 100644 t/t4211/expect.simple-f-to-main
 create mode 100644 t/t4211/expect.simple-main
 create mode 100644 t/t4211/expect.simple-main-to-end
 create mode 100644 t/t4211/expect.two-ranges
 create mode 100644 t/t4211/expect.vanishes-early
 create mode 100644 t/t4211/history.export

-- 
1.8.2.rc1.388.g1bd82c8