From 89d5225ab9325ead6a2dd3317bee895f8a3be8bb Mon Sep 17 00:00:00 2001 From: Sebastian Cohnen Date: Wed, 14 Aug 2024 18:32:41 +0200 Subject: [PATCH] register npy as a git diff driver --- etc/gitattributes | 1 + etc/gitconfig | 2 ++ 2 files changed, 3 insertions(+) diff --git a/etc/gitattributes b/etc/gitattributes index 5f257a6..5244046 100644 --- a/etc/gitattributes +++ b/etc/gitattributes @@ -4,3 +4,4 @@ Gemfile diff=ruby Capfile diff=ruby *_spec.rb diff=rspec +*.npy binary diff=npy diff --git a/etc/gitconfig b/etc/gitconfig index c744996..5b74c69 100644 --- a/etc/gitconfig +++ b/etc/gitconfig @@ -20,6 +20,8 @@ color = auto mnemonicprefix = true [diff "rspec"] xfuncname = "^[ \t]*((RSpec|describe|context|it|before|after|around|feature|scenario)[ \t].*)$" +[diff "npy"] +textconv = "python -c 'import numpy as np; import sys; np.savetxt(sys.stdout, np.load(sys.argv[1]), fmt=\"%s\", delimiter=\"\t\")'" [log] date = local graph = true