I have a problem where we need to provide a filtered version of our git repository to an outsourcer.
So we need to maintain a version of our git repository that has certain keywords find and replaced with something else.
The reasoning behind this is we don't want the outsourcers pasting code in forums that has our clients name in it as it has happened in the past.
It would be cool if git could expose something like this on the fly, but I imagine that isn't possible because it would change all the SHA ids.
I guess the solution is to have 2 separate git repositories that are kept in sync somehow. The syncing would need to be 2 way. So that when we make changes to the code base, those changes get pushed to filtered code base (and filtered on the way) and if the the outsourcers make changes then those changes get pushed to our repository, but unfiltered on the way back.
We could probably rangle something together with cherry-picking, etc. But I imagine it'd be a bit of work to get it reliable. I suppose conceptually it's similar to git-svn.
Are there tools out there that could produce this outcome?
<img src="https://i.stack.imgur.com/3LTL2.png" alt="filter driver">
In your case, you would:
<li>have a special branch where a git attribute declares a outsourcerscript</li>
<li>maintain in that branch a outsourcerscript able to replace those keywords</li>
<li>merge your work, and then checkout that branch in order to get a filtered working tree</li>
<li>add the content of that working tree to your separate repo you need to communicate to the outsourcer.</li>
For changes coming from the outsourcer, you add them to an import branch where a
clean script will, on commit, restore the right keywords.
And then you merge that import branch to your usual working branch.