<commit_before>package org.mockito.release.internal.gradle.util;

import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
import org.mockito.release.gradle.ReleaseConfiguration;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;

import static java.util.Arrays.asList;

/**
 * Git utilities
 */
public class GitUtil {

    private final static Logger LOG = Logging.getLogger(GitUtil.class);

    /**
     * Quiet command line to be used to perform git push without exposing write token
     */
    public static Collection<String> getQuietGitPushArgs(ReleaseConfiguration conf, ExtContainer ext) {
        //TODO push everyting on conf object, get rid of ext
        //TODO unit testable
        //!!!Below command _MUST_ be quiet otherwise it exposes GitHub write token!!!
        String mustBeQuiet = "-q";
        String ghUser = conf.getGitHub().getWriteAuthUser();
        String ghWriteToken = conf.getGitHub().getWriteAuthToken();
        String ghRepo = conf.getGitHub().getRepository();
        String branch = conf.getGit().getBranch();
        String url = MessageFormat.format("https://{0}:[SECRET]@github.com/{1}.git", ghUser, ghRepo);

        ArrayList<String> args = new ArrayList<String>(asList("git", "push", url, branch, ext.getTag(), mustBeQuiet));
        if (conf.isDryRun()) {
            args.add("--dry-run");
        }
        LOG.lifecycle("  'git push' arguments:\n    {}", StringUtil.join(args, " "));
        //!!! Setting the url after printing the command so that we don't expose the sensitive token!!!
        String actualUrl = args.get(2).replace("[GH_WRITE_TOKEN]", ghWriteToken);<commit_msg>Added a TODO<commit_after>package org.mockito.release.internal.gradle.util;

import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
import org.mockito.release.gradle.ReleaseConfiguration;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;

import static java.util.Arrays.asList;

/**
 * Git utilities
 */
public class GitUtil {

    private final static Logger LOG = Logging.getLogger(GitUtil.class);

    /**
     * Quiet command line to be used to perform git push without exposing write token
     */
    public static Collection<String> getQuietGitPushArgs(ReleaseConfiguration conf, ExtContainer ext) {
        //TODO push everyting on conf object, get rid of ext
        //TODO unit testable
        //!!!Below command _MUST_ be quiet otherwise it exposes GitHub write token!!!
        String mustBeQuiet = "-q";
        String ghUser = conf.getGitHub().getWriteAuthUser();
        String ghWriteToken = conf.getGitHub().getWriteAuthToken();
        String ghRepo = conf.getGitHub().getRepository();
        String branch = conf.getGit().getBranch();
        String url = MessageFormat.format("https://{0}:[SECRET]@github.com/{1}.git", ghUser, ghRepo);

        ArrayList<String> args = new ArrayList<String>(asList("git", "push", url, branch, ext.getTag(), mustBeQuiet));
        if (conf.isDryRun()) {
            args.add("--dry-run");
        }
        //TODO git push arguments should be printed when task runs and not when the args are configured on the task
        LOG.lifecycle("  'git push' arguments:\n    {}", StringUtil.join(args, " "));
        //!!! Setting the url after printing the command so that we don't expose the sensitive token!!!
        String actualUrl = args.get(2).replace("[GH_WRITE_TOKEN]", ghWriteToken);
{'fraction_non_alphanumeric': 0.12317387568032083, 'fraction_numerical': 0.0017187052420509883, 'mean_word_length': 3.359550561797753, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5452695', 'n_tokens_mistral': 1017, 'n_tokens_neox': 976, 'n_words': 279}