Last active
February 15, 2023 08:30
-
-
Save kunicmarko20/4ac45ae65d21eb524a7fc441f885712f to your computer and use it in GitHub Desktop.
Revisions
-
kunicmarko20 revised this gist
Jun 2, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,6 @@ top_level_path="$(git rev-parse --show-toplevel)"; while read file_name; do if grep -q "// warn-before-commit" "$top_level_path/$file_name"; then git reset $file_name; echo "File $file_name, was not commited because 'warn-before-commit' string was found." fi done < <(git diff --cached --name-only --diff-filter=ACM) -
kunicmarko20 created this gist
Jun 2, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ #!/bin/bash top_level_path="$(git rev-parse --show-toplevel)"; while read file_name; do if grep -q "// warn-before-commit" "$top_level_path/$file_name"; then git reset $file_name; echo "File $file_name, was not commited because 'warn-before-commit string' was found." fi done < <(git diff --cached --name-only --diff-filter=ACM)