Git Product home page Git Product logo

git-xl's Introduction

Git XL - A Git Extension for Excel

(Note: Git XL was previously called "git-xltrail")

Git XL is an open-source Git command line extension for managing Excel workbook files in Git.

The extension makes git diff work for Excel VBA (xls, xlt, xla, xlam, xlsx, xlsm, xlsb, xltx, xltm). Git XL does not require Excel as it works directly on the workbook file.

With Git XL installed, Git can diff Excel VBA just like any other source code file.

It is written in Python, with pre-compiled binaries available for Windows.

Installation instructions and docs are available at https://www.xltrail.com/git-xl.

Getting Started

Installation

You can install the Git XL client on Windows, using the pre-compiled binary installer.

This repository can also be built-from-source using Python and PyInstaller.

Git XL requires a global installation once per-machine. This can be done by running:

C:\Developer>git xl install

Alternatively, initialise Git XL locally (per repository), using the --local option, inside the root folder of your repository’s local working copy:

C:\Developer>git xl install --local

Usage

Diff workbooks

Get meaningful git diff output when comparing Excel workbook files containing VBA code.

C:\Developer>git diff dev..master
diff --xl a/Book1.xlsb b/Book1.xlsb
--- a/Book1.xlsb/VBA/Module/Module1
+++ b/Book1.xlsb/VBA/Module/Module1
@@ -1,4 +1,4 @@
 Option Explicit
 Public Function Version() As String
-   Version = "v1.0"
+   Version = "v1.1"
 End Function

Docs

Docs are available at https://www.xltrail.com/git-xl.

Contributing

Please open a new issue to report bugs or create a pull request to send patches.

git-xl's People

Contributors

bstiel avatar denis-roy avatar fzumstein avatar lubaxe avatar matthewrclarke avatar tan9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-xl's Issues

troublesome --help

C:\Users\felix\DEV\demo>git-xltrail --help
Error: unknown command "--help" for "git-xltrail"
Run 'git-xltrail --help' for usage.

"git bash here" doesn't find git-xltrail

when I used ‘git bash here’ (right click on a folder in explorer), git could not find the xltrail tool.
I have to append the following lines in .profile to have git free client to work.

$ cat $HOME/.profile
GIT_XLTRAIL_PATH="C:\Program Files\Git xltrail"
export GIT_XLTRAIL_PATH
PATH=$PATH:"/c/Program Files/Git xltrail"
export PATH

git diff how to provide password if the excel&the VBA is password protected currently throwing "Invalid password"

I am trying to figure out how to use xltrail for our project. Installed xltrail client as per instructions.
But I am getting the following error when executing git diff
[18812] Failed to execute script diff Traceback (most recent call last): File "diff.py", line 28, in <module> Aspose.Cells.CellsException: Invalid password. at ^N\u2004\u2003.^B(^E\u200b\u2000\u2002 ^B, String ^C) at Aspose.Cells.Workbook.^B(String ^B, LoadOptions ^C) at xltrail.core.Workbook..ctor(String path) fatal: external diff died, stopping at FMT.xlsm
The git config has the following entry
[diff "xltrail"] command = git-xltrail-diff.exe [merge "xltrail"] name = xltrail merge driver for Excel workbooks driver = git-xltrail-merge.exe %P %O %A %B

Any idea how to provide the password when the file is protected.

add Linux support

Thank you for this wonderful project.

My setup might be unusual but I run Windows + Excel in Virtualbox on a GNU/Linux Debian/stretch machine. My project folder is a shared folder so I can use all the command line stuff in Linux and work with Excel in the Virtualbox.

It would be fantastic if git xltrail was available in Linux too. Currently the setup/installation fails (after cloning) :

% pwd
~proj/misc/git-xltrail
% python3 --version
Python 3.5.3

% virtualenv -p $(which python3) venv
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/jkirk/projects/misc/git-xltrail/venv/bin/python3
Also creating executable in /home/jkirk/projects/misc/git-xltrail/venv/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.

% . venv/bin/activate
% pip install -r requirements.txt

% pip install -r requirements.txt
Collecting colorama==0.3.9 (from -r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/db/c8/7dcf9dbcb22429512708fe3a547f8b6101c0d02137acbd892505aee57adf/colorama-0.3.9-py2.py3-none-any.whl
Collecting pythonnet==2.3.0 (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/89/3b/a22cd45b591d6cf490ee8b24d52b9db1f30b4b478b64a9b231c53474731e/pythonnet-2.3.0.tar.gz
Collecting pyinstaller==3.3.1 (from -r requirements.txt (line 3))
Collecting pefile>=2017.8.1 (from pyinstaller==3.3.1->-r requirements.txt (line 3))
Requirement already satisfied: setuptools in ./venv/lib/python3.5/site-packages (from pyinstaller==3.3.1->-r requirements.txt (line 3)) (41.0.1)
Collecting macholib>=1.8 (from pyinstaller==3.3.1->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/41/f1/6d23e1c79d68e41eb592338d90a33af813f98f2b04458aaf0b86908da2d8/macholib-1.11-py2.py3-none-any.whl
Collecting future (from pefile>=2017.8.1->pyinstaller==3.3.1->-r requirements.txt (line 3))
Collecting altgraph>=0.15 (from macholib>=1.8->pyinstaller==3.3.1->-r requirements.txt (line 3))
  Using cached https://files.pythonhosted.org/packages/0a/cc/646187eac4b797069e2e6b736f14cdef85dbe405c9bfc7803ef36e4f62ef/altgraph-0.16.1-py2.py3-none-any.whl
Building wheels for collected packages: pythonnet
  Building wheel for pythonnet (setup.py) ... error
  ERROR: Complete output from command /home/jkirk/projects/misc/git-xltrail/venv/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-jilzgp3v/pythonnet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-vk_d05qc --python-tag cp35:
  ERROR: running bdist_wheel
  running build
  running build_ext
  Could not load file or assembly or one of its dependencies.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-jilzgp3v/pythonnet/setup.py", line 405, in <module>
      zip_safe=False,
    File "/home/jkirk/projects/misc/git-xltrail/venv/lib/python3.5/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/jkirk/projects/misc/git-xltrail/venv/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.5/distutils/command/build_ext.py", line 339, in run
      self.build_extensions()
    File "/usr/lib/python3.5/distutils/command/build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "/usr/lib/python3.5/distutils/command/build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "/tmp/pip-install-jilzgp3v/pythonnet/setup.py", line 139, in build_extension
      self._install_packages()
    File "/tmp/pip-install-jilzgp3v/pythonnet/setup.py", line 269, in _install_packages
      subprocess.check_call(cmd, shell=use_shell)
    File "/usr/lib/python3.5/subprocess.py", line 271, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command 'mono tools/nuget/nuget.exe update -self' returned non-zero exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pythonnet
  Running setup.py clean for pythonnet
Failed to build pythonnet
Installing collected packages: colorama, pythonnet, future, pefile, altgraph, macholib, pyinstaller
  Running setup.py install for pythonnet ... error
    ERROR: Complete output from command /home/jkirk/projects/misc/git-xltrail/venv/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-jilzgp3v/pythonnet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-v19pscej/install-record.txt --single-version-externally-managed --compile --install-headers /home/jkirk/projects/misc/git-xltrail/venv/include/site/python3.5/pythonnet:
    ERROR: running install
    running build
    running build_ext
    Could not load file or assembly or one of its dependencies.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-jilzgp3v/pythonnet/setup.py", line 405, in <module>
        zip_safe=False,
      File "/home/jkirk/projects/misc/git-xltrail/venv/lib/python3.5/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/jkirk/projects/misc/git-xltrail/venv/lib/python3.5/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python3.5/distutils/command/install.py", line 583, in run
        self.run_command('build')
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.5/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 339, in run
        self.build_extensions()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 448, in build_extensions
        self._build_extensions_serial()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 473, in _build_extensions_serial
        self.build_extension(ext)
      File "/tmp/pip-install-jilzgp3v/pythonnet/setup.py", line 139, in build_extension
        self._install_packages()
      File "/tmp/pip-install-jilzgp3v/pythonnet/setup.py", line 269, in _install_packages
        subprocess.check_call(cmd, shell=use_shell)
      File "/usr/lib/python3.5/subprocess.py", line 271, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'mono tools/nuget/nuget.exe update -self' returned non-zero exit status 1
    ----------------------------------------
ERROR: Command "/home/jkirk/projects/misc/git-xltrail/venv/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-jilzgp3v/pythonnet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-v19pscej/install-record.txt --single-version-externally-managed --compile --install-headers /home/jkirk/projects/misc/git-xltrail/venv/include/site/python3.5/pythonnet" failed with error code 1 in /tmp/pip-install-jilzgp3v/pythonnet/

I tracked it down a bit and it seems to be related to pythonnet/pythonnet#729.

Do you have any idea what to do or how I can help to make this happen?

git xl is not a git command

I am running win 7, downloaded the git-xl-windows-0.4.1.exe file, and installed it.

However when I try to install xl in git with
git xl install

I get the error
git: 'xl' is not a git command.

I have install xltrails without a problem. I have recently uninstalled xltrails but that did not correct the xl install problem

suggestions?

git-xltrail suppresses git merge conflicts

If you are merging two branches where an Excel workbook would cause a Git merge conflict, it does not raise the merge conflict anymore with git-xltrail installed. This is fine for VBA as git-xltrail handles this part but it is unexpected for the sheets.

make "git diff HEAD/--staged/origin" work

C:\Users\felix\DEV\xltrail-demo0>git diff HEAD
[6332] Failed to execute script git-xltrail-diff
Traceback (most recent call last):
  File "git-xltrail-diff.py", line 51, in <module>
  File "git-xltrail-diff.py", line 14, in get_vba
  File "site-packages\oletools\olevba3.py", line 2281, in __init__
  File "site-packages\oletools\thirdparty\olefile\olefile.py", line 508, in isOleFile
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\dev\\null'
fatal: external diff died, stopping at Book1 - Copy.xlsm

git diff fatal exception

git-xl has been working well for some time, but I've recently had it failing on my main excel project file. The error is as follows:

$ git diff
[21228] Failed to execute script diff
Traceback (most recent call last):
  File "diff.py", line 47, in <module>
  File "diff.py", line 12, in get_vba
  File "site-packages\oletools\olevba3.py", line 2793, in extract_all_macros
  File "site-packages\oletools\olevba3.py", line 2738, in extract_macros
  File "site-packages\oletools\olevba3.py", line 2749, in extract_macros
  File "site-packages\oletools\olevba3.py", line 1324, in _extract_vba
  File "site-packages\oletools\olevba3.py", line 1301, in check_value
oletools.olevba3.UnexpectedDataError: Unexpected value in VBA/dir for variable PROJECTLCID_Id: expected 0002 but found 004A!
fatal: external diff died, stopping at CDR compliance tool.xlsb

I tried creating a new excel workbook with a simple VBA macro and it too throws the same error. The environment is Microsoft® Excel® for Microsoft 365 MSO (16.0.14131.20278) 64-bit

Seems that the PROJECTLCID_Id value is wrong in the file, but Excel doesn't seem to mind and running a repair doesn't fix the problem. Has MS changed this value perhaps?

flake8 finds several undefined names in git-xltrail-version-info.py

flake8 testing of https://github.com/ZoomerAnalytics/git-xltrail on Python 3.6.4

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./BUILDING.py:3:7: E999 SyntaxError: invalid syntax
Using a virtual environment is highly recommended. 
      ^
./scripts/windows/git-xltrail-version-info.py:1:1: F821 undefined name 'VSVersionInfo'
VSVersionInfo(
^
./scripts/windows/git-xltrail-version-info.py:2:7: F821 undefined name 'FixedFileInfo'
  ffi=FixedFileInfo(
      ^
./scripts/windows/git-xltrail-version-info.py:13:5: F821 undefined name 'StringFileInfo'
    StringFileInfo(
    ^
./scripts/windows/git-xltrail-version-info.py:15:7: F821 undefined name 'StringTable'
      StringTable(
      ^
./scripts/windows/git-xltrail-version-info.py:17:10: F821 undefined name 'StringStruct'
        [StringStruct(u'CompanyName', u'Zoomer Analytics LLC'),
         ^
./scripts/windows/git-xltrail-version-info.py:18:9: F821 undefined name 'StringStruct'
        StringStruct(u'FileDescription', u'Git xltrail'),
        ^
./scripts/windows/git-xltrail-version-info.py:19:9: F821 undefined name 'StringStruct'
        StringStruct(u'FileVersion', u'0.0.0'),
        ^
./scripts/windows/git-xltrail-version-info.py:20:9: F821 undefined name 'StringStruct'
        StringStruct(u'InternalName', u'git-xltrail'),
        ^
./scripts/windows/git-xltrail-version-info.py:21:9: F821 undefined name 'StringStruct'
        StringStruct(u'LegalCopyright', u'Zoomer Analytics LLC'),
        ^
./scripts/windows/git-xltrail-version-info.py:22:9: F821 undefined name 'StringStruct'
        StringStruct(u'OriginalFilename', u'git-xltrail'),
        ^
./scripts/windows/git-xltrail-version-info.py:23:9: F821 undefined name 'StringStruct'
        StringStruct(u'ProductName', u'Git xltrail'),
        ^
./scripts/windows/git-xltrail-version-info.py:24:9: F821 undefined name 'StringStruct'
        StringStruct(u'ProductVersion', u'0.0.0')])
        ^
./scripts/windows/git-xltrail-version-info.py:26:5: F821 undefined name 'VarFileInfo'
    VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
    ^
./scripts/windows/git-xltrail-version-info.py:26:18: F821 undefined name 'VarStruct'
    VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
                 ^
1     E999 SyntaxError: invalid syntax
14    F821 undefined name 'VSVersionInfo'
15

Merging wbs with userform changes fastforwards instead of merges

When trying to merge two workbooks, one with just a code change and one with a conflicting code change and a change to a userform object, xltrail fast-forwards to the one with the userform change and doesn't raise a merge conflict. Both commits show up in the log. When diffing between them, the conflicting code change appears.

This is the first bug report I'm made so I'm not sure what info you need, but if it helps, here's what I'm seeing on the command line:

C:\Users\gnsoria\macros>git merge Bug2
Updating 71bdbc5..71b7639
Fast-forward
 CTMAddIn.xlam | Bin 576174 -> 577881 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

C:\Users\gnsoria\macros>git log --oneline -2
71b7639 (HEAD -> Bug1, Bug2) Testing userform bug 2. Some userform changes.
71bdbc5 Testing userform bug. No userform changes made.

C:\Users\gnsoria\macros>git diff 71bdbc5..71b7639
diff --xltrail a/CTMAddIn.xlam b/CTMAddIn.xlam
--- a/CTMAddIn.xlam/VBA/Module/zTests_GS
+++ b/CTMAddIn.xlam/VBA/Module/zTests_GS
@@ -4,7 +4,7 @@
Sub testingxlTrailBug()
     On Error GoTo errHandler

-    Debug.Print "Bug 1 testing. No userform changes."
+    Debug.Print "Bug 2 testing. Some userform changes."

 Exit Sub
 errHandler:

change branch does not update my excel file (while opened)

hello! i am very happy that i can use this to work with my excel files. I mostly use it for macros, now when i have my excel code in VBA i see the differences but lets say if i am in dev_branch and make changes there (and leave my excel open) then commit and then i want to change to the master branch, the files that i made to the dev_branch appear as uncommited to the master branch and i cannot discard them directly, i need to close excel and open it again...
Is there a way to enhance this? like when working with .cpp files or so? that they automatically update without needing to close the file and open it again?

Change "git xl install [--local]" to "git xl enable [--global]"

I know that the CLI has been inspired by how git lfs works, but I find it confusing to use "installing" for the process of running the graphical installer and again for enabling the extension on a repo or global basis.

Also, I'd expect the default to be local, like you also have to provide a --global flag with things like git config --global user.name.

[12304] Failed to execute script diff -- can't find "C:\dev\null"

git diff fails with this message:

[12304] Failed to execute script diff
Traceback (most recent call last):
  File "diff.py", line 28, in <module>
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\dev\null'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Aspose.Cells.Workbook.^B(String ^B, LoadOptions ^C)
   at xltrail.core.Workbook..ctor(String path)
fatal: external diff died, stopping at filename.xlsm

I'm running git-xl-windows-0.4.1 on a Windows 10 PC. I've tried restarting my computer and reinstalling the software, to no effect. This extension has worked for other files, but always fails on this file.

git xltrail doesn't work, only git-xltrail

Under certain circumstances, the git xltrail command doesn't seem to work:

Issue Description- Typo in Installation instructions?

Team, on the download page for the Open Source version of xltrail (URL above) the first line of instructions given under “getting Started” is-

C:>git xltrail install

However this causes an “unknown Git command” error until AFTER xltrail has been installed.

Looking at the executable files installed by xltrail, I believe the command should be-

C:>git-xltrail install

(note the hyphen instead of a space).

Regards: C Evans

Git XL is not really open source

There's no law that Git XL has to be open source, but if it isn't it probably shouldn't claim to be.

I tried to install from source and immediately discovered that it's a thin python wrapper around a binary xltrail-core.dll checked into git in the src directory.

This has huge security and portability issues:

  • I would have loved to port it to my OS of choice
  • was interested in using it in an environment where we need to audit all dependencies. I had to reject it immediately due to this issue.
  • Individuals should be able to audit their tools to ensure they don't contain spyware and adware. Opening the source gives a lot of instant trust and transparency.
  • there can't really be meaningful community contribution when we can't make changes. It's better to get a pull-request with a fix than just a complaint.

Please consider making the missing sources to xltrail-core.dll, or at least the necessary parts, available!

If that is not feasible please consider clarifying statements like these:

  • "Git XL is an open-source wrapper for a proprietary binary Windows DLL that provides a Git command line extension for managing Excel workbook files in Git."
  • "It is written in Python except for the proprietary dll part"

Windows users that just want to download a binary that works probably don't understand or care about the distinction between "Freeware" and open source software. If this is the target group for your product, it wouldn't seem to matter much to them. But the users like me that would really appreciate that you provided this as open source are likely to be disappointed, suspicious, or offended. So there would appear no net benefit to a misleading claim.

It seems like your group genuinely appreciates and supports open source, and I assume that it is not the intention to mischaracterize anything and there's nothing wrong with being closed source if that's the best business case.

I appreciate your consideration.

`git diff` for 2 commits of an Excel file using spreadsheetcompare

Currently, I have been able to do this:

git diff Book1.xlsx

where, it shows the difference b/w last pushed and current changes made in SPREADSHEETCOMPARE.

But I want to see the difference b/w 2 commits of an Excel file in SPREADSHEETCOMPARE.

Btw, I don't want to use any cloud for data storage. So, I have setup a local server in my PC.

Is there a way to show the diff. b/w 2 commits of an Excel file in SPREADSHEETCOMPARE?

Cannot use diff with Beyond Compare

I'll copy and paste from my Stack Overflow question:

I'm using Git for Windows with the xltrail extension to provide a readable output when using git diff <Excel workbook>. I'm also using the graphical diff/merge tool Beyond Compare 4 Pro which runs when using git difftool and provides a nice side-by-side diff and three-way merge interface.

However, when I run git difftool <Excel workbook>, I get the normal git diff output without a prompt to open Beyond Compare. How can I get Git, xltrail, and Beyond Compare to work together?

Install breaks if ~ in core.excludesfile

Steps to reproduce:

  1. Use Windows. (This step might not be mandatory)
  2. Store your global ignores in e.g. ~/.gitignore_global.
  3. Point to your global ignores using core.excludesfile=~/.gitignore_global in git config. The tilde is the important part here.
  4. Run git xl install.

Expected behaviour

Installations succeeds. :)

Actual behaviour

[...] Failed to execute script cli
Traceback (most recent call last):
  File "cli.py", line 344, in <module>
  File "cli.py", line 260, in execute
  File "cli.py", line 295, in install
  File "cli.py", line 82, in install
  File "cli.py", line 176, in update_git_file
FileNotFoundError: [Errno 2] No such file or directory: '~/.gitignore_global'

Possible cause

  1. https://github.com/xlwings/git-xl/blob/master/src/cli.py#L176
  2. "Unlike a unix shell, Python does not do any automatic path expansions." (https://docs.python.org/3.7/library/os.path.html)

Possible solution

Use os.path.expanduser for the gitignore path.

Add git show capability

Git diff only works in a branch prior to a commit. Could the diff be accessed in some way to show the changes after the commit using git show? Perhaps the diff could be automatically added to the commit message?

Can override .gitignore files

Looking at the source it looks like it should append ..gitignore files with the additional ignores. At a minimum with sym linked .gitignore files it completely overrides the file. Oddly the .gitconfig changes it does not do the same behavior on.

git diff doesn't work in Parallels windows environment

I'm working on Mac and the only one to work well with VBA for excel - use some Windows environment. I've decided to use Parallels Desktop (kinda of virtualization software) with Windows 10 on my Mac.
Command git xl ls-files - works perfectly, but git diff says only "files differ" and that's all.

Handling of git lfs

Currently, when installing git lfs after running git xltrail install --local, .gitattributes looks like this:

*.xla diff=xltrail
*.xla merge=xltrail
*.xlam diff=xltrail
*.xlam merge=xltrail
*.xls diff=xltrail
*.xls merge=xltrail
*.xlsb diff=xltrail
*.xlsb merge=xltrail
*.xlsm diff=xltrail
*.xlsm merge=xltrail
*.xlsx diff=xltrail
*.xlsx merge=xltrail
*.xlt diff=xltrail
*.xlt merge=xltrail
*.xltm diff=xltrail
*.xltm merge=xltrail
*.xltx diff=xltrail
*.xltx merge=xltrail
*.xls* filter=lfs diff=lfs merge=lfs -text

and for diffing, lfs overwrites xltrail

Diff Not working with Sourcetree or Git-Gui

git diff works as expected from the command line but .xlsm files are being treated as binary files by both Sourcetree and Git-Gui.

Git xltrail/xl versions 4.0 and 3.1 tested

Sourcetree versions 3.1.3 & 3.26 tested

Git is version 2.23.0.windows.1

Git-Gui is version 0.21.GITGUI

git diff works as expected from the Sourcetree MINGW64 terminal and as a new tool command in Git-Gui.

+/- cells indication seems mixed up

doing git diff on working copy with 1 cell before and 2 cells after the change yields:

--- a/sales_plan.xlsm/Worksheets/Sheet1
+++ b/sales_plan.xlsm/Worksheets/Sheet1
-2 cells
+1 cell

No option to remove color

I'm trying to create a patch by redirecting the diff output to a file, i.e.

git diff <Excel workbook> > <Excel workbook>.patch

but the file is "contaminated" with color codes, e.g.

�[31m- On Error GoTo 0
�[32m+ ' On Error GoTo 0

install not success

Exception in thread Thread-1:
Traceback (most recent call last):
File "threading.py", line 916, in _bootstrap_inner
File "threading.py", line 864, in run
File "subprocess.py", line 1083, in _readerthread
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in
ultibyte sequence

Traceback (most recent call last):
File "cli.py", line 344, in
File "cli.py", line 260, in execute
File "cli.py", line 289, in install
File "cli.py", line 63, in init
File "cli.py", line 128, in get_global_gitconfig_dir
File "cli.py", line 122, in execute
File "subprocess.py", line 425, in run
File "subprocess.py", line 863, in communicate
File "subprocess.py", line 1133, in _communicate
IndexError: list index out of range
[101984] Failed to execute script cli

C:\Users\yfj>git xltrail install
git: 'xltrail' is not a git command. See 'git --help'.

Does git-xl support chinese yet?

image
I am using git diff in a Chinese window 10 environment, but it shows the above error.
I have downloaded and installed the 0.5.0 exe of xltrail , and I have run the command
git xl install and git xl install --local
Both won't fix the issue above, I am guessing whether it's because it does not support Chinese yet,
Anyway, thanks for sharing this wonderful tool, I think this really helps.

Plans regading "word" files?

I really like the project. Are there any plans to enhace this, so it can be used with "word" files (docx, docm, ...) ?

I'm asking, because I will have to convince a lot of people to use this properly in our organization, and one big dealbreaker is that it is so far "only" for word. I myself don't have enough experience to tackle this on my own, so I wanted to ask, if this is something you would generally consider in the future, or if this shall stay an excel-only project.

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.