When this package is updated, the git hook is also updated.
326406
public function postPackageUpdate(PackageEvent $event)
    {
        /** @var UpdateOperation $operation */
        $operation = $event->getOperation();
        $package = $operation->getTargetPackage();

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

        // Schedule init when command is completed
        $this->initScheduled = true;
    }
569724
def prepare_release(ver=None):
    """"""
    write_changelog(True)
    if ver is None:
        ver = next_release()
    print('saving updates to ChangeLog')
    run('git commit ChangeLog -m "[RELEASE] Update to version v{}"'.format(ver), hide=True)
    sha = run('git log -1 --pretty=format:"%h"', hide=True).stdout
    run('git tag -a "{ver}" -m "version {ver}" {sha}'.format(ver=ver, sha=sha), hide=True)
    package()
    write_changelog()
    run('git tag -d {}'.format(ver), hide=True)
    run('git commit --all --amend --no-edit', hide=True)
103427
def update(self):
        
        logger.debug("")

        rd = self.repo_dir

        logger.debug("pkg path %s", rd)
        if not rd:
            print(
                "unable to find pkg '%s'. %s" % (self.name, did_u_mean(self.name))
            )

        cwd = os.getcwd()
        os.chdir(self.repo_dir)
        logger.debug("cwd: %s, updating %s ", cwd, self.repo_dir)
        try:
            p = git.pull('--rebase', '--progress',
                         _out=self._sh_stdout('blue'),
                         _err=self._sh_stderr('red'))
            p.wait()
        except Exception as e:
            pass
            # logger.warn(e)

        os.chdir(cwd)

        # Update or install any dependancies before running the
        # update script.
        self.install_update_deps()

        up = os.path.join(self.repo_dir, '_upkg', 'update')
        if os.path.exists(up):
            # We use subprocess instead of the sh module due to problems with
            # runing shell scripts with sh
            cwd = os.getcwd()
            os.chdir(os.path.join(self.repo_dir, '_upkg'))
            self.pr_info("Running update script for {} @ {}", self.name, up)
            subprocess.check_call(up, shell=True)
            os.chdir(cwd)
1052222
function(callback) {
    async.waterfall([
      // 1. Resolve loose package versions.
      function(done) {
        var master = this.master;
        var packageToVersions = this.packageToVersions;
        Package.versions(master, packageToVersions, function(err, result) {
          this.packageToVersions = result;
          done(err, result);
        }.bind(this));
      }.bind(this),

      // 2. Dependency search.
      this.dependencySearch.bind(this),

      // 3. Make sure we have package and package version dirs.
      this.makedirs.bind(this),

      // 4. Download the world.
      this.download.bind(this),

      // 5. Commit the downloads to our package repository.
      this.commit.bind(this)
    ], callback);
  }
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)
33855
def update(self):
        """"""
        if not os.path.isdir(os.path.join(self.path)):
            os.makedirs(self.path)
        if not os.path.isdir(os.path.join(self.path, 'refs')):
            subprocess.check_output([
                'git', 'clone', '--bare', self.repo_git, self.path
            ])
        self.run(['gc', '--auto', '--prune=all'])
        self.run(['fetch', '-p', 'origin', '+refs/heads/*:refs/heads/*'])
        # github support
        self.run(['fetch', 'origin', '+refs/pull/*/head:refs/pull/*'])
        # gitlab support
        self.run([
            'fetch', 'origin', '+refs/merge-requests/*/head:refs/pull/*'])
1091437
function updateVersion2gitTag(pkg) {
	let tag = child_process.execSync('git describe --tag').toString().trim();
	pkg.version = tag;
}
658349
public static function checkPackageUpdates()
    {
        $em = \ORM::entityManager();
        $items = self::getAvailableMarketplaceItems(false);
        foreach ($items as $i) {
            $p = Package::getByHandle($i->getHandle());
            if (is_object($p)) {
                /**
                 * @var $p \Concrete\Core\Entity\Package
                 */
                $p->setPackageAvailableVersion($i->getVersion());
                $em->persist($p);
            }
        }
        $em->flush();
    }
1338241
function checkUpdate () {
  var pkg = require("./package.json");
  require("update-notifier")({
    packageName:    pkg.name,
    packageVersion: pkg.version
  }).notify();
}
973570
def slackpkg_update(self):
        
        NEW_ChangeLog_txt = URL(mirrors("ChangeLog.txt", "")).reading()
        if os.path.isfile(self.meta.slackpkg_lib_path + "ChangeLog.txt.old"):
            os.remove(self.meta.slackpkg_lib_path + "ChangeLog.txt.old")
        if os.path.isfile(self.meta.slackpkg_lib_path + "ChangeLog.txt"):
            shutil.copy2(self.meta.slackpkg_lib_path + "ChangeLog.txt",
                         self.meta.slackpkg_lib_path + "ChangeLog.txt.old")
            os.remove(self.meta.slackpkg_lib_path + "ChangeLog.txt")
        with open(self.meta.slackpkg_lib_path + "ChangeLog.txt", "w") as log:
            log.write(NEW_ChangeLog_txt)
            log.close()
71373
def init(ctx):
    
    # install hooks
    git = ctx.obj['vcs']
    click.echo("Installing hooks...", nl=False)
    for old in ['commit-msg']:
        path = os.path.join(git.path, '.git/hooks', old)
        if os.path.exists(path):
            os.remove(path)
    for new in ['pre-commit', 'pre-push']:
        git.install_hook(new, hooks_manager.get_hook(new))
    click.echo("Done.")

    # add a config file if one does not exist
    config_path = os.path.join(git.path, 'eci.yaml')
    if not os.path.exists(config_path):
        click.echo("Placing a trivial config file in your project...", nl=False)
        with open(config_path, 'w') as f:
            f.write(yaml.safe_dump(
                {'tests': ['echo please modify to run your tests', 'true']}))
        click.echo("Done.")

    # initialize lock
    locking.init(git)

    # update installed version
    click.echo("Updating installed version...", nl=False)
    set_installed_version(git, easyci.__version__)
    click.echo("Done.")
265173
public function update()
    {
        if (!$this->checkForUpdates()) {
            return;
        }
        if (!$this->subModuleUpdater) {
            $this->site->getVariables()->setValue("last_updated", time());
        }
        $this->exec("git fetch origin");
        $this->exec("git reset --hard origin/{$this->currentBranch()}");
        /** @var $updater Updater */
        foreach ($this->subUpdaters as $updater) {
            $updater->update();
        }
        $this->exec("make update");
        $this->canBeUpdated = false;
        $this->site->getVariables()->setValue("can_be_updated", 0);
        $this->site->modify();
        $this->currentVersion = null;

    }
966789
def _run_hooks(config, hooks, args, environ):
    """"""
    skips = _get_skips(environ)
    cols = _compute_cols(hooks, args.verbose)
    filenames = _all_filenames(args)
    filenames = filter_by_include_exclude(filenames, '', config['exclude'])
    classifier = Classifier(filenames)
    retval = 0
    for hook in hooks:
        retval |= _run_single_hook(classifier, hook, args, skips, cols)
        if retval and config['fail_fast']:
            break
    if retval and args.show_diff_on_failure and git.has_diff():
        if args.all_files:
            output.write_line(
                'pre-commit hook(s) made changes.\n'
                'If you are seeing this message in CI, '
                'reproduce locally with: `pre-commit run --all-files`.\n'
                'To run `pre-commit` as part of git workflow, use '
                '`pre-commit install`.',
            )
        output.write_line('All changes made by hooks:')
        subprocess.call(('git', '--no-pager', 'diff', '--no-ext-diff'))
    return retval
39403
def it_self_update():
    
    __new_version__ = ""
    repository = "gitlab"
    branch = "master"
    ver_link = ("https://raw.{0}usercontent.com/{1}/{2}/"
                "{3}/{4}/__metadata__.py".format(repository, _meta_.__author__,
                                                 _meta_.__all__, branch,
                                                 _meta_.__all__))
    version_data = URL(ver_link).reading()
    for line in version_data.splitlines():
        line = line.strip()
        if line.startswith("__version_info__"):
            __new_version__ = ".".join(re.findall(r"\d+", line))
    if __new_version__ > _meta_.__version__:
        if _meta_.default_answer in ["y", "Y"]:
            answer = _meta_.default_answer
        else:
            print("\nNew version '{0}-{1}' is available !\n".format(
                _meta_.__all__, __new_version__))
            try:
                answer = raw_input("Would you like to upgrade [y/N]? ")
            except EOFError:
                print("")
                raise SystemExit()
        if answer in ["y", "Y"]:
            print("")   # new line after answer
        else:
            raise SystemExit()
        dwn_link = ["https://{0}.com/{1}/{2}/archive/"
                    "v{3}/{4}-{5}.tar.gz".format(repository, _meta_.__author__,
                                                 _meta_.__all__,
                                                 __new_version__,
                                                 _meta_.__all__,
                                                 __new_version__)]
        if not os.path.exists(_meta_.build_path):
            os.makedirs(_meta_.build_path)
        Download(_meta_.build_path, dwn_link, repo="").start()
        os.chdir(_meta_.build_path)
        slpkg_tar_file = "slpkg" + "-" + __new_version__ + ".tar.gz"
        tar = tarfile.open(slpkg_tar_file)
        tar.extractall()
        tar.close()
        file_name = "{0}-{1}".format(_meta_.__all__, __new_version__)
        os.chdir(file_name)
        check_md5(pkg_checksum(slpkg_tar_file, _meta_.__all__),
                  _meta_.build_path + slpkg_tar_file)
        subprocess.call("chmod +x {0}".format("install.sh"), shell=True)
        subprocess.call("sh install.sh", shell=True)
    else:
        print("\n{0}: There is no new version, already used the last !"
              "\n".format(_meta_.__all__))
    raise SystemExit()
1032018
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 pathToGitHooks = path.join(path.relative(hooksPath, __dirname), 'git-hooks');
 
        if (isWin32) {
            pathToGitHooks = pathToGitHooks.replace(/\\/g, '\\\\');
        }

        if (fsHelpers.exists(hooksOldPath)) {
            throw new Error('git-hooks already installed');
        }

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

        var hookTemplate = fs.readFileSync(__dirname + '/' + HOOKS_TEMPLATE_FILE_NAME);
        var pathToGitHooks = path.relative(hooksPath, __dirname);
        // Fix non-POSIX (Windows) separators
        pathToGitHooks = pathToGitHooks.replace(new RegExp(path.sep.replace(/\\/g, '\\$&'), 'g'), '/');
        var hook = util.format(hookTemplate.toString(), pathToGitHooks);

        fsHelpers.makeDir(hooksPath);
        HOOKS.forEach(function (hookName) {
            var hookPath = path.resolve(hooksPath, hookName);
            try {
                fs.writeFileSync(hookPath, hook, {mode: '0777'});
            } catch (e) {
                // node 0.8 fallback
                fs.writeFileSync(hookPath, hook, 'utf8');
                fs.chmodSync(hookPath, '0777');
            }
        });
    }
67444
def _stamp_and_update_hook(method,  # suppress(too-many-arguments)
                           dependencies,
                           stampfile,
                           func,
                           *args,
                           **kwargs):
    """"""
    result = _stamp(stampfile, func, *args, **kwargs)
    method.update_stampfile_hook(dependencies)
    return result
1125350
public function update()
    {
        foreach ((array) $this->package as $package) {
            $_POST['plugin64'] = $package;
            ob_start();
            plugin_install();
            ob_end_clean();
        }
    }