git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: Florian Aspart <florian.aspart@gmail.com>
Cc: Michael J Gruber <git@drmicha.warpmail.net>, git@vger.kernel.org
Subject: Re: Using clean/smudge filters with difftool
Date: Thu, 18 Jun 2015 14:26:22 +0100	[thread overview]
Message-ID: <20150618132622.GJ18226@serenity.lan> (raw)
In-Reply-To: <CAGA3++LrVSs3rMkg=S2Og48pz1yEBxwpcRsPt7sNLENRh1ooAg@mail.gmail.com>

[Please don't top-post on this list.]

On Thu, Jun 18, 2015 at 03:15:38PM +0200, Florian Aspart wrote:
> 2015-06-18 14:31 GMT+02:00 Michael J Gruber <git@drmicha.warpmail.net>:
> > Florian Aspart venit, vidit, dixit 16.06.2015 16:11:
> >> Hi everyone,
> >>
> >> I created a clean filter to apply on some files before commiting them.
> >> The filter works correctly when I commit the file and is also applied
> >> when I usethe iff command line tool.
> >> However, when using difftool with meld, the filter is not applied and
> >> the different versions of the files are compared without any
> >> filtering.
> >>
> >> Is there a way to apply the clean/smudge filters when comparing the
> >> working copy of a file to the HEAD version in a gui diff tool?
> >>
> >> I'm using git version 2.4.3 under Ubuntu.
> >>
> >> Best,
> >> Florian
> >
> > Are you saying that "difftool" compares an uncleaned working tree file
> > with a cleaned blob? That would be a bug in either difftool or the way
> > we feed difftool.
> >
> yes in this case "difftool" compares an uncleaned working tree file
> with a cleaned blob. I did not try the smudge filter to see if it
> applied in difftool.
> 
> I think the problem comes from the way difftool is feeded, since I
> also had this problem when setting an external tool for the diff in
> the gitconfig file.
> 
> However, I'm not sure if this is a bug or it is designed to be so.
> If the external tool changes a cleaned working tree file during the
> diff, then by saving this file the result of the cleaning filter would
> also be saved in the working tree.

How is your filter configured?  Is it using a simple pattern (e.g.
"*.c") or is it using a file path?

git-difftool uses `git checkout-index --all --prefix=$dir/` and I wonder
if the prefix means that the attribute specification does not match the
temporary file that difftool produces, so no filter is applied.

  reply	other threads:[~2015-06-18 13:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 14:11 Using clean/smudge filters with difftool Florian Aspart
2015-06-18 12:31 ` Michael J Gruber
2015-06-18 13:15   ` Florian Aspart
2015-06-18 13:26     ` John Keeping [this message]
2015-06-18 13:51       ` Florian Aspart
2015-06-18 14:11         ` John Keeping
2015-06-18 14:17           ` Florian Aspart
2015-06-18 14:28             ` John Keeping
2015-06-18 15:39               ` Florian Aspart
2015-06-18 16:01                 ` John Keeping
2015-06-18 20:00                   ` Junio C Hamano
2015-06-18 22:39                     ` John Keeping
2015-06-18 22:55                       ` Junio C Hamano
2015-06-19  8:57                         ` Michael J Gruber
2015-06-19  9:32                           ` John Keeping
2015-06-19 15:04                             ` Florian Aspart
2015-06-19 17:03                           ` Junio C Hamano
2015-06-21 19:29                             ` Michael J Gruber

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=20150618132622.GJ18226@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=florian.aspart@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --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).