git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrien LEMAIRE <lemaire.adrien@gmail.com>
To: git@vger.kernel.org
Subject: git filters don't get applied to dotfiles
Date: Fri, 27 Dec 2019 16:51:04 +0900	[thread overview]
Message-ID: <CALqn52MbeiCrEzphMkcjeU6bPbLLaQOa-vzht2156uqVw1wL_g@mail.gmail.com> (raw)

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
> [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.

> $ 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

             reply	other threads:[~2019-12-27  7:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27  7:51 Adrien LEMAIRE [this message]
2019-12-29 16:01 ` git filters don't get applied to dotfiles Dennis Kaarsemaker
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=CALqn52MbeiCrEzphMkcjeU6bPbLLaQOa-vzht2156uqVw1wL_g@mail.gmail.com \
    --to=lemaire.adrien@gmail.com \
    --cc=git@vger.kernel.org \
    /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).