git filters don't get applied to dotfiles
- From
- Adrien LEMAIRE <lemaire.adrien@gmail.com>
- Date
- Dec 27, 2019, 07:51 UTC
- Message-ID
- <CALqn52MbeiCrEzphMkcjeU6bPbLLaQOa-vzht2156uqVw1wL_g@mail.gmail.com>
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.
To give a bit of context, I've followed this arch linux suggestion to track my dotfiles using the "bare repository and alias method".
.gitattributes
> mailrc filter=remove-smtp-pass > .mailrc filter=remove-smtp-pass
.dotfiles/config
Show 10 quoted lines
> [core] > repositoryformatversion = 0 > filemode = true > bare = true > > [status] > showUntrackedFiles = no > > [filter "remove-smtp-pass"] > clean = "sed -e 's/gmail.com:.*@smtp/gmail.com:PASSWORD@smtp/'"
The file I'm trying to commit is called .mailrc, but to confirm the bug, I copied it as mailrc (without leading dot). When adding both files, the filter only gets applied to the file without leading dot.
Show 25 quoted lines
> $ config diff --cached
> diff --git a/.mailrc b/.mailrc
> new file mode 100644
> index 0000000..7ac2abb
> --- /dev/null
> +++ b/.mailrc
> @@ -0,0 +1,4 @@
> +account gmail {
> + set v15-compat
> + set mta=smtp://lemaire.adrien%40gmail.com:IamApassword@smtp.gmail.com:587 smtp-use-starttls
> +}
> diff --git a/mailrc b/mailrc
> new file mode 100644
> index 0000000..2698128
> --- /dev/null
> +++ b/mailrc
> @@ -0,0 +1,4 @@
> +account gmail {
> + set v15-compat
> + set mta=smtp://lemaire.adrien%40gmail.com:PASSWORD@smtp.gmail.com:587 smtp-use-starttls
> +}
> $ config check-attr -a -- mailrc
> mailrc: filter: remove-smtp-pass
> $ config check-attr -a -- .mailrc
> .mailrc: filter: remove-smtp-passAs reported by check-attr, the .mailrc file is correctly assigned to the filter, but the diff output shows the password.
Cordially Adrien