amangs commited on
Commit
bd96f46
·
verified ·
1 Parent(s): 44392ba

Keep dataset commit history squashed to 1 commit

Browse files
Files changed (1) hide show
  1. src/data_sync.py +10 -0
src/data_sync.py CHANGED
@@ -169,6 +169,16 @@ class DatasetManager:
169
  commit_message=f"Hermes Agent backup - {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}"
170
  )
171
 
 
 
 
 
 
 
 
 
 
 
172
  self.last_sync_hash = current_hash
173
  logger.success("Backup uploaded successfully")
174
  return True
 
169
  commit_message=f"Hermes Agent backup - {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}"
170
  )
171
 
172
+ # Squash commit history so the dataset repo always stays at 1 commit
173
+ try:
174
+ self.api.super_squash_history(
175
+ repo_id=self.dataset_repo,
176
+ repo_type="dataset",
177
+ commit_message=f"Hermes Agent backup - {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}"
178
+ )
179
+ except Exception as se:
180
+ logger.warning(f"Squash history failed: {se}")
181
+
182
  self.last_sync_hash = current_hash
183
  logger.success("Backup uploaded successfully")
184
  return True