1

I have git smudge and git clean working using command line. But when I used sourcetree on the same repository to checkout and chekcin I dont see the filters working. I added :

[filter "dater"]
    clean = TestClean.rb

in config.

Also added TestClean.rb in my path. I am using windows 10.

LeGEC
  • 46,477
  • 5
  • 57
  • 104
android 12
  • 11
  • 2
  • "working using command line" means : running `git add` from command line on a file which matches this filter triggers the "clean" action, correct ? – LeGEC May 26 '20 at 20:21
  • yes , when I do git add and git commit. I see clean filter running. But when using Sourcetree application to stage and commit, i dont see the filter running. – android 12 May 26 '20 at 20:34

1 Answers1

0

Check first the actual environment used by SourceTree.

For instance, in this bug report (yes, For Mac, not Windows, but the general point remains valid):

Have a look at SRCTREE-3583.

Sourcetree is most likely not picking up your script because it is launched as a service and will not pick up your changes to the PATH.
You need to extend the PATH that your apps see, checkout "Setting environment variables via launchd.conf no longer works in OS X Yosemite/El Capitan/macOS Sierra/Mojave?" (mentioned in the issue) or search on how to extend PATH in OS X.

This is a Mac-specific issue, but in your case, you need to open a terminal from SourceTree, type "env", and check your environment variables compared to a regular CMD session where the filter works.

Not only the PATH should include your script, but it should also include ruby, in order to execute your script.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250