git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git filters don't get applied to dotfiles

From
ALAdrien 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-pass

As reported by check-attr, the .mailrc file is correctly assigned to the filter, but the diff output shows the password.

Cordially Adrien

Next: Dennis Kaarsemaker
Message 1 of 3 in “git filters don't get applied to dotfiles”
  1. Adrien LEMAIREDec 27, 2019
  2. Dennis KaarsemakerDec 29, 2019
  3. Adrien LEMAIREDec 30, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.