Just to clarify, this is about Android Repo.
I would like to be able to compare my working directory against an arbitrary remote branch using repo forall
to see if there are any changes that I need to pull from that branch.
This is the closest I've gotten so far:
repo forall -p -c "git rev-list HEAD..origin/branchname --count"
That command will print the number of commits the working copy is behind origin/branchname for each git project. I would like to make it better by:
repo forall
will not print output if I can make the git command not print output.Try this:
repo forall -p -c "if [[ `git diff HEAD origin/branchname` ]]; then git rev-list HEAD..origin/branchname --count; fi"