ARTICLE

How BetterFlow Cross-References GitHub Commits with Reported Hours

8 min read
BetterFlow Team
How BetterFlow Cross-References GitHub Commits with Reported Hours

A senior developer pushes 47 commits across 6 pull requests on Tuesday and logs "Development work - 8 hours" on her timesheet. A junior developer pushes 3 commits to a single branch on Wednesday and also logs "Development work - 8 hours." Both entries look identical to a manager reviewing timesheets. But the work behind them is vastly different, and without cross-referencing the code activity, there's no way to know if either entry is accurate.

This disconnect between what developers report and what their code history shows is one of the most persistent problems in technical timesheet management. GitHub (and similar platforms) contain a detailed, objective record of development activity. Timesheets contain a subjective summary of time spent. Connecting these two data sources transforms timesheet accuracy from guesswork into evidence-based verification.

The developer timesheet problem

Developers are notoriously bad at timesheets - not because they're dishonest, but because their work doesn't map neatly to time blocks. A developer might spend 30 minutes writing code, 2 hours debugging it, 45 minutes in code review, 20 minutes on Slack discussing architecture, and 1 hour researching a library. These activities blur together, switch contexts frequently, and resist the clean categorization that timesheet systems demand.

The GitHub Octoverse 2024 report shows that developers make an average of 4.7 commits per working day. But commit frequency varies wildly: a day spent on architecture design might produce zero commits despite being highly productive, while a day of small bug fixes might produce 20 commits without much effort. Commit count alone doesn't measure productivity or time - but it provides valuable context for verifying reported hours.

Stack Overflow's 2024 Developer Survey found that developers spend 30-35% of their time on non-coding activities: meetings, code reviews, documentation, planning, and communication. These activities leave no trace in Git history but legitimately consume working hours. Any cross-referencing system needs to account for this reality.

What BetterFlow extracts from GitHub

BetterFlow's GitHub integration connects to your repositories and extracts structured activity data for each team member:

Commit data: Timestamps, repository, branch, files changed, lines added/removed, and commit messages. This provides the most granular view of when coding actually happened.

Pull request activity: PR creation, review comments, approval/rejection actions, merge events. This captures code review work that doesn't produce commits but consumes significant time.

Issue and discussion participation: Comments on issues, participation in GitHub Discussions, project board updates. This captures planning and communication work that happens within GitHub.

Repository patterns: Which repositories a developer works in, how their activity distributes across projects, typical working hours based on commit timestamps. This builds a baseline for what "normal" looks like for each developer.

Critically, BetterFlow doesn't use this data to measure productivity or rank developers. It uses it exclusively for timesheet verification - cross-referencing what developers report with what their activity shows.

Automatic time estimation

One of BetterFlow's most practical features is automatic time estimation based on GitHub activity. The system analyzes commit patterns, code complexity, and historical data to estimate how long specific development activities likely took.

For example, if a developer's commits on Tuesday show work across three files in a complex module, with significant logic changes and accompanying test updates, the system estimates this work at 3-4 hours based on similar historical patterns. If the developer's timesheet shows 6 hours for this task, the discrepancy is flagged - not as an accusation, but as a prompt to clarify what the additional 2-3 hours involved.

The estimation algorithm accounts for several factors:

  • Code complexity: Changes to complex modules with many dependencies take longer than simple file edits
  • Lines changed: While not a perfect proxy, the volume of changes provides a rough time estimate when combined with other factors
  • Context switching: Commits across multiple repositories or branches suggest context-switching overhead
  • PR review cycles: If a PR went through multiple review iterations, the review time is factored into the total estimate
  • Historical baselines: The system learns each developer's coding speed and patterns, adjusting estimates accordingly

Automatic draft generation

Beyond verification, BetterFlow uses GitHub data to generate timesheet drafts automatically. Instead of asking developers to reconstruct their week from memory, the system creates pre-populated entries based on actual activity.

A typical auto-generated draft might look like:

  • Monday: "Implemented user notification system - 3 PRs merged (#412, #413, #415), 12 files changed across notification-service repo" - Estimated: 5 hours
  • Tuesday: "Code review and bug fixes - reviewed PRs #420, #421, fixed payment calculation bug (commit abc123)" - Estimated: 4 hours
  • Wednesday: "Architecture planning" - No GitHub activity detected - Estimated: manual entry needed

Developers review and adjust these drafts rather than creating entries from scratch. This approach catches omissions (developers often forget to log code review time), improves description quality (entries reference specific PRs and commits), and saves 15-20 minutes per developer per week on timesheet preparation.

Cross-referencing discrepancies

The real power of GitHub integration is discrepancy detection. BetterFlow's AI analyzes the relationship between reported hours and GitHub activity using the GREEN/YELLOW/RED scoring framework:

GREEN: Activity matches reported time. A developer logs 6 hours on Project Alpha and GitHub shows 5 hours of active commit and PR activity on Project Alpha repositories. The remaining hour is within normal overhead (meetings, planning, setup). No flag needed.

YELLOW: Partial discrepancy or unusual pattern. A developer logs 8 hours on Project Beta but GitHub shows only 2 hours of activity on Beta repositories, with 4 hours of activity on Project Gamma repositories. This might indicate a billing code error - the developer may have worked on Gamma but accidentally logged to Beta. Flagged for developer review.

RED: Significant discrepancy. A developer logs 8 hours of development work but GitHub shows zero commits, zero PR activity, and zero issue comments for the entire day. This might be legitimate (architecture planning, offline research, pair programming on someone else's machine), but it needs explanation.

The system's 92% accuracy rate means these flags are overwhelmingly correct. When they're wrong, developers mark them as false positives, and the AI learns from that feedback - perhaps this developer regularly does architecture work that produces no Git activity, and future similar patterns won't be flagged.

Edge cases and how they're handled

Real development work produces many edge cases that a naive cross-referencing system would handle poorly:

Pair programming: Two developers work on the same code, but only one commits. BetterFlow detects pair programming patterns through simultaneous calendar events and co-authored commits, attributing appropriate time to both developers.

Research and learning: A developer spends a day researching a new framework with no code output. The system recognizes "no activity" days as legitimate when they don't form a pattern and when the developer's entry describes non-coding work.

Ops and infrastructure work: Deployments, CI/CD pipeline maintenance, and server configuration may happen outside Git. BetterFlow integrates with deployment platforms to capture this activity.

Meeting-heavy days: Developers who spend most of a day in meetings legitimately have low Git activity. Calendar integration provides corroboration for these entries.

Weekend and off-hours commits: Some developers commit personal project work from the same machine. BetterFlow only cross-references activity in company-connected repositories, ignoring personal GitHub activity entirely.

Implementation guide

Setting up GitHub cross-referencing in BetterFlow takes about 30 minutes:

  • Step 1: Install the BetterFlow GitHub App on your organization. This grants read-only access to repository activity (commits, PRs, issues). No code content is accessed or stored
  • Step 2: Map repositories to projects. Tell BetterFlow which GitHub repos correspond to which timesheet projects. This mapping enables accurate cross-referencing
  • Step 3: Map GitHub users to team members. Link each developer's GitHub account to their BetterFlow profile for individual activity correlation
  • Step 4: Allow 2-3 weeks of baseline collection. The AI needs historical data to learn your team's patterns before it can effectively flag anomalies
  • Step 5: Enable draft generation. Once baselines are established, activate automatic timesheet draft creation for your development team

The integration works alongside your existing workflow. Developers continue logging time as they always have - the cross-referencing layer adds verification and draft suggestions without changing the core process. As BetterQA learned from our own teams, the best verification is invisible verification that helps without hindering.

Conclusion

GitHub contains an objective, timestamped record of development activity that most companies completely ignore when evaluating timesheets. Cross-referencing this data with reported hours doesn't just catch errors - it generates timesheet drafts, improves entry quality, and gives managers confidence that the time they're billing actually reflects work performed.

For development teams, the gap between "tracked time" and "verified time" is particularly stark. GitHub integration closes that gap by connecting subjective time reports with objective activity data, making timesheet accuracy a system property rather than an individual discipline.

Sources & References


Published by BetterQA, an ISO 27001 and ISO 9001 certified company with 8+ years of experience in software quality assurance. According to research by McKinsey, data-driven project management improves team productivity by up to 25%. Last updated on .

  • Built by BetterQA, founded in 2018 in Cluj-Napoca, Romania
  • ISO 27001 certified security and GDPR compliant
  • Trusted by teams across 15+ countries
  • 30-day free trial with no credit card required

Share this article

RELATED POSTS

Related posts