$ git whatchanged --since="since time" --name-only --oneline | grep -v '^.\{9\}\s' | uniq
Let's say we are in a branch called ba and we have another branch called bb. How to watch for all modified files in bb since 2 weeks ago?
$ git whatchanged bb --since="2 weeks ago" --name-only --oneline | grep -v '^.\{9\}\s' | uniq
grep -v is used to remove lines with sha (9 chars).
$ git whatchanged bb commitsha1..commitsha2 --name-only --oneline | grep -v '^.\{9\}\s' | sort -u
$ awk '{ printf "%s ", $0; } END { printf "\n"; }'
END in this case has a line break for convenience. It'll only run once, similar to if I had put a BEGIN.
$ grep -v -e filea -e fileb -e filec
$ git checkout bb -- $(git whatchanged bb commitsha1..commitsha2 --no-merges --author="snlucas" --committer="snlucas" --name-only --oneline | grep -v '^.\{9\}\s' | sort -u | awk '{ printf "%s ", $0; } END { printf "\n"; }' | tr '\n' ' ')
In this case I get all modified files using git whatchanged and used git checkout in bb branch to get these files. Also, it's important to use --, once it tells git that you're dealing with files in this part of the command, helping you avoid some headaches.
In flags --author and --committer change "snlucas" to your Git username.
Sometimes you face some errors with some files. If it's ok, you can avoid these files:
$ git checkout bb -- $(git whatchanged bb commitsha1..commitsha2 --no-merges --author="snlucas" --committer="snlucas" --name-only --oneline | grep -v '^.\{9\}\s' | sort -u | grep -v -e errorfile1 -e errorfile2 -e errorfile3 | awk '{ printf "%s ", $0; } END { printf "\n"; }' | tr '\n' ' ')
Working with Salesforce and need help to create a package. We can use sfdx delta
$ sfdx sgd:source:delta --to commitsha2 --from commitsha1 --output manifest