Dear Git Peoples,

I am torturing git and git-annex here trying to compare some logs from a
run of a software recorded in two different branches.  As many other
tools, software often logs its version, elapsed times etc, so diff becomes not 
of interest to me:

        $> PATH=~/proj/misc/git/INSTALL-2.16.1/bin:$PATH git diff test-18.0.09 
test-18.0.05+git24-gb25b21054_dfsg.1-1_nd90+1 -- 
AFNI_data6/FT_analysis/FT.results/out.allcostX.txt-git
        diff --git a/AFNI_data6/FT_analysis/FT.results/out.allcostX.txt-git 
b/AFNI_data6/FT_analysis/FT.results/out.allcostX.txt-git
        index db85c9be..5f4a704d 100644
        --- a/AFNI_data6/FT_analysis/FT.results/out.allcostX.txt-git
        +++ b/AFNI_data6/FT_analysis/FT.results/out.allcostX.txt-git
        @@ -1,4 +1,4 @@
        -++ 3dAllineate: AFNI version=AFNI_18.0.09 (Jan 19 2018) [64-bit]
        +++ 3dAllineate: AFNI 
version=Debian-18.0.05+git24-gb25b21054~dfsg.1-1~nd90+1 (Jan 23 2018) [64-bit]
         ++ Authored by: Zhark the Registrator
         ++ Source dataset: ./anat_final.FT+tlrc.HEAD
         ++ Base dataset:   ./final_epi_vr_base_min_outlier+tlrc.HEAD
        @@ -28,5 +28,5 @@ volume 0
                lpa  = 0.921773
                lpc+ = 0.310739
                ncd  = 0.967007
        -++ 3dAllineate: total CPU time = 0.0 sec  Elapsed = 1.5
        +++ 3dAllineate: total CPU time = 0.0 sec  Elapsed = 1.3


so I came up with a simple differ to exclude those:

        $> cat ~/bin/git-annex-diff-wrapper
        #!/usr/bin/env bash                                                     
        
        LANG=C diff --color=always --ignore-matching-lines="\(AFNI 
version=\|time.*Elapsed\)" -u "$2" "$5"  

which works as it should (sorry for long lines, just wanted to not cut out
anything which might be of relevance)

        $> PATH=~/proj/misc/git/INSTALL-2.16.1/bin:$PATH 
GIT_EXTERNAL_DIFF='git-annex diffdriver  -- ~/bin/git-annex-diff-wrapper --' 
git diff --ext-diff test-18.0.09 test-18.0.05+git24-gb25b21054_dfsg.1-1_nd90+1 
-- AFNI_data6/FT_analysis/FT.results/out.allcostX.txt-git     
        # no output received

(and even on annexed files -- whoohoo).

The problem comes that --stat seems to be not using the external diff (it is
line the same as above just with --stat):

        $> PATH=~/proj/misc/git/INSTALL-2.16.1/bin:$PATH 
GIT_EXTERNAL_DIFF='git-annex diffdriver  -- ~/bin/git-annex-diff-wrapper --' 
git diff --ext-diff test-18.0.09 test-18.0.05+git24-gb25b21054_dfsg.1-1_nd90+1 
--stat -- AFNI_data6/FT_analysis/FT.results/out.allcostX.txt-git
         AFNI_data6/FT_analysis/FT.results/out.allcostX.txt-git | 4 ++--
         1 file changed, 2 insertions(+), 2 deletions(-)


A shortcoming or somehow "by design"? ;)

PS Please CC me in replies

Cheers!

-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        

Reply via email to