Destructive pre-commit behaviour and "--all"
- From
- Jan Rüegg <rggjan@gmail.com>
- Date
- Mar 22, 2023, 10:34 UTC
- Message-ID
- <CAMbUV8F8y62n5ud3AoWQak8J==Zrn7kzwTE7jCveVJEpfcqncg@mail.gmail.com>
Why doesn't "git commit --all" keep the files added to the staging area, so "git commit --all" would have the same behaviour as "git add --all && git commit"?
As described here a pre-commit hook which changes files, when run with "git commit --all", will make it impossible to see what the hook changed.
Making "git commit --all" and "git add --all && git commit" have the same behaviour (or at least having that configurable) would allow looking (and reverting if necessary) the changes generated by the hooks.
- Jan