{"thread":{"id":"51567","subject":"am-based rebase not applying filters","startedAt":"2019-08-01T01:52:12Z","lastAt":"2019-08-01T01:52:12Z","messageCount":1,"participants":["brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"379734","messageId":"20190801015204.GA12118@genre.crustytoothpaste.net","threadId":"51567","inReplyTo":null,"subject":"am-based rebase not applying filters","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-08-01T01:52:04Z","receivedAt":"2019-08-01T01:52:12Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Recently, someone[0] pointed out to me that am-based rebases don't apply\nsmudge and clean filters on the final checkout.\n\nReproduction:\n-----\n#!/bin/sh -e\n\nmkdir test-repo\ncd test-repo\ngit init\ngit config filter.test.clean \"sed -e 's/smudged/clean/g'\"\ngit config filter.test.smudge \"sed -e 's/clean/smudged/g'\"\n\necho a >a.bin\ngit add a.bin\ngit commit -m 'Add a.bin'\n\necho b >b.bin\ngit add b.bin\ngit commit -m 'Add b.bin'\n\ngit checkout -b test HEAD^\n\necho '*.txt filter=test' >.gitattributes\ngit add .gitattributes\ngit commit -m 'Add .gitattributes'\n\necho 'This text is smudged.' >a.txt\ngit add a.txt\ngit commit -m 'Add a.txt'\n\ngit rebase master\ngrep 'smudged' a.txt\n-----\n\nThe correct behavior is to have the script print that the text is\nsmudged, but with an am-based rebase, the text is clean. If you change\nthe rebase to use -i or -m, the test succeeds (the filters are applied).\nThis may also affect things like working-tree encodings or line endings;\nI'm not sure.\n\nI'm planning on taking a look at fixing this (unless of course someone\ngets to it before me), but I wanted to mention this as in case it rang a\nbell for anyone.\n\nI have no reason to think this is version-specific behavior, but I'm\nusing Git 2.23.0.rc0.142.g4dedae46a2 from Debian experimental, and this\nalso reproduces on a fairly recent master on macOS.\n\n[0] This was brought to my attention by Erika Ellison.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}