BrettMayson / HEMTT

Build System for Arma 3
http://hemtt.dev/
GNU General Public License v2.0
113 stars 40 forks source link

Versioning with Git Hash yields error #626

Closed Timi007 closed 10 months ago

Timi007 commented 10 months ago

Versions: HEMTT: 1.10.2 Git: 2.43.0.windows.1

The project is configured to include the Git commit hash in the version:

# project.toml
[version]
git_hash = 4

Running hemtt build or hemtt release in a Git repository yields following error:

$ hemtt release
ERROR Failed to find a git repository with at least one commit, if you are not using git add the following to your project.toml

[version]
git_hash = 0

Asking Git if the current folder is a repository returns:

$ git rev-parse --is-inside-work-tree
true

$ git rev-parse --short HEAD
bb7a98d
BrettMayson commented 10 months ago

I'll need more info, if you can replicate this with the project on a different machine / location

Timi007 commented 10 months ago

After some investigation I found out that it seems to not work with project initialized or cloned a long time ago. If I clone the projects where it did not work again, it works fine. Same for when I copy the project folder, delete the .git folder and git init again.

All my projects before March 2021 do not work. My projects after December 2021 seem to work.

Looking at the .git folder, I do not find any differences between my old projects and newly setup ones.

Timi007 commented 10 months ago

It gets even weirder as I just found out. Simply copying the project directory with all files including the .git folder fixes the issue. Copying with robocopy /E /DCOPY:DAT also fixes it.

But the issue is still present when copying with robocopy /E /DCOPY:DATEX /copyall and running hemtt both as admin. Maybe it is related to some security setting.

Timi007 commented 10 months ago

I cannot reproduce this bug on a different machine. I suspect it has something to do with Windows security settings on Git files.

Copying or cloning the projects will fix this for me.