forked from KhronosGroup/WebGL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add smudge and clean filters to automatically set edit date.
- Loading branch information
1 parent
b7d1115
commit c966dbc
Showing
4 changed files
with
31 additions
and
0 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,2 @@ | ||
# Date keyword expansion | ||
specs/latest/**/index.html filter=dater |
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,9 @@ | ||
# Filters used by WebGL repo | ||
[filter "dater"] | ||
smudge = bash expand_date %f | ||
clean = bash -c \"sed -e 's/\\(<span id=\\\"LastEditDate\\\">\\).*\\(<\\/span>\\)/\\1\\2/'\" | ||
required | ||
|
||
# Needed to avoid merge conflicts | ||
[merge] | ||
renormalize = true |
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Set colors | ||
GREEN='\033[1;32m' | ||
NC='\033[0m' | ||
|
||
# Connect repo's .gitconfig | ||
git config --local include.path '../.gitconfig' | ||
printf "${GREEN}Git config was successfully set.${NC}\n" | ||
|
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,10 @@ | ||
#! /bin/bash | ||
|
||
# Smudge driver for the kwexpander filter for expanding keywords. Currently | ||
# only $Date$ is supported. | ||
# | ||
# See CONTRIBUTING.md for usage information. | ||
|
||
last_date=$(git log --pretty=format:"%ad" -1 HEAD -- "$1") | ||
sed -e 's/\(<span id=\"LastEditDate\">\).*\(<\/span>\)/\1'"$last_date"'\2/' | ||
|