Many coleagues of mine after composer install
they manually edit files and git commit
./vendor
alongside with their changes.
In my case I see as a bad practice but makes the app work. Therefore I want to detect what files has changed. The idea is that manual changes are either single-file commits or commits that have number files at ./vendor
< total number of files in ./vendor
How I can do this?
2
Answers
Never edit files inside
/vendor
as it can easily lead to bugs, especially if that dependency is used in other libraries.Simple answer – fork that dependency and use your own fork in
composer.json
.Please refer to following answer for full explanation:
If you need to deal with repository that contains
./vendor/
changes in it andYour need is justified IMO.
Solution 1
Gives besides typical info also information about changed files (their paths)
Solution 2
If you want to narrow result to only files that are changed inside vendor dir use
-- ./vendor
as the suffix:Solution 3
Similar to the ones above but gives a fancy indicator of number of changes inside the file.
Solution 4
this way you’ll get paths to files:
taken from this answer
you may limit its output:
to see diffenece between tip of your branch (HEAD) and one commit before it (HEAD^) or just put instead of them
commit1sha..commit2sha
Solution 5
This command focuses more on paths and their modification status (M = Modified, A = Added, etc) instead of log messages:
If you want to get only paths (without mod status) and optionally remove duplicates see this answer – you may also like other answers in that thread.