-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit {create, amend, split}branch create: Adds --no-verify flag
Adds the --no-verify flag to allow the user to bypass the pre-commit and commit-msg hooks for all actions that create a commit. This is useful for allowing the user to skip these hooks for a single commit action and keep the automatic restack functionality.
- Loading branch information
1 parent
b566d05
commit 0bdbc29
Showing
11 changed files
with
346 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Added | ||
body: 'commit {create, amend, split}branch create: Adds --no-verify flag to bypass pre-commit and commit-msg hooks.' | ||
time: 2024-12-01T11:57:58.209941-08:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Branch create with --no-verify. | ||
|
||
as 'Test <[email protected]>' | ||
at '2024-07-02T20:18:32Z' | ||
|
||
cd repo | ||
git init | ||
git commit --allow-empty -m 'Initial commit' | ||
gs repo init | ||
|
||
cp $WORK/extra/pre-commit .git/hooks/pre-commit | ||
chmod 700 .git/hooks/pre-commit | ||
|
||
git add feature.txt | ||
! gs branch create feature -m 'Add feature' | ||
stderr 'exit status 1' | ||
|
||
gs branch create feature -m 'Add feature' --no-verify | ||
|
||
gs ll -a | ||
cmp stderr $WORK/golden/ll.txt | ||
|
||
git diff HEAD^ | ||
cmp stdout $WORK/golden/diff.txt | ||
|
||
-- repo/feature.txt -- | ||
feature | ||
|
||
-- extra/pre-commit -- | ||
exit 1 | ||
|
||
-- golden/ll.txt -- | ||
┏━■ feature ◀ | ||
┃ 5648694 Add feature (now) | ||
main | ||
-- golden/diff.txt -- | ||
diff --git a/feature.txt b/feature.txt | ||
new file mode 100644 | ||
index 0000000..d0f029a | ||
--- /dev/null | ||
+++ b/feature.txt | ||
@@ -0,0 +1,2 @@ | ||
+feature | ||
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Commit amend with --no-verify. | ||
|
||
as 'Test <[email protected]>' | ||
at '2024-05-23T19:23:24Z' | ||
|
||
# setup | ||
cd repo | ||
git init | ||
git commit --allow-empty -m 'Initial commit' | ||
gs repo init | ||
|
||
git checkout -b feature | ||
gs branch track --base main | ||
|
||
git add feature1.txt | ||
gs cc -a -m 'Add feature' | ||
|
||
cp $WORK/extra/pre-commit .git/hooks/pre-commit | ||
chmod 700 .git/hooks/pre-commit | ||
|
||
git add feature2.txt | ||
|
||
! gs ca -m 'Add feature 1 and feature 2' | ||
stderr 'exit status 1' | ||
|
||
gs ca -m 'Add feature 1 and feature 2' --no-verify | ||
|
||
# verify the output | ||
git log | ||
cmp stdout $WORK/golden/log.1.txt | ||
|
||
-- repo/feature1.txt -- | ||
Contents of feature 1. | ||
|
||
-- repo/feature2.txt -- | ||
Contents of feature 2. | ||
|
||
-- extra/pre-commit -- | ||
exit 1 | ||
|
||
-- golden/log.1.txt -- | ||
commit 97daa3e151f2efd07538fb32e5a8d941816ab39b | ||
Author: Test <[email protected]> | ||
Date: Thu May 23 19:23:24 2024 +0000 | ||
|
||
Add feature 1 and feature 2 | ||
|
||
commit 63c927d63e16e46e0f55c14031bdf4cf9a159a56 | ||
Author: Test <[email protected]> | ||
Date: Thu May 23 19:23:24 2024 +0000 | ||
|
||
Initial commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Commit create with --no-verify. | ||
|
||
as 'Test <[email protected]>' | ||
at '2024-03-30T14:59:32Z' | ||
|
||
# setup | ||
cd repo | ||
git init | ||
git commit --allow-empty -m 'Initial commit' | ||
gs repo init | ||
|
||
git checkout -b feature | ||
gs branch track --base main | ||
|
||
cp $WORK/extra/pre-commit .git/hooks/pre-commit | ||
chmod 700 .git/hooks/pre-commit | ||
|
||
git add foo.txt | ||
! gs cc -m 'Add foo' | ||
stderr 'exit status 1' | ||
|
||
gs cc -m 'Add foo' --no-verify | ||
|
||
# verify the output | ||
git log | ||
cmp stdout $WORK/golden/log.1.txt | ||
|
||
-- repo/foo.txt -- | ||
Contents of foo. | ||
|
||
-- extra/pre-commit -- | ||
exit 1 | ||
|
||
-- golden/log.1.txt -- | ||
commit 91582344149997d5a513acf7b4d56a03452e23cd | ||
Author: Test <[email protected]> | ||
Date: Sat Mar 30 14:59:32 2024 +0000 | ||
|
||
Add foo | ||
|
||
commit 9bad92b764fe1d56cb99b394f373a71cdefd8e86 | ||
Author: Test <[email protected]> | ||
Date: Sat Mar 30 14:59:32 2024 +0000 | ||
|
||
Initial commit |
Oops, something went wrong.