I want to supply my linter tool with files that changed in my branch. The list should include:
- files committed in my branch since branched from its parent
- files changed and staged
- files changed but not staged yet
It should not include files that are changed in the parent branch since changing off. Thus if my branch doesn’t have the latest commits from the parent branch that shouldn’t matter.
What I tried so far:
git diff --name-only
gives my only what’s changed, but not committed/stagedgit diff --name-only --staged
gives my only what’s staged, but not committed/changedgit diff --name-only main...
gives my only what’s committed but not changed/stagedgit diff --name-only main
gives everything (committed/staged/changed), but also includes what changed inmain
In some way I already have my list if I combine the output of 1, 2 & 3. But it would be nice to have a single command. Is there something like that?