well, you can do even better by taking all this parsing and complexity out of the comment sections.
just add a makefile, add your mappings. done!
example:
~/.gitignore: ./dotfiles/gitignore
ln -s $< $@
you can even add something like ~/.%: ./dotfiles/%:
ln -s $< $@
and just have 1:1 mapping...