Git Product home page Git Product logo

Comments (1)

hpjansson avatar hpjansson commented on July 17, 2024

The authors table gets derived from raw_commits every run, so it should be safe to poke around in the latter. See:

fornalder/src/commitdb.rs

Lines 204 to 233 in 43f3d48

// Generate table with per-author stats like time of first and
// last commit.
self.conn.execute ("drop table authors;", NO_PARAMS).ok();
self.conn.execute ("
create table authors as
select author_name,
first_time,
first_year,
last_time,
last_year,
last_time-first_time as active_time,
n_commits,
n_changes
from
(
select author_name,
min(author_time) as first_time,
min(author_year) as first_year,
max(author_time) as last_time,
max(author_year) as last_year,
count(id) as n_commits,
sum(n_insertions) + sum(n_deletions) as n_changes
from raw_commits
group by author_name
);
create index index_author_name on authors (author_name);
create index index_first_time on authors (first_time);
create index index_active_time on authors (active_time);
", NO_PARAMS).chain_err(|| "Could not create author summaries")?;

I intended to re-run postprocess() only if something changed (e.g. store a hash of the meta file provided, clear a flag whenever a fornalder command like ingest changes the database), but it wasn't too slow in practice, so I didn't feel the need to optimize it, at least not yet. I left a reminder here:

cdb.postprocess(&meta.domains)?; // FIXME: Skip if metadata is unchanged

Anyway, the bottom line is that manually editing raw_commits is safe, for now.

I like the idea of having CLI for common database editing (like removing a repo, or maybe a date range). Let's keep this issue open for repo-remove (or remove-repo?).

from fornalder.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.