Say I've got a .vsprops file that is used in a solution. In that file, various variables are defined such as int_dir for intermediate build results and log_dir for the log results.
Usually, these variables get set to default values (relative to the solution).
For me, I'd like to set these two variables to my ramdisk (R:), i.e. no longer
$(SolutionDir)\intermediate
but
R:\myproject\intermediate
If I change the .vsprops file directly, the source control (Git) will mark it as modified.
Is there a way in VSPROPS so that I could check maybe an environment variable and if this variable is not set, the default is used?
If this is not possible, I'd also be interested in a solution for Git to overcome this (but not --assume-unchanged and not .gitignore because maybe other changes in that file could be relevant).
A pure Git solution could use a gitattribute filter driver:
It would involve a
smudgescript, executed ongit checkout, which would:$(SolutionDir)(for instance, test for an environment variable with the updated path in it)xxx.vsprops.tpl) content (the script doesn't know the file names or path it operates on).vspropsfrom a.vsprops.tpl(template file) which is the one being versioned (the.vspropsis no longer versioned)You can add a
cleanscript which would preserve (ongit commit) all the modification done in the.vspropsfile back to the.vsprops.tpl, except for the$(SolutionDir)line.