News for hackers. Stuff that matters.
Re:Styling an HTML dialog modal to take the full height of t... by tomhallett on Sunday March 16, 2025 @12:03PM (#43380068)
Is there a git gui/extension/etc which makes exploring the git blame similar to what the author did easier? Here is what I find myself doing often:

- blame on file

- scroll to line 123, click on commit to see the change

- ok, that commit wasn’t the “meaningful change” I’m looking for

- click on parent commit

- browse files (for that sha)

- go to file

- click blame

- scroll to line 123 (or similar)

- repeat

Re:Styling an HTML dialog modal to take the full height of t... by pests on Sunday March 16, 2025 @01:19PM (#43380586)
Perhaps not exactly but you can run:

  git log -L 120,150:filename.txt
To see all commits that have touched lines 120-150 in filename.txt, and see those lines. Gives a view into a subset of lines but won't help if the code in question moved out of the line range.
Re:Styling an HTML dialog modal to take the full height of t... by uhoh-itsmaciek on Sunday March 16, 2025 @01:27PM (#43380644)
Not sure about a GUI way of doing this, but in the CLI, I use `git log --patch [path]` all the time. It will show you the history of diffs for that one file.
Re:Styling an HTML dialog modal to take the full height of t... by belden on Sunday March 16, 2025 @02:32PM (#43381070)
If I’m looking for code changes:

    git log -S <the-string>
If it’s commit messages I’m interested in:

    git log --grep <the-word-or-phrase>
Sometimes I want to know “all the commits that introduced a pattern”:

    git blame —- $(git grep -P -l 'the.*regex') | grep -P 'the.*regex'
This last one I use frequently enough that I wrote a little shell script for it, called "git-blep" (for "blame-grep")

———

If there’s a function name that you’re logging, then you might get mileage from

   git log -L :<the-function-name>:<the-file-name>
Though that probably would not have worked in the original author’s case.
Re:Styling an HTML dialog modal to take the full height of t... by solardev on Sunday March 16, 2025 @02:35PM (#43381090)
In Jetbrains you select a line of code and say "show history for selection" and it parses all that for you and just gives you a history of commits affecting that specific line. It's got a built in commit browser and visual diff tool.

Link (not much info there): https://www.jetbrains.com/help/idea/investigate-changes.html...

Re:Styling an HTML dialog modal to take the full height of t... by follower on Sunday March 23, 2025 @06:21AM (#43452013)
"Cregit" tool might be of interest to you, it generates token-based (rather than line-based) git "blame" annotation views: https://github.com/cregit/cregit

Example output based on Linux kernel @ "Cregit-Linux: how code gets into the kernel": https://cregit.linuxsources.org/

I learned of Cregit recently--just submitted it to HN after seeing multiple recent HN comments (yours being one I've had open in a tab for a week to remind me! :) ) discussing issues related to line-based "blame" annotation granularity:

"Cregit-Linux: how code gets into the kernel": https://news.ycombinator.com/item?id=43451654