jj icon indicating copy to clipboard operation
jj copied to clipboard

FR: exclude specific files from a diff

Open jyn514 opened this issue 5 months ago • 12 comments

Is your feature request related to a problem? Please describe. I want to avoid viewing diffs for large generated text files, such as Cargo.lock. With git, I can use git diff ':!Cargo.lock' (see https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-exclude). AFAICT jj diff does not have an equivalent.

Describe the solution you'd like I am not sure a good syntax for this. git's syntax is somewhat baroque, and very difficult to find in the docs. maybe diff could have a --filter command with a custom syntax, like jj log --revisions or nextest --filter-expression? or if that's too much design, --exclude would work fine, like fd --exclude.

Describe alternatives you've considered

  • shell pipelines, e.g. fd | rg -v foo | xargs jj diff. this works but is longer and easy to mess up; and it's hard to infer jj's defaults, especially WRT .gitignore.

Additional context

jyn514 avatar Feb 02 '24 08:02 jyn514