title: git pass different variable to smudge filter according to the project it is invoked from
body: <p>I want to modify some configuration strings in a git version controlled php script, according to the environment I am using the code in the repository.</p>
  
  <p>I want to set up a smudge/clean filter to modify the configuration string in the code according to the platform, I am checking out (dev/testing). My scripts are in <code>~/scripts</code> and I want to add a config file <code>~/scripts/config</code> to set values used by the script</p>
  
  <p>I have different projects (in different repos) with the same files in it but they should be modified differently, so the script needs to know from which repository it was invoked.</p>
  
  <p>Is there a way to set a project ID maybe in the <code>.gitattributes</code> file which is passed as an environment variable to the filter script?</p>
  
  <p><strong>EXAMPLE:</strong></p>
  
  <p>content of <code>.gitattributes</code>:</p>
  
  <pre><code>PROJECT_ID = "ProjectX"
  </code></pre>
  
  <p>content of smudge script (pseudo code):</p>
  
  <pre><code>host = getConfigValueFromFile(projectXhost)
  if $PROJECT_ID == "ProjectX" then
      print 'host=$host'
  </code></pre>