git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* am-based rebase not applying filters
@ 2019-08-01  1:52 brian m. carlson
  0 siblings, 0 replies; only message in thread
From: brian m. carlson @ 2019-08-01  1:52 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

Recently, someone[0] pointed out to me that am-based rebases don't apply
smudge and clean filters on the final checkout.

Reproduction:
-----
#!/bin/sh -e

mkdir test-repo
cd test-repo
git init
git config filter.test.clean "sed -e 's/smudged/clean/g'"
git config filter.test.smudge "sed -e 's/clean/smudged/g'"

echo a >a.bin
git add a.bin
git commit -m 'Add a.bin'

echo b >b.bin
git add b.bin
git commit -m 'Add b.bin'

git checkout -b test HEAD^

echo '*.txt filter=test' >.gitattributes
git add .gitattributes
git commit -m 'Add .gitattributes'

echo 'This text is smudged.' >a.txt
git add a.txt
git commit -m 'Add a.txt'

git rebase master
grep 'smudged' a.txt
-----

The correct behavior is to have the script print that the text is
smudged, but with an am-based rebase, the text is clean. If you change
the rebase to use -i or -m, the test succeeds (the filters are applied).
This may also affect things like working-tree encodings or line endings;
I'm not sure.

I'm planning on taking a look at fixing this (unless of course someone
gets to it before me), but I wanted to mention this as in case it rang a
bell for anyone.

I have no reason to think this is version-specific behavior, but I'm
using Git 2.23.0.rc0.142.g4dedae46a2 from Debian experimental, and this
also reproduces on a fairly recent master on macOS.

[0] This was brought to my attention by Erika Ellison.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-01  1:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01  1:52 am-based rebase not applying filters brian m. carlson

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git