git-branchless icon indicating copy to clipboard operation
git-branchless copied to clipboard

Add a built-in function to revsets for searching file content changes, i.e. the commit diff

Open mfulbright opened this issue 1 year ago • 1 comments

I would find it useful to have a function that allows searching the contents of the diff of a commit. There are already built-in functions for searching by author name, email, etc., and searching file paths that were changed in the commit. A built-in for searching file content changes seems like a natural function to expose as well.

Perhaps it would be named contents.changed() to match the existing paths.changed() built-in: contents.changed(text-pattern): all commits with a change to any file contents matching the specified pattern

And/or, breaking it out into 2 functions that specifically search additions and removals could be useful as well: contents.added(text-pattern): all commits with an addition to any file contents matching the specified pattern contents.removed(text-pattern): all commits with a removal to any file contents matching the specified pattern

mfulbright avatar Jun 02 '24 23:06 mfulbright

Agreed it would be useful and would accept a PR; I don't plan to work on it myself.

arxanas avatar Oct 09 '24 14:10 arxanas