ajoberstar / reckon

Infer a project's version from your Git repository.
Apache License 2.0
185 stars 28 forks source link

Remove the restriction of clean repo for pushing a final version? #128

Closed tsanborn19-zz closed 4 years ago

tsanborn19-zz commented 4 years ago

I have a system that needs to change the execute permissions on a file when the automated build runs, and unfortunately that file cannot be made executable before that time.

That makes it so that I can't push final versions with this plugin, which is extremely disappointing.

Is there any way to disable the clean repo requirement for final versions?

ajoberstar commented 4 years ago

Thank you for your interest in the plugin and for raising this!

Currently, this isn't configurable. Right now, I have no plans to provide configurability for these core assumptions of reckon, which isn't to say I'm not sympathetic to the technical limitations that can sometimes prevent people from meeting them. Not ruling it out in the future, but it's a won't fix for now.

Cinderhaze commented 4 years ago

@treversan - how does reckon behave if you tell git to ignore file permissions, then change it to executable?

https://github.com/Gizra/KnowledgeBase/wiki/How-to-set-Git-to-ignore-chmod-changes

git config core.filemode false

tsanborn19-zz commented 4 years ago

Good call @Cinderhaze

Thanks for the help!

dtrunk90 commented 6 months ago

Another way is to temporarily ignore the file:

git update-index --assume-unchanged "$FILE"
./gradlew doSomeStuff
git update-index --no-assume-unchanged "$FILE"

Source: https://gist.github.com/sloanlance/0f0cb5e9819e11d698a26a623bc649f4