Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add computing by commits #66

Open
azinit opened this issue Dec 5, 2020 · 3 comments
Open

Add computing by commits #66

azinit opened this issue Dec 5, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request paused On pause
Milestone

Comments

@azinit
Copy link
Member

azinit commented Dec 5, 2020

Related

  • relevance-comments

Description

Add computing by commits in addition for validating by dates

Solution

Additional context

@azinit azinit added enhancement New feature or request new New, not viewed task labels Dec 5, 2020
@azinit azinit added this to the 0.0.X. milestone Dec 5, 2020
@azinit azinit self-assigned this Dec 5, 2020
@azinit azinit added wip Work in process and removed new New, not viewed task labels Dec 5, 2020
azinit added a commit that referenced this issue Dec 5, 2020
azinit added a commit that referenced this issue Dec 5, 2020
azinit added a commit that referenced this issue Dec 5, 2020
@azinit
Copy link
Member Author

azinit commented Dec 6, 2020

Return back after #30

@azinit azinit added paused On pause wip Work in process and removed wip Work in process paused On pause labels Dec 6, 2020
@azinit
Copy link
Member Author

azinit commented Dec 8, 2020

Муторно, попробовать завтра

@azinit
Copy link
Member Author

azinit commented Dec 8, 2020

/**
 * Get relevant commits in between
 * @param {Commit} from Usually - commentCommit
 * @param {Commit} to Usually - codeCommit
 * @param {string} file File path
 * @param {string} line Line index
 * FIXME: refactor, simplify, dry
 */
function getRelevantCommitsDiff(from, to, file, line) {
    const config = {
        after: `${from.date.toISOString()}`,
        before: `${to.date.toISOString()}`,
        pretty: 'format:"%ad"',
    };
    // => git log --after=${} --before=${} --pretty=${}
    const configSerialized = Object.entries(config)
        .map(([key, value]) => `--${key}=${value}`)
        .join(" ");
// просто добавляем line и file - попробовать в 0.1.0
    const response = execSync(`git log -S'${line} ${configSerialized} -- ${file} | wc -l`);

    return Number(response) - 1;
}

@azinit azinit closed this as completed Dec 8, 2020
@azinit azinit reopened this Dec 8, 2020
@azinit azinit modified the milestones: 0.0.X., 0.1.X. Dec 8, 2020
@azinit azinit added paused On pause and removed wip Work in process labels Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request paused On pause
Projects
None yet
Development

No branches or pull requests

1 participant