Monday, February 9, 2026

One Liner

 This could end up being a long thread of tips and tricks over time (or not).


I found myself needing to study a git repo in order to add a feature. I stumbled on the idea of finding recently created files that likely involved someone else (predecessor) adding a feature. So, how do you find a list of files ordered by creation date? Well, if you are deeply git and shell aware, you can probably sort that out. Or in the last few years, you can just ask whatever AI tool you are by default using in a browser to write the command for you:

find . -maxdepth 1 -type f -not -path '*/.*' | sed 's|^\./||' | while read -r file; do     if git ls-files --error-unmatch "$file" > /dev/null 2>&1; then         printf "%s | " "$(git log --diff-filter=A --follow --format="%ai | %an | %s" -- "$file" | tail -1)";         echo "$file";     fi; done | sort | column -t -s '|'

No comments: