Skip to content

Commit

Permalink
master: git_commit.sh: add check_commit list.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbell committed Sep 14, 2024
1 parent 4a9f505 commit 77fba63
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
10 changes: 10 additions & 0 deletions bin/dev_settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# source bin/dev_settings.sh
# Sets the development tool variables listed below to settings for this system.
#
# Directories
# If an file name below is a directory it specifies all the
# files in the directory.
#
# spdx_license_id
# Each file, except those specified by no_copyright_list, should have a line
# that ends with the following text:
Expand All @@ -32,3 +36,9 @@ no_copyright_list='
# If an entry below is a directory it specifies all the files in the directory.
invisible_and_tab_ok='
'
#
# check_commit
# These files may have automatic changes that should not be commited.
# Including them in this list gives one this option to abort their changes.
check_commit='
'
35 changes: 35 additions & 0 deletions bin/git_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ fi
#
# grep, sed
source bin/grep_and_sed.sh
#
# check_commit
source bin/dev_settings.sh
# -----------------------------------------------------------------------------
# EDITOR
set +u
Expand All @@ -39,6 +42,38 @@ then
fi
set -u
# -----------------------------------------------------------------------------
# check_commit
echo 's|^...||' > temp.sed
for name in $check_commit
do
if [ -f $name ]
then
echo "^$name\$" | $sed -e 's|/|[/]|g' -e 's|.*|/&/p|' >> temp.sed
elif [ -d $name ]
then
echo "^$name/" | $sed -e 's|/|[/]|g' -e 's|.*|/&/p|' >> temp.sed
else
echo "$name in check_commit is not a file or directory"
exit 1
fi
done
list=$(
git status --porcelain | $sed -n -f temp.sed
)
for file in $list
do
res=''
while [ "$res" != 'revert' ] && [ "$res" != 'commit' ]
do
read -p "$file: Revert or commit changes [revert/commit] ?" res
done
if [ "$res" == 'revert' ]
then
git reset $file
git checkout $file
fi
done
# -----------------------------------------------------------------------------
# new files
# convert spaces in file names to @@
list=$(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-backend = 'setuptools.build_meta'
# -----------------------------------------------------------------------------
[project]
name = 'xrst'
version = '2024.9.9'
version = '2024.9.14'
description = 'Extract RST files from source code and run Sphinx'
readme = 'readme.md'
requires-python = '>=3.0'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name = 'xrst',
version = '2024.9.9',
version = '2024.9.14',
description = 'Extract RST files from source code and run Sphinx',
license = 'GPL-3.0-or-later',
keywords = 'sphinx rst documentation source',
Expand Down
2 changes: 1 addition & 1 deletion xrst/run_xrst.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def fix_latex(latex_dir, project_name) :
import xrst
#
# version
version = '2024.9.9'
version = '2024.9.14'
#
def run_xrst() :
#
Expand Down

0 comments on commit 77fba63

Please sign in to comment.