Ctrl-C
Ctrl-C

Reputation: 4172

Git - disable custom filters when stashing

I've got a custom filter in .git/config to remove lines marked: # todo.

[filter "removetodo"]
    clean = "sed '/\\ *#\\ todo/d'"

Plus *.py filter=removetodo in file .gitattributes.

Works nice, I can use git add -p without looking at a lot of my temporary comments (I don't commit TODOs in code).

But when I have to stash changes, those lines are dropped. git stash pop gives me those files without the filtered out lines. How to fix this behavior so filters are disabled when stashing?

Upvotes: 0

Views: 150

Answers (1)

jthill
jthill

Reputation: 60255

git -c filter.removetodo.clean=cat stash

should do it.

Upvotes: 2

Related Questions