diff --git a/Excel.xlsx.git/_rels/.rels b/Excel.xlsx.git/_rels/.rels
index 3030df4888211b4f4bcf99a6c3ed8b3f679bc154..bdc6ae376eb927579677fff6833f501fcd3cc47c 100644
--- a/Excel.xlsx.git/_rels/.rels
+++ b/Excel.xlsx.git/_rels/.rels
@@ -1,2 +1,6 @@
-
-
\ No newline at end of file
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Excel.xlsx.git/xl/_rels/workbook.xml.rels b/Excel.xlsx.git/xl/_rels/workbook.xml.rels
index 8cd5f3f15db1606cf3e016bd9037da236c59bc4b..7ac2bad75017cc328f32b8d6ab4c015356276a4a 100644
--- a/Excel.xlsx.git/xl/_rels/workbook.xml.rels
+++ b/Excel.xlsx.git/xl/_rels/workbook.xml.rels
@@ -1,2 +1,7 @@
-
-
\ No newline at end of file
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 9ff2dc0c62f7974f191d174f2a785ad89580d1ce..0381b97890b93bfb1f6f450813ebd4d1acbe41f1 100644
--- a/README.md
+++ b/README.md
@@ -3,21 +3,18 @@
> An experiment in tracking versions of modern Office XML files in Git.
Modern Office file formats are ZIP archives with XML files in them.
-The ZIP archives are binary files so Git (GitHub, GitLab where diff cannot be configured) won't display a nice diff for them.
-The XML files are not binary, so in order to display a diff for these, I unpack the ZIP files to directories that are tracked in Git.
-Tracking generated files is pretty dumb, but so it tracking binary files and when forced to have,
-it's not a leap to have the other if it bring something useful to the table.
+The ZIP archives are binary files so Git (and furthemore GitHub, GitLab where diff cannot be tweaked) won't display a nice diff for them.
+The XML files are not binary, so in order to display a diff for these, this unpacks the ZIP files to directories that are tracked in Git.
+Tracking generated files is pretty dumb, but so is tracking binary files and when forced to have one,
+it's not a leap to have the other as well if it bring something useful to the table.
-The way I achieve this is using a [Git pre-commit hook](https://git-scm.com/book/gr/v2/Customizing-Git-Git-Hooks).
-The hook unpacks the ZIP file to a tracked directory, formats the XML files for nice diff and tracks the formatted files as well.
-
-I am using PowerShell because it can be used portably and trying to do this in Bash across native shells and MinGW
-(which is horrible to work with in the default installation of Git for Windows,
-because it lacks `mingw-get` to install dependecies like `7z` and is just generally horrible and terrible and stuff)
-would be harder for me.
+This is achieved using a PowerShell script which unpacks the ZIP file to a tracked directory,
+formats the XML files for nice diff and tracks the formatted files as well.
## Running
+Run `cmd/version-office-files.ps1` whenever you want to add a new version, additionally you can do that on each commit with a hook:
+
- Set up the pre-commit hook:
```sh
@@ -29,18 +26,16 @@ code .git/hooks/pre-commit
```sh
#!/usr/bin/env bash
-powershell cmd/pre-commit.ps1
+powershell cmd/version-office-files.ps1
```
-- Open the file and make some changes
+- Open the files and make some changes
- `open` on Unix
- `start` on Windows
- `git add *`
- `git commit -m "Make some changes"`
- See the commit diff for the Office changes
-Or just make the changes and run the `cmd/pre-commit.ps1` script in PowerShell ISE.
-
## Studying
See `git log` and [development notes](doc/notes.md).
diff --git a/Word.docx.git/_rels/.rels b/Word.docx.git/_rels/.rels
index fdd8c4f37126dc3aabc79f5e9336342868dbfdef..532e30284e1357fa180d203c4615d8c3d7bd903e 100644
--- a/Word.docx.git/_rels/.rels
+++ b/Word.docx.git/_rels/.rels
@@ -1,2 +1,6 @@
-
-
\ No newline at end of file
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Word.docx.git/word/_rels/document.xml.rels b/Word.docx.git/word/_rels/document.xml.rels
index 0079d06931a751c809ea68bee10399648f175815..df1aaec88e65d72667f70d5b3b13d2703d359359 100644
--- a/Word.docx.git/word/_rels/document.xml.rels
+++ b/Word.docx.git/word/_rels/document.xml.rels
@@ -1,2 +1,8 @@
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cmd/pre-commit.ps1 b/cmd/version-office-files.ps1
similarity index 89%
rename from cmd/pre-commit.ps1
rename to cmd/version-office-files.ps1
index 85ba7c9984ceffeec523947c86ce0f68a0c896ee..bc5c19a81a96f634040830ea96001fd58829f98e 100644
--- a/cmd/pre-commit.ps1
+++ b/cmd/version-office-files.ps1
@@ -9,7 +9,7 @@ Get-ChildItem .\* -Include ("*.docx", "*.xlsx", "*.pptx") -Recurse |
Remove-Item "$officePath.zip"
# Format XML files for nice diff
- Get-ChildItem "$officePath.git" -Filter *.xml -Recurse |
+ Get-ChildItem "$officePath.git" -Include ("*.xml", "*.rels") -Recurse |
Foreach-Object {
$xmlPath = $_.FullName
Write-Output "Formatting $xmlPath"
diff --git a/doc/tasks.md b/doc/tasks.md
index 84aef0186dfe8a9ec1b0839c386f759a32a30619..981207be93a209ab5301342fb76a53c3718e6271 100644
--- a/doc/tasks.md
+++ b/doc/tasks.md
@@ -2,7 +2,5 @@
> Planned development:
-- Delete `$officeFile.git` directories without matching files where encountered
-- Fix adding only XML files because there can also be non-XML files (thumbnails and others) which currently have to be added manually
- - Do one `git add` on the whole `.git` directory instead
- Experiment with generating `.txt` file within the `.git` directory with just text nodes extracted from XML for lossy text-only diff
+- See why `PowerPoint.pptx.zip` sticks around when it should get deleted and why it does get deleted for other formats