HomePhabricator

Add a check for unstaged changes when generating automated commits

Description

Add a check for unstaged changes when generating automated commits

Summary:
While this check is not particularly helpful when the automation runs
in production, this will help prevent blowing away changes by mistake when
testing this script locally.

It also turns out that the forced git checkout on master isn't really necessary anymore.
While land-patch.sh still assumes working on master, better separation of responsibilities
makes this script easier to test locally without specifying a given parent commit.

Test Plan:

COMMIT_TYPE=dummy ./automated-commits.sh ./patch-recipes/update-aur-version.sh bitcoin-abc   # Still bails early since there was no change

echo "" >> CMakeLists.txt
COMMIT_TYPE=archive-release-notes ./automated-commits.sh  # should error instead of blowing away the change

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7481

Details

Provenance
jasonbcoxAuthored on Sep 17 2020, 18:47
jasonbcoxPushed on Sep 21 2020, 23:53
Reviewer
Restricted Project
Differential Revision
D7481: Add a check for unstaged changes when generating automated commits
Parents
rABC139d2cb82bd3: [backport#14930]test: pruning: Check that verifychain can be called when pruned
Branches
Unknown
Tags
Unknown