better debug handling for git