Skip to content
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

Add a 'pushed(x)' built-in function to revsets #1336

Open
mfulbright opened this issue Jun 2, 2024 · 1 comment
Open

Add a 'pushed(x)' built-in function to revsets #1336

mfulbright opened this issue Jun 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@mfulbright
Copy link

I would find a function that filters for commits that have been pushed to a remote repository useful in revsets.

Proposed function description:
pushed(x): all commits in x that have been pushed to a remote repo

Example usages:
Lint all commits in the current stack that haven't been pushed yet (commits that have been pushed shouldn't be modified!):
`$ git test fix --exec 'cargo fmt --all' 'stack() - pushed(stack())'

Print all new commits that will be pushed with 'git push':
$ git_push_check() { echo "New commits that will be pushed:" && git query "master..$1 - pushed(master..$1)" ; }

@claytonrcarter claytonrcarter added the enhancement New feature or request label Jun 8, 2024
@arxanas
Copy link
Owner

arxanas commented Oct 9, 2024

It might actually be easier or more composeable to define pushed(), which evaluates to all commits reachable from a remote ref. (The implementation treats commit ranges symbolically and has separate evaluate vs contains code paths, so it can be made efficient in many cases.)

@arxanas arxanas changed the title [Feature Request] Add a 'pushed(x)' built-in function to revsets Add a 'pushed(x)' built-in function to revsets Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants