Skip to content

Enhance hourly-git-sync script to skip empty commits#20

Open
Stoff81 wants to merge 1 commit intochrysb:mainfrom
Stoff81:dont-backup-empty
Open

Enhance hourly-git-sync script to skip empty commits#20
Stoff81 wants to merge 1 commit intochrysb:mainfrom
Stoff81:dont-backup-empty

Conversation

@Stoff81
Copy link

@Stoff81 Stoff81 commented Mar 14, 2026

Only push git backups if there are changes

…are detected. This optimization prevents unnecessary commits and improves efficiency in the sync process.
@chrysb
Copy link
Owner

chrysb commented Mar 15, 2026

Nice improvement 👍

Quick question: have you actually observed empty commits happening in this flow? A plain git commit shouldn’t create one unless --allow-empty is used, so I want to make sure we’re fixing a real behavior we’ve seen.

One risk to call out: the current check uses git diff --quiet and git diff --cached --quiet, which won’t detect untracked files. That means the script could exit early even when new files exist.

@Stoff81
Copy link
Author

Stoff81 commented Mar 15, 2026

Empty commit here:

Screenshot 2026-03-15 at 5 47 51 PM

Its possible these commits where caused from non-tracked files. These are all my additions to .openclaw/.gitignore

`.alphaclaw/*
agents/
canvas/
completions/
credentials/
cron/
devices/
identity/
logs/
media/
memory/
sandbox/
sandboxes/
subagents/
workspace/

*/user-data/
/user-data/
browser/openclaw/user-data

openclaw.json.bak*`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants