Commit Graph

3 Commits (main)

Author SHA1 Message Date
Yiwei Zhang 03a1a8936e pre-commit: do not ignore submodule when running diff-index
Without this line, if the git config specifies to ignore submodule
change (what happned in the associated bug), this script is useless
because the command will never return gitlink change

R=sokcevic

Bug: 1496925
Change-Id: I6536b95502e708e44d6fd3e4909fd30eac8c7c98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4995364
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Joanna Wang 8572d4bdcd Require prompt from users to confirm submodules commit.
Bug: 1481266
Change-Id: Ib840d6e472e3709919518a294e5489ba099a6188
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4875411
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
1 year ago
Gavin Mak 50b27a5308 Add gclient installhooks to add pre-commit hook
With submodules, users can accidentally stage and commit gitlink
changes. Add a new gclient command to install a pre-commit hook to
automatically drop gitlink changes that don't correspond to a DEPS
change.

Dropping gitlinks can be bypassed by setting
SKIP_GITLINK_PRECOMMIT=1.

Bug: 1481266
Change-Id: Idd8b273e7d8e37d52627964e8ed6004d068b6b7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4863221
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
1 year ago