Skip to content

Instantly share code, notes, and snippets.

@fleutot
Created March 28, 2020 09:45
Show Gist options
  • Select an option

  • Save fleutot/f7b0f0c21b9819c95ad833859691985e to your computer and use it in GitHub Desktop.

Select an option

Save fleutot/f7b0f0c21b9819c95ad833859691985e to your computer and use it in GitHub Desktop.
Shell commands to illustrate issue with git clean filter
cd ~/tmp
mkdir cleansmudge
cd cleansmudge
git init
echo content > file.txt
echo "*.txt filter=autoformat" > .git/info/attributes
echo "[filter \"autoformat\"]
clean = date >> ~/tmp/filteroutput.log
smudge = cat" >> .git/config
# After setting the filter, run 'tail -f ~/tmp/filteroutput.log' in another term.
git add file.txt
git commit -m"Initial commit"
git checkout -b b1
echo row2 >> file.txt
less file.txt
@fleutot
Copy link
Copy Markdown
Author

fleutot commented Mar 28, 2020

Result: at every new prompt, two new dates appear in ~/tmp/filteroutput.log. I wonder if the git part of my prompt is the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment