Return role metadata in a GUI-friendly shape.
()
| 1749 | _run_git(["clean", "-fd"], repo_dir) |
| 1750 | pull_warning = ( |
| 1751 | "Remote version was kept because local note changes conflicted with remote updates." |
| 1752 | if language == "en" |
| 1753 | else "本地笔记改动与远端更新冲突,已按远端版本保留并丢弃本地冲突改动。" |
| 1754 | ) |
| 1755 | push_output = "" |
| 1756 | local_commit_patch = "" |
| 1757 | else: |
| 1758 | _run_git(["add", "."], repo_dir) |
| 1759 | if _git_output(["status", "--short"], repo_dir): |
| 1760 | message = f"Sync PaperFlow reading notes {datetime.now().strftime('%Y-%m-%d %H:%M')}" |
| 1761 | _run_git(["commit", "-m", message], repo_dir, timeout=120) |
| 1762 | committed = True |
| 1763 | commit_hash = _git_output(["rev-parse", "--short", "HEAD"], repo_dir) |
| 1764 | retry_ahead, _retry_behind = _git_ahead_behind(repo_dir, branch) |
| 1765 | if retry_ahead: |
| 1766 | try: |
| 1767 | result = _run_git(["push", "-u", "origin", branch], repo_dir, timeout=120) |
| 1768 | push_output = (result.stdout or result.stderr or "").strip() |
| 1769 | pushed = True |
| 1770 | except subprocess.CalledProcessError as retry_exc: |
no test coverage detected