Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need Help with GIT
Need Help with GIT
#1
More accurately, with Git for Windows.

Let me explain my problem.

I'm now part of a new team at my job that's working with some specialized software from a company called Kofax to do document scanning and storage.  There is a development angle to this software, which means we have projects that need to be saved and protected with version control.  Unfortunately, the software stores some of its most important stuff in a file format which is basically an XML file inside a ZIP file with a different extension.  Which, if you're familiar with version control, means it's difficult to do more than just note that the file changed.

Now, I've come across a blog post with advice on how to address this specific problem for the software we're using, which would be great except that when I tried to set up the gitattributes, gitconfig and shell script files as it outlines, nothing happens.  Another page I found in my research revealed that the locations specified by the blog post were basically wrong, so I tried using the allegedly "right" ones, to no avail.  So I'm hoping someone here has a superior grasp of GIT can help me.  Basically all I'm doing is trying to set up a custom diff for the two file types that are disguised ZIP files.  

Oh, and since this method is for Git for Windows, and our shop has standardized on SourceTree, I plan to move this over to SourceTree as soon as I know the right way to make it work.

Even though it should go without saying, I'll note that I have all the relevant software installed:  Git for Windows with Git Bash and Gzip, mainly.  I've got Gzip added to the system path to make sure it can be seen.

Can anyone help?

Thanks.
-- Bob

I have been Roland, Beowulf, Achilles, Gilgamesh, Clark Kent, Mary Sue, DJ Croft, Skysaber.  I have been 
called a hundred names and will be called a thousand more before the sun grows dim and cold....

Reply
RE: Need Help with GIT
#2
Huh, I probably don't have a superior grasp of Git for this kind of thing, and I've never used Git for Windows.  But that post looks like it should work.  See this Stack Overflow on a using a custom git diff.

How old is your git?  People are generally pretty bad about updating it.

Is that script even getting executed?  Is it marked as executable?  Or is it not modifying the display?
--∇×v⃑
Reply
RE: Need Help with GIT
#3
My local copy is brand new; installed just a few days ago.

The script has "read and execute" privileges for all users (which is me, with various different hats, on this system).

I believe because of the way things are handled by GfW that I would see if it's being executed, and it doesn't appear to be. As far as I can tell, the script is run in GfW's copy of Bash, which has sed and other functionality rolled in; it may even have Gzip/Gunzip as well, but I downloaded and installed it just to make sure. I don't see any kind of error message, and what GfW displays is the same "this is a binary file, all I can tell you is it's changed" text it would normally.

What I suspect is I have the script in the wrong place, or either gitconfig or gitattributes misplaced, or some combination/permutation of all three. I would love to track this down definitively in the docs, but apparently GfW doesn't have docs?
-- Bob

I have been Roland, Beowulf, Achilles, Gilgamesh, Clark Kent, Mary Sue, DJ Croft, Skysaber.  I have been 
called a hundred names and will be called a thousand more before the sun grows dim and cold....

Reply
RE: Need Help with GIT
#4
Okay, update:

I cleared out several duplicates of my ktm shell script, ktmdiff.sh, and put a single copy in C:/Program Files/Git/.  It has all the right permissions, not that I needed to set them.  Its contents are:

Code:
#!/bin/sh
gunzip -c -S xdc $1 | sed 's/>/>\n/g'

I used "git config --list --show-origin" in gitbash to show me all the config files.  (There were three.)  I edited each one and made sure they had a section that looked like this in them:

Code:
[diff "ktm"]
binary = true
textconv = C:/Program Files/Git/ktmdiff.sh

Finally, I made sure there was a gitattributes file in the root of the local repo with the contents:

Code:
*.xdc diff=ktm
*.XDC diff=ktm
*.fpr diff=ktm
*.FPR diff=ktm

There are several other gitattributes files, often paired with a gitconfig.  I made sure they all had this in them, too.

And still when I try to look at an FPR file in Git for Windows, this is all I see:

Code:
* gzip compressed data, max compression, from NTFS filesystem (NT), original size modulo 2^32 9455
* Binary file (not showing content).

I get the same for XDC files, and of course for the lowercase versions of those extensions.

What should be happening is that GfW should be recognizing the extension, feeding both versions of the file to the script, and comparing the two results.  What can I still be doing wrong?

Thanks.
-- Bob

I have been Roland, Beowulf, Achilles, Gilgamesh, Clark Kent, Mary Sue, DJ Croft, Skysaber.  I have been 
called a hundred names and will be called a thousand more before the sun grows dim and cold....

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)