git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v7 0/5] git log -L, all new and shiny

From
Thomas Rast <trast@student.ethz.ch>
Date
Jun 7, 2012, 10:23 UTC
Message-ID
<cover.1339063659.git.trast@student.ethz.ch>

I too thought it would never happen -- but then again this is still not ready, I'm just trying to give it some exposure.

My mail archive says we were at v6 last time, but this is a rewrite rather than a reroll. In efforts to make the code understandable, I tried to compose it of little functions that do little operations on little data structures, to at least some success.

If you just want to dive in, patch it into your git or pull from
  git://github.com/trast/git.git line-log-WIP
and then try something like
  git log -L '/^int main/,/^}/':git.c
  git log --graph -L '/^static void sha1_object/,/^}/':builtin/index-pack.c 681b07de11
The TODO list:
* I dropped the tests for now, so we need new ones.
* A good split of the main patch would be nice :-)
* Much of the code leaks memory like a sieve because I was lazy.  It's
  workable on the git repository, but eats a few hundred MB for simple
  tasks even there.
* Missing features:
  - detect/filter merges at the hunk level
    (and ideally show a combined diff for the nontrivial ones)
  - -M and -C support
  - ...?

There's also a longer-term wishlist hinted at in the commit message of the main patch: the diff machinery currently makes no provisions for chaining its various bells and whistles. As the most obvious example, it is not possible to run a word diff over the result of 'log -L'. Changes in this direction would probably also make the implementation of 'log -L' fit nicely in there somewhere.

Bo Yang (3):
  Refactor parse_loc
  Export three functions from diff.c
  Export rewrite_parents() for 'log -L'
Thomas Rast (2):
  blame: introduce $ as "end of file" in -L syntax
  Implement line-history search (git log -L)
 Documentation/blame-options.txt     |   19 +-
 Documentation/git-log.txt           |   22 +
 Documentation/line-range-format.txt |   24 +
 Makefile                            |    2 +
 builtin/blame.c                     |   99 +--
 builtin/log.c                       |   53 ++
 diff.c                              |    6 +-
 diff.h                              |   17 +
 line.c                              | 1245 +++++++++++++++++++++++++++++++++++
 line.h                              |   79 +++
 log-tree.c                          |    3 +
 revision.c                          |   22 +-
 revision.h                          |   16 +-
 t/t8003-blame-corner-cases.sh       |    6 +
 14 files changed, 1491 insertions(+), 122 deletions(-)
 create mode 100644 Documentation/line-range-format.txt
 create mode 100644 line.c
 create mode 100644 line.h
-- 
1.7.11.rc1.243.gbf4713c
Next: Thomas Rast
Message 1 of 18 in “git log -L, all new and shiny”
  1. 0/5 git log -L, all new and shinyThomas Rast, Jun 7, 2012
  2. 1/5 Refactor parse_locThomas Rast, Jun 7, 2012
  3. 2/5 blame: introduce $ as "end of file" in -L syntaxThomas Rast, Jun 7, 2012
  4. Junio C HamanoJun 7, 2012
  5. Thomas RastJun 7, 2012
  6. 3/5 Export three functions from diff.cThomas Rast, Jun 7, 2012
  7. Junio C HamanoJun 7, 2012
  8. 4/5 Export rewrite_parents() for 'log -L'Thomas Rast, Jun 7, 2012
  9. 5/5 Implement line-history search (git log -L)Thomas Rast, Jun 7, 2012
  10. Junio C HamanoJun 7, 2012
  11. Thomas RastJun 7, 2012
  12. Zbigniew Jędrzejewski-SzmekJun 10, 2012
  13. Junio C HamanoJun 15, 2012
  14. Thomas RastJun 15, 2012
  15. Junio C HamanoJun 15, 2012
  16. Junio C HamanoJun 16, 2012
  17. Thomas RastJun 19, 2012
  18. Junio C HamanoJun 19, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.