Committing changes

This commit is contained in:
Tim Edwards 2020-05-23 17:01:30 -04:00
parent 516ae506d7
commit 55e7abf396
4 changed files with 36 additions and 0 deletions

14
.git-expand-header Executable file
View File

@ -0,0 +1,14 @@
#! /usr/bin/env bash
FILE="$(basename $1)"
GIT_DATE="$(git log -n1 --pretty=%ai -- $1)"
GIT_AUTHOR="$(git log -n1 --pretty=%ae -- $1)"
GIT_HASH="$(git log -n1 --pretty=%h -- $1)"
GIT_REV="$(git describe --long --always ${GIT_HASH})"
sed \
-e"s@\\\$Date\\\$@\\\$Date: ${GIT_DATE}\\\$@" \
-e"s|\\\$Author\\\$|\\\$Author: ${GIT_AUTHOR}\\\$|" \
-e"s@\\\$Id\\\$@\\\$Id: ${GIT_REV}\\\$@" \
-e"s@\\\$Revision\\\$@\\\$Revision: ${GIT_REV}\\\$@" \
-e"s|\\\$Header\\\$|\\\$Header: ${FILE} ${GIT_REV} ${GIT_DATE} ${GIT_AUTHOR} \\\$|"

8
.gitattributes vendored Normal file
View File

@ -0,0 +1,8 @@
*.c filter=header
*.h filter=header
*.cpp filter=header
*.tcl filter=header
*.scm filter=header
Makefile filter=header
*.gds diff=gds

5
.gitconfig Normal file
View File

@ -0,0 +1,5 @@
[filter "header"]
smudge = ./.git-expand-header %f
clean = sed -e's/\\$Header:[^$]*\\$/\\$Header\\$/g'
[diff "gds"]
textconv = hexdump -v -C

View File

@ -131,7 +131,16 @@ TAGS:
${RM} TAGS ${RM} TAGS
find . ${MODULES} ${PROGRAMS} -name "*.[ch]" -maxdepth 1 | xargs etags -o TAGS find . ${MODULES} ${PROGRAMS} -name "*.[ch]" -maxdepth 1 | xargs etags -o TAGS
<<<<<<< HEAD
fix-trailing-whitespace: fix-trailing-whitespace:
find -name "*.[ch]" | xargs sed -i -e's/\s\+$$//' find -name "*.[ch]" | xargs sed -i -e's/\s\+$$//'
find -name "*.cpp" | xargs sed -i -e's/\s\+$$//' find -name "*.cpp" | xargs sed -i -e's/\s\+$$//'
find -name "*.tcl" | xargs sed -i -e's/\s\+$$//' find -name "*.tcl" | xargs sed -i -e's/\s\+$$//'
=======
setup-git:
git config --local include.path ../.gitconfig
git stash save
rm .git/index
git checkout HEAD -- "$$(git rev-parse --show-toplevel)"
git stash pop
>>>>>>> Adding git expanding command.