Giter VIP home page Giter VIP logo

Comments (4)

HelenFoster avatar HelenFoster commented on August 29, 2024

OK, I think I figured it out:

  • The thing specified in command is enabled and disabled by --ext-diff and --no-ext-diff
  • The thing specified in textconv is enabled and disabled by --textconv and --no-textconv
  • If both are present and enabled, command takes priority.
  • If neither is present and enabled, it says "Binary files x and y differ".

the first link claims we need a wrapper script to pass arguments 2 and 5 to ExcelCompare, while the other sources don't do this

It appears that we do need to do this, or it diffs the wrong things.

The wrapper also needs to return 0, or the diff stops after the first Excel file, as explained in #30.

from excelcompare.

na-ka-na avatar na-ka-na commented on August 29, 2024

I think I will add an option --git_diff_mode where it will return 0 even if files differ. Will that be sufficient?

from excelcompare.

HelenFoster avatar HelenFoster commented on August 29, 2024

I think I will add an option --git_diff_mode where it will return 0 even if files differ. Will that be sufficient?

In this mode, it also needs to use the 2nd and 5th non-option arguments for the filepaths, instead of the 1st and 2nd.

If we write in the gitconfig:
command = excel_cmp --git_diff_mode

Then using git diff on older commits executes something like:
excel_cmp --git_diff_mode foo.xls /tmp/bCXUeU_foo.xls 77d26a92f6552ff9ab6e1d4586f8fa56143e740d 100644 /tmp/cRDpJ0_foo.xls 8fe0234a576d401423cc7068a40b14271e0339a4 100644

And here we want to diff the two files in /tmp.

The other arguments seem to be used to print a message about the git status of the changed file, but that could be worked out later.


Also, it would sometimes be useful to return 0 on "Failed to read as excel file". (Say I have one unimportant spreadsheet in my repo history that doesn't work, and I still want git diff to process the rest of them.) Maybe this should be a separate option.

from excelcompare.

HelenFoster avatar HelenFoster commented on August 29, 2024

I copied the excel_cmp shell script to excel_cmp_git and tried to edit it to approximate the behaviour of the internal git diff. Not sure if this is quite right yet, but I think it's doing what I need it to for now...

#!/usr/bin/env sh

if [ -L $0 ];then
  dir=`readlink -f $0|xargs dirname`
else
  dir=`dirname $0`
fi
tput bold; echo "excel_cmp_git a/$1 b/$1"
tput bold; echo "mode $4..$7"
tput bold; echo "index ${3:0:7}..${6:0:7}"
tput sgr0
java -ea -cp "$dir/dist/*" com.ka.spreadsheet.diff.SpreadSheetDiffer "$2" "$5"
exit 0

from excelcompare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.