git/list[1] front-page[2] threads[3] people[4] search[5] about
 

external diff driver is not used for diff --stat?

From
Yaroslav Halchenko <yoh@onerussian.com>
Date
Jan 25, 2018, 04:35 UTC
Message-ID
<20180125043544.GY3296@hopa.kiewit.dartmouth.edu>
In-Reply-To
<xmqqtvyzslcz.fsf_-_@gitster.mtv.corp.google.com>
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        
Previous: Yaroslav HalchenkoNext: Yaroslav Halchenko
Message 13 of 19 in “BUG: merge -s theirs is not in effect (does the same as -s ours)”
  1. Yaroslav HalchenkoSep 25, 2017
  2. Junio C HamanoSep 25, 2017
  3. Yaroslav HalchenkoSep 25, 2017
  4. Re* BUG: merge -s theirs is not in effect (does the same as -s ours)Junio C Hamano, Sep 25, 2017
  5. -X theirs does not resolve symlink conflict Was: BUG: merge -s theirs is not in effectYaroslav Halchenko, Sep 25, 2017
  6. Junio C HamanoSep 26, 2017
  7. Junio C HamanoSep 26, 2017
  8. Junio C HamanoSep 26, 2017
  9. Yaroslav HalchenkoSep 26, 2017
  10. merge: teach -Xours/-Xtheirs to symbolic link mergeJunio C Hamano, Oct 16, 2017
  11. Elijah NewrenDec 29, 2017
  12. Yaroslav HalchenkoDec 29, 2017
  13. external diff driver is not used for diff --stat?Yaroslav Halchenko, Jan 25, 2018
  14. -s theirs use-case(s) Was: BUG: merge -s theirs is not in effectYaroslav Halchenko, Sep 25, 2017
  15. Junio C HamanoSep 26, 2017
  16. Yaroslav HalchenkoSep 26, 2017
  17. Junio C HamanoSep 27, 2017
  18. Yaroslav HalchenkoSep 27, 2017
  19. Yaroslav HalchenkoSep 27, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.