-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Get files changed since <branch> rather than just most recent commit #106
Comments
Digging further, you can get the previous commit hash with |
So I used the built in command in the master branch, thinking it would grab all the changes that got merged into master, but a merge into master that doesn't squash commits gives you a commit where nothing actually changes. So the command works in that it does exactly what it's designed to, get the changes in this commit, I'm not sure how much use that is to anyone. So I know what my two use cases are. The first is described originally, My second case is what I thought I guess at this point the reason I bring any of this up rather than just running those commands in my pipeline is that I want to be able to take advantage of Having learned slightly more about parents (apparently commits can have multiple parents) my code above to reimplment current functionality with So I'm gonna write that and see what happens |
Digging deep into the past looking at #7, I've got a similar need but mine's slightly different. As the title suggests I want a way to not see changes in the current commit, but all the changes against a specific branch. The case is I want to be able to trigger a deploy to a test environment to deploy everything that's changed since but I'm not necessarily merging into a specific branch where all the changes will be present.
I think I can do this with
git diff --name-only master...
(for master) and that will give me the files that are ahead of master in my branch, but not the ones that are behind (git diff --name-only ...master
would get everything where I'm behind master but not files ahead, the inverse).Furthermore I'm only interested in certain types of changes, which I can get from either
diff
ordiff-tree
with the--diff-filter=
option.I don't know enough about git to really understand the difference between
diff
anddiff-tree
or to know that what I want to do is possible withdiff-tree
or what you're doing is possible withdiff
. But I could see expandingGet-GitChangedFile
with a-DiffFilter
parameter that could be passed to both commands, and then some options (-Since
or possibly even more?) and if specified it would usediff
instead ofdiff-tree
but still do the filtering the command already does.Or if there's some way to do both cases (changes in this commit, changes since ) with either
diff
ordiff-tree
then the code could just build that command based on passed parameters?The text was updated successfully, but these errors were encountered: