init: optionally create an initial empty commit
commite09888e2caa69ebbfce08d5511eaf1aca86c78eb
authorKyle J. McKay <mackyle@gmail.com>
Tue, 15 Jun 2021 16:59:01 +0000 (15 09:59 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Tue, 15 Jun 2021 16:59:01 +0000 (15 09:59 -0700)
treed29f660caef0617cb2745c1d8c9e8a9b2248ed45
parent8f199099fee2463abd4847d9565f3f1eae437356
init: optionally create an initial empty commit

If the new setting $Girocco::Config::empty_commit_message is defined
(it can be the empty string) then when creating a new push project,
create an initial commit that has the empty tree and the given
$Girocco::Config::empty_commit_message as its commit message.

What this does is cause a remote client that's cloning the newly
created push project to automatically set up the HEAD symbolic ref
to match whatever the $initial_branch setting has been set to (as
well as suppress the "You appear to have cloned an empty repository."
message).

It's no less convenient for the remote user since the commit has
an empty tree.  It may be a bit surprising to find an empty commit
already present.  That's why this setting is off by default.

However, when it's important that the $initial_branch setting be
respected by the remote client on a newly created push project,
setting $Girocco::Config::empty_commit_message to any value will
help make sure that happens.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/Config.pm
Girocco/Project.pm
Girocco/Validator.pm
bin/create-initial-empty-commit [new file with mode: 0755]