when a hosted git repo first created in diffusion, there is no master branch on server, causing a lot of confuses and itches in review process.
github.com has similar features, such as initialising repo with README.md or .gitignore.
when a hosted git repo first created in diffusion, there is no master branch on server, causing a lot of confuses and itches in review process.
github.com has similar features, such as initialising repo with README.md or .gitignore.
a quick and dirty fix for this could be
diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php index d725148..9473359 100644 --- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php @@ -217,6 +217,10 @@ final class PhabricatorRepositoryPullEngine $repository->execxRemoteCommand( 'init --bare -- %s', $path); + $tmp_dir = exec("mktemp -d"); + $working_copy = $tmp_dir . "/wc"; + exec('cd '.$tmp_dir.'; git clone ' . $path . " wc; cd wc; touch .gitignore; git add .gitignore; git commit -m'initial commit'; git push origin master"); } else { $repository->execxRemoteCommand( 'clone --bare -- %P %s',
Please see Contributing Feature Requests and Describing Root Problems for guidance on filing a valid feature request. You need to follow all the instructions in those documents before we can accept your request upstream.
This request does not adequately describe a root problem. Causing "confusion and itches" is not a root problem: for example, if there are workflow issues with empty repositories, we should fix those instead of trying to prevent repositories from ever being empty. We don't have enough information to know if this is the best fix for the problems you're encountering or suggest different approaches.
"Github has similar features" is not a root problem, and this is explicitly called out in Describing Root Problems as a counterexample of the kind of request we'd like to receive.