@@ -93,15 +93,15 @@ def ensure_repo_cloned(self, server_id: str) -> Optional[Repo]:
9393
9494 if os .path .exists (repo_path ):
9595 # Repo exists, open and pull
96- print (f'\t [Git Archive] Opening existing repo at { repo_path } ' )
96+ print (f'\t [Git Archive] [ { server_id } ] Opening existing repo at { repo_path } ' )
9797 repo = Repo (repo_path )
9898 try :
9999 repo .remotes .origin .pull ()
100100 except GitCommandError as e :
101- print (f'\t [Git Archive] Warning: Could not pull: { e } ' )
101+ print (f'\t [Git Archive] [ { server_id } ] Warning: Could not pull: { e } ' )
102102 else :
103103 # Clone the repo
104- print (f'\t [Git Archive] Cloning { repo_url } to { repo_path } ' )
104+ print (f'\t [Git Archive] [ { server_id } ] Cloning { repo_url } to { repo_path } ' )
105105 os .makedirs (repo_path , exist_ok = True )
106106 repo = Repo .clone_from (auth_url , repo_path , branch = branch )
107107
@@ -275,15 +275,15 @@ async def flush_and_commit(self, channel) -> None:
275275 date_range .append (date_str )
276276
277277 if total_new == 0 :
278- print (f'\t [Git Archive] No new messages to commit for #{ channel_name } ' )
278+ print (f'\t [Git Archive] [ { server_id } ] No new messages to commit for #{ channel_name } ' )
279279 return
280280
281281 # Stage all changes
282282 repo .git .add (A = True )
283283
284284 # Check if there are staged changes
285285 if not repo .is_dirty (index = True ):
286- print (f'\t [Git Archive] No changes to commit for #{ channel_name } ' )
286+ print (f'\t [Git Archive] [ { server_id } ] No changes to commit for #{ channel_name } ' )
287287 return
288288
289289 # Create commit message
@@ -294,16 +294,16 @@ async def flush_and_commit(self, channel) -> None:
294294 date_info = f"{ date_range [0 ]} to { date_range [- 1 ]} "
295295
296296 commit_message = f"Archive { total_new } messages from #{ channel_name } ({ date_info } )"
297- print (f'\t [Git Archive] { commit_message } ' )
297+ print (f'\t [Git Archive] [ { server_id } ] { commit_message } ' )
298298
299299 repo .index .commit (commit_message )
300300
301301 # Push changes
302302 try :
303303 repo .remotes .origin .push ()
304- print (f'\t [Git Archive] Pushed changes for #{ channel_name } ' )
304+ print (f'\t [Git Archive] [ { server_id } ] Pushed changes for #{ channel_name } ' )
305305 except GitCommandError as e :
306- print (f'\t [Git Archive] Warning: Could not push: { e } ' )
306+ print (f'\t [Git Archive] [ { server_id } ] Warning: Could not push: { e } ' )
307307
308308
309309def is_git_archive_enabled () -> bool :
@@ -334,6 +334,15 @@ def init_git_archive() -> Optional[GitArchiveManager]:
334334 try :
335335 config = GitArchiveConfig (config_path )
336336 print ('[Git Archive] Initialized successfully' )
337+
338+ # Print configured servers and their repos
339+ servers = config .config .get ('servers' , {})
340+ for server_id , server_config in servers .items ():
341+ enabled = server_config .get ('enabled' , False )
342+ repo_url = server_config .get ('repo_url' , 'N/A' )
343+ status = 'enabled' if enabled else 'disabled'
344+ print (f'[Git Archive] Server { server_id } : { repo_url } ({ status } )' )
345+
337346 return GitArchiveManager (config , clone_path , github_token )
338347 except FileNotFoundError as e :
339348 print (f'[Git Archive] Warning: { e } ' )
0 commit comments