git-filter

Git clean and smudge filters don't do anything

筅森魡賤 提交于 2020-05-25 11:25:27
问题 I defined smudge and clean filters for my git repository. I tested the scripts individually and I'm pretty sure they work correctly. But when I git commit && git push , the remote version is un-filtered. What am I doing wrong? Also, is there a way to test whether the filter works without pushing it to a remote repository? The repository looks like: zsh/ |- zshrc git/ |- gitconfig .gitattributes .gitconfig config zshrc-clean.zsh zshrc-smudge.zsh gitconfig-clean.zsh gitconfig-smudge.zsh zsh

Git clean and smudge filters don't do anything

Deadly 提交于 2020-05-25 11:24:02
问题 I defined smudge and clean filters for my git repository. I tested the scripts individually and I'm pretty sure they work correctly. But when I git commit && git push , the remote version is un-filtered. What am I doing wrong? Also, is there a way to test whether the filter works without pushing it to a remote repository? The repository looks like: zsh/ |- zshrc git/ |- gitconfig .gitattributes .gitconfig config zshrc-clean.zsh zshrc-smudge.zsh gitconfig-clean.zsh gitconfig-smudge.zsh zsh

Evaluation time for `git describe` in smuge filter

拥有回忆 提交于 2019-12-25 03:17:30
问题 After a successful conversion of an old SVN repository into Git, with svn2git , I have been tasked with reproducing the $Revision$ keyword expansion, (or a close approximation of it). So I ... added a svn-r annotated tag for SVN's rev0 in .git/attributes added * filter=revsion in .git/configure added [filter "revsion"] smudge = /bin/sed -e 's/\\$Revision\\$/$Revision: '$(GIT_EXEC_PATH=/usr/lib/git-core/ /usr/bin/git describe --match svn-r)'$/g' clean = /bin/sed -e 's/\\$Revision: [^$]*\\$/

How to globally apply a textconv filter to all text files?

Deadly 提交于 2019-12-10 22:33:03
问题 I know via gitattributes diff=... one can set files specified by a name pattern to use a textconv specified filter for git-diff et al., but is there any way to have git-diff use a specific diff filter for all files git determines to be text files, no matter their name, but without affecting non-text files? 来源: https://stackoverflow.com/questions/34432841/how-to-globally-apply-a-textconv-filter-to-all-text-files

git filter not 'unmodifying' file

旧巷老猫 提交于 2019-12-10 14:57:48
问题 I am working with an IDE which produces a version in some generated, but strongly required files of libraries. So there is an issue if I want to use the library with multiple versions or I see a load of changes which are in fact senseless. Summary: I want to ignore a single line of one or multiple files which I thought git's filters are the right approach. I am able to grep for the relevant line without a problem as one might see reading further. Long story short, I set up a git filter to

Remove all commits by author

天大地大妈咪最大 提交于 2019-12-06 02:37:13
问题 How do I remove all commits by certain author (committed by mistake - such an author should not be visible in the commits history). I have found some code to rename - git filter-branch --env-filter ' OLD_EMAIL="old@gmail.com" CORRECT_NAME="name" CORRECT_EMAIL="new@gmail.com" if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] then export GIT_AUTHOR_NAME="$CORRECT

git clean filter shows differences in the result of git diff

前提是你 提交于 2019-11-29 16:26:23
I setup a clean filter to apply autoformat with uncrustify. The corresponding smudge filter does nothing, it just calls cat . [filter "autoformat"] clean = uncrustify -c ~/tmp/autoformat/uncrustify.cfg --replace smudge = cat My problem is that when I checkout e.g. master , git says my working tree differs from the commit, and the difference that shows is what the clean filter does. It seems that the clean filter is applied before diff. Is that correct? Is it possible to disable this? Would it be a good idea? I would like a solution where autoformat is applied to the staging area, that is only

git clean filter shows differences in the result of git diff

给你一囗甜甜゛ 提交于 2019-11-28 10:47:20
问题 I setup a clean filter to apply autoformat with uncrustify. The corresponding smudge filter does nothing, it just calls cat . [filter "autoformat"] clean = uncrustify -c ~/tmp/autoformat/uncrustify.cfg --replace smudge = cat My problem is that when I checkout e.g. master , git says my working tree differs from the commit, and the difference that shows is what the clean filter does. It seems that the clean filter is applied before diff. Is that correct? Is it possible to disable this? Would it