| 3 | import { getCurrentBranch, getChangedFiles, getStagedFiles } from "../core/git"; |
| 4 | |
| 5 | function getTimeAgo(timestamp: string): string { |
| 6 | const diff = Date.now() - new Date(timestamp).getTime(); |
| 7 | const minutes = Math.floor(diff / 60000); |
| 8 | if (minutes < 60) return `${minutes} minutes ago`; |
| 9 | const hours = Math.floor(minutes / 60); |
| 10 | if (hours < 24) return `${hours} hours ago`; |
| 11 | const days = Math.floor(hours / 24); |
| 12 | return `${days} days ago`; |
| 13 | } |
| 14 | |
| 15 | export async function diffCommand() { |
| 16 | if (!(await isInitialized())) { |