arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git
Apache License 2.0
3.37k stars 80 forks source link

[Feature Request] Add a 'pushed(x)' built-in function to revsets #1336

Open mfulbright opened 1 month ago

mfulbright commented 1 month ago

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)" ; }