git pass different variable to smudge filter according to the project it is invoked from -


i want modify configuration strings in git version controlled php script, according environment using code in repository.

i want set smudge/clean filter modify configuration string in code according platform, checking out (dev/testing). scripts in ~/scripts , want add config file ~/scripts/config set values used script

i have different projects (in different repos) same files in should modified differently, script needs know repository invoked.

is there way set project id maybe in .gitattributes file passed environment variable filter script?

example:

content of .gitattributes:

project_id = "projectx" 

content of smudge script (pseudo code):

host = getconfigvaluefromfile(projectxhost) if $project_id == "projectx"     print 'host=$host' 

you can set arbitrary values in repository configuration. example, can set variable this:

$ git config mytool.myvariable myvalue 

and retrieve this:

$ git config mytool.myvariable myvalue 

so smudge/clean script can call git config mytool.myvariable , read output information you've configured.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -