Skip to content

Commit 6e442d0

Browse files
author
Steve Krouse
committed
force git to notice _data/files.csv changes
1 parent ffe61fa commit 6e442d0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,17 @@ First, `pip install git2json` as explained [here](https://github.com/tarmstrong/
5454
Then create `.git/hooks/post-commit` with the following contents:
5555

5656
```bash
57-
# to get the data for directory listings
58-
echo 'fileName' > _data/files.csv && find . -regextype posix-egrep -regex ".*\.(md|html)$" -not -path "./_site/*" >> _data/files.csv
59-
60-
# get the data for git log
61-
git2json > _data/git-log.json
62-
6357
previousMessage=$(git log -1 --pretty=%B)
6458

6559
if [ "$previousMessage" != "updated git log" ]
6660
then
61+
git2json > _data/git-log.json
62+
echo 'fileName' > _data/files.csv && find . -regextype posix-egrep -regex ".*\.(md|html)$" -not -path "./_site/*" >> _data/files.csv
63+
64+
# https://stackoverflow.com/questions/16993082/why-doesnt-git-recognize-that-my-file-has-been-changed-therefore-git-add-not-w
65+
git rm --cached _data/files.csv
66+
git reset _data/files.csv
67+
6768
git add _data/git-log.json
6869
git add _data/files.csv
6970
git commit -m "updated git log"

0 commit comments

Comments
 (0)