git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dennis Kaarsemaker <dennis@kaarsemaker.net>
To: Adrien LEMAIRE <lemaire.adrien@gmail.com>, git@vger.kernel.org
Subject: Re: git filters don't get applied to dotfiles
Date: Sun, 29 Dec 2019 17:01:58 +0100	[thread overview]
Message-ID: <ea322b4c06dce0332ead3521e45514d10f2a76b8.camel@kaarsemaker.net> (raw)
In-Reply-To: <CALqn52MbeiCrEzphMkcjeU6bPbLLaQOa-vzht2156uqVw1wL_g@mail.gmail.com>

On Fri, 2019-12-27 at 16:51 +0900, Adrien LEMAIRE wrote:
> I'd like to report a bug regarding git filters not being applied to
> files beginning with a dot character "."
> Using git version 2.24.1
> Please let me know if there is a better way to report bugs. The github
> page only mentions this email.

<snip reproduction recipe>

I was not able to reproduce this in the git test suite with a quick
patch (see below). Your output does not show any git add command, is it
possible that you added the changes before configuring the filter?

If you set GIT_TRACE=2 in your environment before doing the git add of
the .mailrc file, you should see it run the filter command. It should
look something like:

+ git add test test.t test.i .mailrc
trace: built-in: git add test test.t test.i .mailrc
trace: run_command: ./rot13.sh
trace: run_command: ./rot13.sh

(which is a part of the output of GIT_TRACE=2 ./t0021-conversion.sh -x
-v -i)


diff --git t/t0021-conversion.sh t/t0021-conversion.sh
index 6c6d77b51a..32c27d513b 100755
--- t/t0021-conversion.sh
+++ t/t0021-conversion.sh
@@ -77,6 +77,7 @@ test_expect_success setup '
 
        {
            echo "*.t filter=rot13"
+           echo ".mailrc filter=rot13"
            echo "*.i ident"
        } >.gitattributes &&
 
@@ -88,9 +89,10 @@ test_expect_success setup '
        cat test >test.t &&
        cat test >test.o &&
        cat test >test.i &&
-       git add test test.t test.i &&
+       cat test >.mailrc &&
+       git add test test.t test.i .mailrc &&
        rm -f test test.t test.i &&
-       git checkout -- test test.t test.i &&
+       git checkout -- test test.t test.i .mailrc &&
 
        echo "content-test2" >test2.o &&
        echo "content-test3 - filename with special characters" >"test3 '\''sq'\'',\$x=.o"
@@ -102,6 +104,7 @@ test_expect_success check '
 
        test_cmp test.o test &&
        test_cmp test.o test.t &&
+       test_cmp test.o .mailrc &&
 
        # ident should be stripped in the repository
        git diff --raw --exit-code :test :test.i &&
@@ -110,9 +113,12 @@ test_expect_success check '
        test "z$id" = "z$embedded" &&
 
        git cat-file blob :test.t >test.r &&
+       git cat-file blob :.mailrc >.mailrc.r &&
 
        ./rot13.sh <test.o >test.t &&
-       test_cmp test.r test.t
+       ./rot13.sh <test.o >.mailrc &&
+       test_cmp test.r test.t &&
+       test_cmp .mailrc.r .mailrc
 '
 
 # If an expanded ident ever gets into the repository, we want to make sure that


  reply	other threads:[~2019-12-29 16:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27  7:51 git filters don't get applied to dotfiles Adrien LEMAIRE
2019-12-29 16:01 ` Dennis Kaarsemaker [this message]
2019-12-30 14:42   ` Adrien LEMAIRE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea322b4c06dce0332ead3521e45514d10f2a76b8.camel@kaarsemaker.net \
    --to=dennis@kaarsemaker.net \
    --cc=git@vger.kernel.org \
    --cc=lemaire.adrien@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).