ghedo/p5-Dist-Zilla-Plugin-GitHub — pull request #20 by rkitover (2013-01-13 21:36:43+00:00)
Title: push.default = matching support

The Problem:

When push.default is set to 'matching' in git config, which it is by
default currently (before git 2.0 comes out) "git push" will only push
local branches that have a corresponding remote branch, and a newly
created GitHub repository does not have any branches, not even master.

Also, a branch in git must have commits in it, an empty branch with no
commits is not allowed.

Git::Push cannot know if it is doing an initial push and should specify
the remote and branch name, because dzil does not have any sort of
"initial" state that is introspectable. A dist can be a new dist, or one
just converted to dzil, etc.

The Solution:

Add a 'push' config variable to push the contents of the git repo, if
any, to a github branch matching the current branch.

Default this behavior to ON if push.default is set to 'matching', or is
not set and the git version is < 2.

Setting the config variable overrides this default detection.

Hopefully this provides the most DWIMmy behavior in different
configurations. Hopefully most users have a new git (> 1.8) and set
their push.default setting to 'simple' or 'upstream', so this codepath
would not be tripped, but many people still use older git versions and
some may have opted for the 'matching' setting, as it was the previous
default.

Pushing boilerplate to GitHub is not very elegant, unfortunately I could
not come up with a better way given the above, and it doesn't really do
much harm.