-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: List.filter() #5291
Labels
enhancement
New feature or request
Comments
yuja
added a commit
to yuja/jj
that referenced
this issue
Jan 23, 2025
If we add generic diff template, we'll probably want to filter diff entries by status, etc. Closes jj-vcs#5291
yuja
added a commit
to yuja/jj
that referenced
this issue
Jan 23, 2025
If we add generic diff template, we'll probably want to filter diff entries by status, etc. Closes jj-vcs#5291
yuja
added a commit
to yuja/jj
that referenced
this issue
Jan 23, 2025
If we add generic diff template, we'll probably want to filter diff entries by status, etc. Closes jj-vcs#5291
4 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Jan 24, 2025
If we add generic diff template, we'll probably want to filter diff entries by status, etc. Closes #5291
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I wanted to implement "labels" in a git commit message with lines of the form "label: value". Using the current Template functionality, adding a line is easy (
concat()
,String.join()
) but removing is trickier. An LLM generateddescription.lines().filter(...)
which looked correct before I tried it and discoveredfilter()
was hallucinated.Describe the solution you'd like
List.filter()
in a similar form toList.map()
Describe alternatives you've considered
@bryceberger put together a workaround using
List.map()
which uses the empty string for excluded lines and moves the "gather" operation (join
in this case) into the map expression.Still, there are clear limitations with this approach and I wouldn't expect it to be maintainable extending beyond a few successive calls. So while it does the trick, I think there's an opportunity to add a more ergonomic alternative.
Additional context
Discord discourse: https://discord.com/channels/968932220549103686/1326247959213506682
The text was updated successfully, but these errors were encountered: