You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to read the entire code from first commit up until the last, but I would lose track most of the times as I was using git log --reverse -p; by the end I finished reading the current active commit in front of me, upon attempting the next day to come back to continue, I would get lost; it drove me insane!
So, I asked myself: what is the cleanest way to study any repo out there without losing track?
Seems like there's a "hack", so to speak, which is so convenient and elegant in my humble opinion.
With the kind assist of some folks from #git channel in Libera chat server (IRC), they came up with the following command:
git log --reverse -p | awk '/^commit/ { f = sprintf("%04d.patch", ++i) } 1 { print >> f }'
In other words, we take each commit and export it inside a .patch file that is also quite possible your favorite editor identifies this file format (I hope!).
Enjoy!
The text was updated successfully, but these errors were encountered:
I have tried to read the entire code from first commit up until the last, but I would lose track most of the times as I was using
git log --reverse -p
; by the end I finished reading the current active commit in front of me, upon attempting the next day to come back to continue, I would get lost; it drove me insane!So, I asked myself: what is the cleanest way to study any repo out there without losing track?
Seems like there's a "hack", so to speak, which is so convenient and elegant in my humble opinion.
With the kind assist of some folks from
#git
channel in Libera chat server (IRC), they came up with the following command:In other words, we take each commit and export it inside a
.patch
file that is also quite possible your favorite editor identifies this file format (I hope!).Enjoy!
The text was updated successfully, but these errors were encountered: