Revert "gluegen: directly use git subcommands rather than sed over a temp file"

This reverts commit 1bf89ec4fde4227f8935f8c91b7ee22d160da581.