Beyond Work Hours: How an Interview Question Led to a Delayed Commit Feature
Discover how a pivotal interview question about Git commit times led to the creation of GoCommit's 'Delayed Commit' feature, empowering developers to manage work-life boundaries, timezone challenges, and privacy concerns by scheduling their contributions.

The Interview That Changed My Perspective
Imagine sitting in a technical interview, confident in your answers. Then, the interviewer glances at your GitHub profile and poses a seemingly innocuous question:
"I notice you push code mostly during work hours. Can you tell me about your development workflow?"
I froze.
It wasn't because I was doing anything wrong, but because I suddenly realized how much commit timestamps reveal about our work habits. In that moment, I understood that my GitHub contribution graph wasn't just showing my coding activity—it was inadvertently broadcasting my work schedule to the world.
This interview question sparked a thought:
What if developers want more control over when their commits appear to be made?
The Problem We Don't Talk About
As developers, we operate in a transparent world. Our GitHub profiles serve as our resumes, our contribution graphs as performance metrics, and our commit histories as open books. However, an uncomfortable truth emerges:
- Blurred Work-Life Boundaries: A green square at 2 AM might simply mean you fixed a critical bug, but it can signal "always available" to some employers.
- Timezone Confusion: Working from Asia but applying to European companies? Your commit times might appear unusual to recruiters.
- Privacy Concerns: Not everyone wants their daily routine publicly visible.
- Unconscious Bias: Some individuals judge productivity based on commit times rather than the actual content or impact of the work.
Following that interview, I decided to address this issue. I developed the Delayed Commit feature for GoCommit, my AI-powered commit message generator.
What Is Delayed Commit?
The concept is straightforward yet powerful: it prevents commits during your defined work hours and allows you to schedule them for later.
Here’s how it works:
- You configure your "restricted hours" (e.g., 9 AM - 5 PM).
- When you attempt to commit during those hours, GoCommit intercepts the action.
- A user-friendly interface appears, suggesting alternative times.
- You select a preferred time (or enter a custom one).
- Your commit is created with that chosen timestamp.
No manual scripts, no complex git commands, and no fumbling with --date flags. Just a seamless, integrated experience.
The Architecture Behind the Magic
Building this feature involved fascinating technical challenges. Here's a glimpse into its inner workings:
1. Time Validation
func isTimeInRestrictedRange(
currentTime time.Time,
config DelayedCommitConfig
) (bool, time.Time, error) {
hour := currentTime.Hour()
if hour >= config.RestrictedStartHour && hour < config.RestrictedEndHour {
// Calculate when restrictions end
endTime := time.Date(
currentTime.Year(),
currentTime.Month(),
currentTime.Day(),
config.RestrictedEndHour,
0, 0, 0,
currentTime.Location(),
)
return true, endTime, nil
}
return false, time.Time{}, nil
}
2. Smart Time Suggestions
The system generates suggested commit times at configurable intervals (default: 20 minutes) starting from when your restrictions end:
┌──────────────────────────────────────────────────────────┐
│ Commit during work hours (09:00-17:00) detected │
│ Current time: 14:30 │
│ │
│ Select commit time: │
│ → 17:20 (5:20 PM) - Today │
│ • 17:40 (5:40 PM) - Today │
│ • 18:00 (6:00 PM) - Today │
│ • 18:20 (6:20 PM) - Today │
│ • Enter custom time... │
│ │
│ ↑↓: Move Enter: Select Esc: Use current time anyway │
└──────────────────────────────────────────────────────────┘
3. Git Integration
Git inherently supports custom timestamps. The key is to leverage both the --date flag and the GIT_COMMITTER_DATE environment variable:
func executeDelayedCommit(message string, timestamp time.Time) *exec.Cmd {
dateStr := timestamp.Format(time.RFC3339)
cmd := exec.Command("git", "commit", "-m", message, "--date", dateStr)
cmd.Env = append(os.Environ(), fmt.Sprintf("GIT_COMMITTER_DATE=%s", dateStr))
return cmd
}
This approach ensures that both the author date (when the code was originally written) and the committer date (when the commit was recorded) align with your chosen time.
Real-World Use Cases
Since implementing this feature, several legitimate use cases have emerged:
- Maintaining Work-Life Boundaries: Developers can separate personal projects from work hours without changing their actual coding schedule.
- Timezone Management: Remote workers can ensure their contributions appear during "normal" business hours in their employer's timezone.
- Privacy Protection: Freelancers can avoid having clients track their exact working hours.
- Contribution Graph Aesthetics: For those who prefer a tidier-looking contribution graph.
- Retroactive Commits: When working offline or forgetting to commit, this allows for setting accurate timestamps to maintain an honest history.
The Ethics Question
It's natural to consider: "Isn't this... dishonest?"
Here's a balanced perspective:
Git timestamps have always been flexible. Developers can manually set them, rebase changes, or use various tools to modify history. This feature doesn't introduce a new capability; it simply makes an existing one more accessible and user-friendly.
The deeper question is: Should your coding schedule be public information?
I argue it shouldn't. A developer's true value stems from:
- The quality of their code
- Their problem-solving skills
- Their collaboration and communication
- The impact of their work
It does not come from whether a commit was pushed at 2 PM or 2 AM.
This tool helps you control your narrative without being deceptive. You are still writing the code and making the commits—you are simply choosing when they appear in your history.
Getting Started
Want to try it? Here's how to set up GoCommit with delayed commits:
1. Install GoCommit
# Linux/macOS
curl -sSL https://raw.githubusercontent.com/thanhphuchuynh/gocommit/main/install.sh | bash
# Or download from releases
# https://github.com/thanhphuchuynh/gocommit/releases
2. Configure Your API Key
GoCommit utilizes AI for generating commit messages, requiring an API key:
gocommit --config
Choose between Google Gemini or OpenRouter (which provides access to Claude, GPT-4, Llama, and more).
3. Enable Delayed Commits
gocommit --config-delayed
You'll be prompted to set:
- Restricted start hour (e.g.,
9for 9 AM) - Restricted end hour (e.g.,
17for 5 PM) - Suggestion interval (e.g.,
20minutes)
4. Use It Naturally
git add .
gocommit
That's it! If you attempt to commit during restricted hours, the time selection UI will appear. Otherwise, the tool functions as usual.
Configuration File
Under the hood, GoCommit uses a simple JSON configuration file located at ~/.gocommit.json:
{
"api_key": "your-api-key",
"logging_enabled": true,
"icon_mode": false,
"delayed_commit": {
"enabled": true,
"restricted_start_hour": 9,
"restricted_end_hour": 17,
"suggestion_interval_min": 20
}
}
If you find this tool useful, consider giving GoCommit a star on GitHub! It helps more developers discover its capabilities. GoCommit not only generates AI-powered commit messages but also provides schedule control within a single, streamlined tool.
About the Project
GoCommit is an AI-powered commit message generator that:
- Automatically analyzes your staged changes.
- Generates meaningful, conventional commit messages.
- Supports multiple AI providers (Gemini, Claude, GPT-4, Llama, etc.).
- Includes built-in logging for prompt improvement.
- Now features delayed commits for enhanced schedule control.
It is a free, open-source tool designed to enhance your Git workflow. Check it out!