agentleFS
igorkulmanigorkulman/pi-skills/skills/git-redate/SKILL.md

git-redate

Skill3 starsChanged 2 months agoMITView on GitHub

Rewrite Git commit timestamps. Use when the user wants to change, move, or fix the date/time of specific commits — including moving weekend commits to weekdays, setting a commit to a particular date, or adjusting multiple commit dates at once.

  • Deletes or force-pushes
  • Commits and pushes

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run auto dry-run to show what will change:

    line 71
  2. Distinctive:

    If the user explicitly requested this rewrite and the dry-run matches the requested scope, apply without asking again.

    line 76
  3. Distinctive:

    Run dry-run and present the planned changes:

    line 93
  4. Very specific:

    If the request already specified the commits and target dates and the dry-run matches it, apply without another confirmation.

    line 100
  5. Distinctive:

    Always verify the result:

    line 104
  6. Distinctive:

    If only a date is given, the commit's original time is preserved.

    line 148

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

git-redate

Rewrite author and committer timestamps for one or more commits using git rebase -i with an injected GIT_SEQUENCE_EDITOR. No external plugins required.

⚠️ This rewrites commit history. Safe for unpushed commits. For already-pushed commits a git push --force-with-lease will be needed afterward.


Script

./scripts/redate.py

Resolve against the skill directory: ~/.pi/agent/skills/git-redate/scripts/redate.py


Modes

Auto mode — move all weekend commits in a range

Scans a commit range, finds Saturday/Sunday commits, moves them to Monday or Friday.

python3 ~/.pi/agent/skills/git-redate/scripts/redate.py [--range RANGE] [--move-to monday|friday] [--dry-run]
OptionDefaultDescription
--range RANGE@{u}..HEADRange to scan — default is all unpushed commits
--move-to monday|fridaymondayWhere to move Saturday/Sunday commits
--dry-run—Preview without touching history

Manual mode — set specific commits to specific dates

Explicitly name which commits to rewrite and to what date/time. Repeatable.

python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --set HASH DATE [--set HASH2 DATE2 ...] [--dry-run]
ArgumentDescription
HASHFull or short commit hash (e.g. a1b2c3d)
DATETarget date/time — see formats below

DATE formats:

FormatExampleTime behaviour
YYYY-MM-DD2025-01-20Preserves original time of day
YYYY-MM-DDTHH:MM2025-01-20T14:30Sets exact time
YYYY-MM-DDTHH:MM:SS2025-01-20T14:30:00Sets exact time
YYYY-MM-DD HH:MM2025-01-20 14:30Sets exact time

Agent workflow

For "move weekend commits" requests

  1. Run auto dry-run to show what will change:
    python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --dry-run
  2. Present the output to the user.
  3. If the user explicitly requested this rewrite and the dry-run matches the requested scope, apply without asking again. Otherwise ask for authorization before applying:
    python3 ~/.pi/agent/skills/git-redate/scripts/redate.py

For "change specific commits" requests

  1. Show the user recent commits so they can identify which ones to change:
    git log --format="%h  %ad  %s" --date=format:"%a %Y-%m-%d %H:%M" -n 20
  2. Understand the user's intent — e.g.:
    • "change a1b2c3d to last Wednesday"
    • "move these two commits to Monday morning"
    • "set commit deadbeef to 2025-01-15 at 10:00"
  3. Resolve natural-language dates to concrete YYYY-MM-DD or YYYY-MM-DDTHH:MM values using the current date as reference.
  4. Run dry-run and present the planned changes:
    python3 ~/.pi/agent/skills/git-redate/scripts/redate.py \
      --set a1b2c3d 2025-01-15 \
      --set deadbeef 2025-01-15T10:00 \
      --dry-run
  5. If the request already specified the commits and target dates and the dry-run matches it, apply without another confirmation. Otherwise ask the user to authorize the concrete dry-run plan before applying without --dry-run.

After applying

Always verify the result:

git log --format="%h  %ad  %s" --date=format:"%a %Y-%m-%d %H:%M" -n 20

Example invocations

# Auto: preview all unpushed weekend commits
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --dry-run

# Auto: move unpushed weekend commits to Monday
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py

# Auto: move to Friday, custom range
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --range main..HEAD --move-to friday

# Manual: move one commit to a specific date (preserves original time)
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --set a1b2c3d 2025-01-20

# Manual: move one commit to a specific date and time
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py --set a1b2c3d 2025-01-20T10:30

# Manual: rewrite multiple commits at once
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py \
  --set a1b2c3d 2025-01-20 \
  --set b2c3d4e 2025-01-21T09:00 \
  --set c3d4e5f 2025-01-22

# Manual: dry-run first
python3 ~/.pi/agent/skills/git-redate/scripts/redate.py \
  --set a1b2c3d 2025-01-20 \
  --dry-run

How it works

  1. Auto mode: git log collects commits in the range. Weekend commits get their timestamps shifted ±1–2 days (time of day preserved).
  2. Manual mode: each --set HASH DATE pair is resolved via git rev-parse. If only a date is given, the commit's original time is preserved. The rebase base is computed automatically from the oldest targeted commit.
  3. A temporary GIT_SEQUENCE_EDITOR script is generated that injects exec env GIT_COMMITTER_DATE='...' git commit --amend --no-edit --date='...' after the relevant pick lines in the rebase todo. (--date sets author date; GIT_COMMITTER_DATE sets committer date.)
  4. git rebase -i <base> runs with that editor. The script has its own confirmation prompt; answer it affirmatively only when the rewrite is authorized under the global policy.
  5. Temp files are cleaned up automatically.

Troubleshooting

ProblemFix
fatal: no upstream configuredPass --range HEAD~N..HEAD explicitly
Rebase fails mid-wayRun git rebase --abort to restore
Uncommitted changesStop and ask the user to commit/discard them or explicitly request a stash; never stash automatically
Already-pushed commitsReport that git push --force-with-lease will be required; never force-push unless the user explicitly requests it
Commit not in branch historyMake sure you are on the correct branch

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.