When this package is updated, the git hook is also initialized.
490295
public function postPackageInstall(PackageEvent $event)
    {
        /** @var InstallOperation $operation */
        $operation = $event->getOperation();
        $package = $operation->getPackage();

        if (!$this->guardIsGrumPhpPackage($package)) {
            return;
        }

        // Schedule init when command is completed
        $this->configureScheduled = true;
        $this->initScheduled = true;
    }
209204
def push_git_package(self):
        
        ## check for conflicts, then write to local files
        self._pull_branch_from_origin()

        ## log commits to releasenotes
        if self.deploy:
            self._write_commits_to_release_notes()

        ## writes tag or 'devel' to 
        try:            
            self._write_new_tag_to_init()
            self._write_branch_and_tag_to_meta_yaml()
            self._push_new_tag_to_git()

        except Exception as inst:
            print("\n Error:\n", inst)
            self._revert_tag_in_init()
            sys.exit(2)
397721
private function initInstalledPackages()
    {
        /** @var PackageInterface $package */
        foreach ($this->installedRepository->getPackages() as $package) {
            $operator = $this->getFilterOperator($package);
            /** @var Link $link */
            $link = current($this->arrayLoader->parseLinks($this->package->getName(), $this->package->getVersion(), 'installed', array($package->getName() => $operator.$package->getPrettyVersion())));
            $link = $this->includeRootConstraint($package, $link);

            $this->requires[$package->getName()] = $link;
        }
    }
1201274
function init() {
    try {
        keepOrganized().then((AllFiles) => {
            console.log('Marked Reference Links');
            console.log('Created Directory Tree');
            console.log('Setting up watchers...');
            let watcher = new Watcher(AllFiles);
            console.log('Watching for file changes...');
            watcher.on('update', () => {
                console.log('Updating dirTree...')
                keepOrganized().then((AllFiles) => {
                    console.log('Updated dirTree.');
                    watcher.update(AllFiles);
                })
            })
        })
    } catch (err) {
        console.error(err);
    }
}
550050
function isGitInstalled() {
    var result = exec( "git --version", true );
    try {
        if ( !result || result.indexOf( "git" ) < 0 || result.indexOf( "version" ) < 0 ) {
            console.log( Fatal.format(
                "`git` is required by the ToloFrameWork!\n" +
                "Please install it:" ) );
            console.log( "\n> " + "sudo apt-get install git".yellow.italic );
            return false;
        }
        return true;
    } catch ( ex ) {
        fatal( "Fatal error in function `result`!\n" + JSON.stringify( ex, null, '  ' ) );
    }
}
549305
def _RunSingleHook(self, hook_cls, executed_set, required=None):
    """"""
    # If we already ran do nothing.
    if hook_cls in executed_set:
      return

    # Ensure all the pre execution hooks are run.
    for pre_hook in hook_cls.pre:
      self._RunSingleHook(pre_hook, executed_set, required=hook_cls.__name__)

    # Now run this hook.
    cls_instance = hook_cls()
    if required:
      logging.debug("Initializing %s, required by %s", hook_cls.__name__,
                    required)
    else:
      logging.debug("Initializing %s", hook_cls.__name__)

    # Always call the Run hook.
    cls_instance.Run()
    executed_set.add(hook_cls)

    # Only call the RunOnce() hook if not already called.
    if hook_cls not in self.already_run_once:
      cls_instance.RunOnce()
      self.already_run_once.add(hook_cls)
449775
public function initAndCommitRepo() {
    // The .git dir will already exist if blt-project was created using a
    // branch. Otherwise, it will not exist when using a tag.
    if (!file_exists($this->getConfigValue("repo.root") . "/.git")) {
      $result = $this->taskGit()
        ->dir($this->getConfigValue("repo.root"))
        ->exec("git init")
        ->commit('Initial commit.', '--allow-empty')
        ->add('-A')
        ->commit('Created BLT project.')
        ->interactive(FALSE)
        ->printOutput(FALSE)
        ->printMetadata(FALSE)
        ->run();

      if (!$result->wasSuccessful()) {
        throw new BltException("Could not initialize new git repository.");
      }
    }
  }
519545
def _install(_):
    
    if not os.path.exists(".git"):
        fatal("not in a git repo.")

    config = __load_config()

    if config.get("checks") is None:
        fatal("global ``checks`` variable missing from configuration.")

    # We try to load all checks to check that they exist NOW.
    for hook in config["checks"]:
        checks = __load_checks(config["checks"][hook])
        # Also verify that they apply to the hooks.
        __verify_checks_for_hook(checks, hook)

    reply = input("This will overwrite your current hooks. "
                  "Proceed [yes/No]? ")
    if reply != "yes":
        raise Exit(0)

    for hook in config["checks"]:
        hook_f = open(os.path.join(".git/hooks/", hook), 'w')
        hook_f.write("""#!/usr/bin/env python
# GENRATED BY GLERBL. DO NOT MODIFY.
from glerbl.__main__ import main


exit(main(["glerbl", "hook", "{0}"]))
""".format(hook))
        os.fchmod(hook_f.fileno(),
                  os.fstat(hook_f.fileno()).st_mode | stat.S_IXUSR)
        hook_f.close()
451749
function commitPackageChangelog( $package, $http, $step, &$persistentData, $tpl )
    {
        $changelogEntries = array();
        $changelogText = $persistentData['changelog_text'];
        $lines = preg_split( "#\r\n|\n|\r#", $changelogText );
        $currentEntries = false;
        foreach ( $lines as $line )
        {
            if ( strlen( $line ) > 0 and
                 ( $line[0] == '-' or $line[0] == '*' ) )
            {
                if ( $currentEntries !== false )
                {
                    $changelogEntries[] = implode( ' ', $currentEntries );
                }
                $currentEntries = array();
                $currentEntries[] = trim( substr( $line, 1 ) );
            }
            else
            {
                if ( $currentEntries === false )
                {
                    $changelogEntries = array();
                }
                $currentEntries[] = trim( $line );
            }
        }
        if ( $currentEntries !== false )
        {
            $changelogEntries[] = implode( ' ', $currentEntries );
        }
        $persistentData['changelog_entries'] = $changelogEntries;
    }
1341796
function init(config) {
    if (!engine)
      throw new Error(
        "No engine set for research. Set an engine using gitbook.research.setEngine(Engine)."
      );

    return engine.init(config).then(function() {
      initialized = true;
      gitbook.events.trigger("search.ready");
    });
  }
909356
def init(ctx, client, directory, name, force, use_external_storage):
    """"""
    if not client.use_external_storage:
        use_external_storage = False

    ctx.obj = client = attr.evolve(
        client,
        path=directory,
        use_external_storage=use_external_storage,
    )

    msg = 'Initialized empty project in {path}'
    branch_name = None

    stack = contextlib.ExitStack()

    if force and client.repo:
        msg = 'Initialized project in {path} (branch {branch_name})'
        merge_args = ['--no-ff', '-s', 'recursive', '-X', 'ours']

        try:
            commit = client.find_previous_commit(
                str(client.renku_metadata_path),
            )
            branch_name = 'renku/init/' + str(commit)
        except KeyError:
            from git import NULL_TREE
            commit = NULL_TREE
            branch_name = 'renku/init/root'
            merge_args.append('--allow-unrelated-histories')

        ctx.obj = client = stack.enter_context(
            client.worktree(
                branch_name=branch_name,
                commit=commit,
                merge_args=merge_args,
            )
        )

    try:
        with client.lock:
            path = client.init_repository(name=name, force=force)
    except FileExistsError:
        raise click.UsageError(
            'Renku repository is not empty. '
            'Please use --force flag to use the directory as Renku '
            'repository.'
        )

    stack.enter_context(client.commit())

    with stack:
        # Install Git hooks.
        from .githooks import install
        ctx.invoke(install, force=force)

        # Create all necessary template files.
        from .runner import template
        ctx.invoke(template, force=force)

    click.echo(msg.format(path=path, branch_name=branch_name))
1331861
async function init () {
    // initialze logging
    initLogging(this.immutableApp)
    // initialize global dir config by merging module configs
    initDir(this.immutableApp)
    // initalize handlebars
    initHandlebars(this.immutableApp)
    // initalize express request handling - bodyParser, cookieParser, etc
    initExpress(this.immutableApp)
    // initialize app
    initApp(this.immutableApp)
    // add error handler after all other middleware and routers
    initErrorHandler(this.immutableApp)
    // initialize models
    await initModels(this.immutableApp)
    // intialize components after models since they may use models
    initComponents(this.immutableApp)
    // initialize services after models since they may use models
    await initServices(this.immutableApp)
    // set initialize flag to true
    this.immutableApp.initialized = true
    // debug
    debug('init', this.immutableApp)
}
1087166
function initializePackageChangelog( $package, $http, $step, &$persistentData, $tpl )
    {
        $user = eZUser::currentUser();
        $userObject = $user->attribute( 'contentobject' );
        if ( $userObject )
            $changelogPerson = $userObject->attribute( 'name' );
        $changelogEmail = $user->attribute( 'email' );
        $changelogText = '';

        $persistentData['changelog_person'] = $changelogPerson;
        $persistentData['changelog_email'] = $changelogEmail;
        if ( !( $package instanceof eZPackage ) )
        {
            $changelogText = $this->initialChangelogEntry( $package, $http, $step, $persistentData, $tpl );
        }
        $persistentData['changelog_text'] = $changelogText;
        $persistentData['changelog_entries'] = array();
    }
260064
def _update_submodules(repo_dir):
    """"""
    subprocess.check_call("git submodule init", cwd=repo_dir, shell=True)
    subprocess.check_call(
        "git submodule update --recursive", cwd=repo_dir, shell=True)
490765
private static void initFromPackage(PackageDescriptor pd,
                                        Package pkg) {

        pd.setExists(true);

        String specificationTitle = pkg.getSpecificationTitle();
        String specificationVersion = pkg.getSpecificationVersion(); 
        String specificationVendor = pkg.getSpecificationVendor();

        String implementationTitle = pkg.getImplementationTitle();
        String implementationVersion = pkg.getImplementationVersion(); 
        String implementationVendor = pkg.getImplementationVendor();

        if (implementationTitle == null) {
            implementationTitle = specificationTitle;
        }

        if (implementationVersion == null) {
            implementationVersion = specificationVersion;
        }

        if (implementationVendor == null) {
            implementationVendor = specificationVendor;
        }


        pd.setSpecificationTitle(specificationTitle);
        pd.setSpecificationVersion(specificationVersion);
        pd.setSpecificationVendor(specificationVendor);

        pd.setImplementationTitle(implementationTitle);
        pd.setImplementationVersion(implementationVersion);
        pd.setImplementationVendor(implementationVendor);

        pd.setProduct(implementationTitle);
        pd.setProductVersion(implementationVersion);
    }
788994
def init():
    """"""

    from metapack.appurl import SearchUrl
    import metapack as mp
    from os import environ

    SearchUrl.initialize()  # This makes the 'index:" urls work
    mp.Downloader.context.update(environ)
1321321
function (workingDirectory) {
        var gitPath = getClosestGitPath(workingDirectory);

        if (!gitPath) {
            throw new Error('git-hooks must be run inside a git repository');
        }

        var hooksPath = path.resolve(gitPath, HOOKS_DIRNAME);
        var hooksOldPath = path.resolve(gitPath, HOOKS_OLD_DIRNAME);

        if (!fsHelpers.exists(hooksPath)) {
            throw new Error('git-hooks is not installed');
        }

        fsHelpers.removeDir(hooksPath);

        if (fsHelpers.exists(hooksOldPath)) {
            fs.renameSync(hooksOldPath, hooksPath);
        }
    }