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

Re: [PATCH 0/4] Selectively show only blamed limes

From
Jeff King <peff@peff.net>
Date
May 27, 2020, 07:23 UTC
Message-ID
<20200527072318.GA4006199@coredump.intra.peff.net>
In-Reply-To
<20200525215751.1735-1-philipoakley@iee.email>
On Mon, May 25, 2020 at 10:57:47PM +0100, Philip Oakley wrote:
> While `git blame` is able to select interesting line regions of a
> file, it's not easy to just display blame lines since a recent date,
> especially for large files.

I'm not convinced this is a useful thing to do in general. Lines don't always stand on their own, and you'd lack context for deciphering them. So a real example from "git blame -b --since=1.year.ago Makefile", for example (pardon the long lines):

  3a94cb31d52 (Johannes Schindelin        2019-07-29 13:08:16 -0700 2734)              -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
but in context it looks like:
              (Junio C Hamano             2019-05-19 16:46:42 +0900 2730) bin-wrappers/%: wrap-for-bin.sh
              (Junio C Hamano             2019-05-19 16:46:42 +0900 2731)         @mkdir -p bin-wrappers
              (Junio C Hamano             2019-05-19 16:46:42 +0900 2732)         $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
              (Junio C Hamano             2019-05-19 16:46:42 +0900 2733)              -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
  3a94cb31d52 (Johannes Schindelin        2019-07-29 13:08:16 -0700 2734)              -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
              (Junio C Hamano             2019-05-19 16:46:42 +0900 2735)         chmod +x $@

Of course there are cases where it might be useful. But you can already do:

  git blame --since=1.year.ago Makefile | grep -v ^^

I'm not totally opposed to the feature. I'm just really struggling to see how it would be generally useful. For special cases where you're just counting up lines, you'd be more likely to post-process the result anyway, at which point --line-porcelain is often easier to work with.

> Philip Oakley (4):
>   doc: blame: show the boundary commit '^' caret mark
This doc fix seems worthwhile on its own, though.
>   blame: add option to show only blamed commits `--blame-only`
>   blame: do not show boundary commits, only those blamed
If we do go this direction, these really ought to be a single commit.
>   blame: test the -b option, use blank oid for boundary commits.
This one might be worth doing independently, too.
-Peff
Previous: Philip OakleyNext: Philip Oakley
Message 8 of 14 in “Selectively show only blamed limes”
  1. 0/4 Selectively show only blamed limesPhilip Oakley, May 25, 2020
  2. 1/4 doc: blame: show the boundary commit '^' caret markPhilip Oakley, May 25, 2020
  3. 2/4 blame: add option to show only blamed commits `--blame-only`Philip Oakley, May 25, 2020
  4. 3/4 blame: do not show boundary commits, only those blamedPhilip Oakley, May 25, 2020
  5. 4/4 blame: test the -b option, use blank oid for boundary commits.Philip Oakley, May 25, 2020
  6. Jeff KingMay 27, 2020
  7. Philip OakleyMay 27, 2020
  8. Jeff KingMay 27, 2020
  9. Philip OakleyMay 27, 2020
  10. Jeff KingMay 28, 2020
  11. Junio C HamanoMay 28, 2020
  12. Philip OakleyMay 30, 2020
  13. Junio C HamanoMay 31, 2020
  14. Junio C HamanoMay 31, 2020

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.