{"thread":{"id":"63645","subject":"Question: regarding understanding code base","startedAt":"2025-06-14T12:43:51Z","lastAt":"2025-06-16T09:44:36Z","messageCount":9,"participants":["JAYATHEERTH K","Junio C Hamano","Ben Knoble"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"520248","messageId":"CA+rGoLf8Lf0gbPEUjTU9Zc9KQrzui4pjyvfxhA-LT4YuafqeOQ@mail.gmail.com","threadId":"63645","inReplyTo":null,"subject":"Question: regarding understanding code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-06-14T12:43:39Z","receivedAt":"2025-06-14T12:43:51Z","isPatch":false,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"Ok so a couple of weeks ago, in this thread[1]\nJunio advised that one of the best ways to understand git is to go back to the\n_inital commit_ and travel back to the latest ones.\n\nAnd I happened to quite like this idea, cause I still have to dig up a\nlot of things in git.\nThe main question is\nWhat are the best and smallest set of git commands to do this as\nI can set this up as an alias and use this trick for many other projects too.\n\n1 - https://lore.kernel.org/git/xmqqfrh3qe2w.fsf@gitster.g/\n\n\nThank you,\n\n- Jayatheerth\n"},{"id":"520250","messageId":"xmqq8qlu72hz.fsf@gitster.g","threadId":"63645","inReplyTo":"CA+rGoLf8Lf0gbPEUjTU9Zc9KQrzui4pjyvfxhA-LT4YuafqeOQ@mail.gmail.com","subject":"Re: Question: regarding understanding code base","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-06-14T15:43:20Z","receivedAt":"2025-06-14T15:43:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n\n> The main question is\n> What are the best and smallest set of git commands to do this as\n> I can set this up as an alias and use this trick for many other projects too.\n\nSorry, but I have no idea what you are trying to refer to as \"this\"\nin \"commands to do this\" and also \"this\" in \"use this trick\", so I\ncannot help you here.\n\n\n"},{"id":"520256","messageId":"CA+rGoLehMUWPMBrZ1hOk-GBQBCvSY0_ivFCn1w1C-V_bGTDgZg@mail.gmail.com","threadId":"63645","inReplyTo":"xmqq8qlu72hz.fsf@gitster.g","subject":"Re: Question: regarding understanding code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-06-15T00:24:46Z","receivedAt":"2025-06-15T00:24:58Z","isPatch":false,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"On Sat, Jun 14, 2025 at 9:13 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n>\n> > The main question is\n> > What are the best and smallest set of git commands to do this as\n> > I can set this up as an alias and use this trick for many other projects too.\n>\n> Sorry, but I have no idea what you are trying to refer to as \"this\"\n> in \"commands to do this\" and also \"this\" in \"use this trick\", so I\n> cannot help you here.\n>\n>\n\nWhat I meant was:\nYou previously suggested that one good way to understand Git is to\nstart from the initial commit of the Git repo and move forward\nchronologically through the commits.\n\nI'd like to turn this approach into a repeatable workflow, possibly\nthrough an alias or small script.\n\nSo my question is:\nWhat is the smallest and most effective set of Git commands to:\n\n- Start from the initial commit of a repository\n\n- Walk forward through history (one commit at a time) probably which\nchanges my file system (I currently use a terminal based command)\n\nI use\ngit rev-list --reverse HEAD | while read commit; do\n  echo \"=== Commit: $commit ===\"\n  git show --color --stat --patch --pretty=fuller \"$commit\"\n  read -p \"Press enter to continue to the next commit...\"\ndone\n\nI wanted to know if there are any better ways\n\nThanks again,\n- Jayatheerth\n"},{"id":"520257","messageId":"AF617F39-7B22-44A3-BF08-D21CCFBEBD20@gmail.com","threadId":"63645","inReplyTo":"CA+rGoLf8Lf0gbPEUjTU9Zc9KQrzui4pjyvfxhA-LT4YuafqeOQ@mail.gmail.com","subject":"Re: Question: regarding understanding code base","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-06-15T00:26:15Z","receivedAt":"2025-06-15T00:26:27Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 14 juin 2025 à 08:44, JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> a écrit :\n> \n> ﻿Ok so a couple of weeks ago, in this thread[1]\n> Junio advised that one of the best ways to understand git is to go back to the\n> _inital commit_ and travel back to the latest ones.\n> \n> And I happened to quite like this idea, cause I still have to dig up a\n> lot of things in git.\n> The main question is\n> What are the best and smallest set of git commands to do this as\n> I can set this up as an alias and use this trick for many other projects too.\n\nIf you want a checkout of the root commit, assuming there’s only one, something like\n\n    git rev-list | sed -n \\$p | xargs git switch --detach\n\nought to work. You could feed something similar to git-worktree. But it’s a little harder to “go forward” with Git’s data model, and I didn’t totally understand “travel back to the latest ones.”\n\n> \n> 1 - https://lore.kernel.org/git/xmqqfrh3qe2w.fsf@gitster.g/\n> \n> \n> Thank you,\n> \n> - Jayatheerth\n> \n"},{"id":"520258","messageId":"CA+rGoLcKfWYYSc-ORC9pCsUzsqketFdfVruwTC0Q06+BN5Gb7w@mail.gmail.com","threadId":"63645","inReplyTo":"AF617F39-7B22-44A3-BF08-D21CCFBEBD20@gmail.com","subject":"Re: Question: regarding understanding code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-06-15T00:37:19Z","receivedAt":"2025-06-15T00:37:31Z","isPatch":false,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"On Sun, Jun 15, 2025 at 5:56 AM Ben Knoble <ben.knoble@gmail.com> wrote:\n>\n>\n> > Le 14 juin 2025 à 08:44, JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> a écrit :\n> >\n> > ﻿Ok so a couple of weeks ago, in this thread[1]\n> > Junio advised that one of the best ways to understand git is to go back to the\n> > _inital commit_ and travel back to the latest ones.\n> >\n> > And I happened to quite like this idea, cause I still have to dig up a\n> > lot of things in git.\n> > The main question is\n> > What are the best and smallest set of git commands to do this as\n> > I can set this up as an alias and use this trick for many other projects too.\n>\n> If you want a checkout of the root commit, assuming there’s only one, something like\n>\n>     git rev-list | sed -n \\$p | xargs git switch --detach\n>\n> ought to work. You could feed something similar to git-worktree. But it’s a little harder to “go forward” with Git’s data model, and I didn’t totally understand “travel back to the latest ones.”\n>\n\nBy _travel back to the latest ones_ I think I should have said travel\n_forward to the latest ones_\n\nBut I meant to incrementally get to the _latest commit_ from the\n_initial commit_\n"},{"id":"520259","messageId":"xmqqldpt6dht.fsf@gitster.g","threadId":"63645","inReplyTo":"CA+rGoLehMUWPMBrZ1hOk-GBQBCvSY0_ivFCn1w1C-V_bGTDgZg@mail.gmail.com","subject":"Re: Question: regarding understanding code base","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-06-15T00:43:26Z","receivedAt":"2025-06-15T00:43:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n\n> What I meant was:\n> You previously suggested that one good way to understand Git is to\n> start from the initial commit of the Git repo and move forward\n> chronologically through the commits.\n\nNot at all.  I only suggested to study the initial one.  It is more\nlike biology students learning the common principles that apply to\nall kinds of life by studying a lot simpler organism as a model,\ninstead of studying a lot higher order ones like mammals.\n\nMoving forward is all your invention or hallucination ;-)\n\n> - Start from the initial commit of a repository\n>\n> - Walk forward through history (one commit at a time) probably which\n> changes my file system (I currently use a terminal based command)\n>\n> I use\n> git rev-list --reverse HEAD | while read commit; do\n>   echo \"=== Commit: $commit ===\"\n>   git show --color --stat --patch --pretty=fuller \"$commit\"\n>   read -p \"Press enter to continue to the next commit...\"\n> done\n>\n> I wanted to know if there are any better ways\n\nLike \"git log --reverse -p\"?\n"},{"id":"520261","messageId":"CA+rGoLcsuhhSOVJoK2vEV3m7PgH+8hpfpdih2furnyim=0gP+A@mail.gmail.com","threadId":"63645","inReplyTo":"xmqqldpt6dht.fsf@gitster.g","subject":"Re: Question: regarding understanding code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-06-15T00:48:53Z","receivedAt":"2025-06-15T00:49:05Z","isPatch":false,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"On Sun, Jun 15, 2025 at 6:13 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n>\n> > What I meant was:\n> > You previously suggested that one good way to understand Git is to\n> > start from the initial commit of the Git repo and move forward\n> > chronologically through the commits.\n>\n> Not at all.  I only suggested to study the initial one.  It is more\n> like biology students learning the common principles that apply to\n> all kinds of life by studying a lot simpler organism as a model,\n> instead of studying a lot higher order ones like mammals.\n>\n> Moving forward is all your invention or hallucination ;-)\n>\n\nFair enough I have read your biology metaphor\ninto a full evolutionary theory.\n"},{"id":"520272","messageId":"xmqqy0ts4izb.fsf@gitster.g","threadId":"63645","inReplyTo":"CA+rGoLcsuhhSOVJoK2vEV3m7PgH+8hpfpdih2furnyim=0gP+A@mail.gmail.com","subject":"Re: Question: regarding understanding code base","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-06-16T00:40:08Z","receivedAt":"2025-06-16T00:40:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n\n> On Sun, Jun 15, 2025 at 6:13 AM Junio C Hamano <gitster@pobox.com> wrote:\n>>\n>> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n>>\n>> > What I meant was:\n>> > You previously suggested that one good way to understand Git is to\n>> > start from the initial commit of the Git repo and move forward\n>> > chronologically through the commits.\n>>\n>> Not at all.  I only suggested to study the initial one.  It is more\n>> like biology students learning the common principles that apply to\n>> all kinds of life by studying a lot simpler organism as a model,\n>> instead of studying a lot higher order ones like mammals.\n>>\n>> Moving forward is all your invention or hallucination ;-)\n>>\n> Fair enough I have read your biology metaphor\n> into a full evolutionary theory.\n\nI should probably have said \"before\" instead of \"instead of\" in the\nabove.  You were looking for a way to see what higher order\norganisms there are to study, after learning from the simplest\norganism.\n\n\"git log --reverse -p\" is a simpler replacement for your shell\nscript loop to do so.\n\nIf I were doing this, after studying the initial one, I would\nprobably see how much of what I learned from the initial version\nremains in 1.0.0, 1.3.0, 1.5.3, and 1.6.0.\n\n1.5.3 was probably the last version one can read cover to cover in\none sitting.  Anything after that version are just too big, I think,\nbut there probably are those with more patience than I have ;-).\n"},{"id":"520286","messageId":"CA+rGoLeG=-PK6QiMKL6YuUYAarnd0rM_iGD=vAUReKYZ9ex9AA@mail.gmail.com","threadId":"63645","inReplyTo":"xmqqy0ts4izb.fsf@gitster.g","subject":"Re: Question: regarding understanding code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-06-16T09:44:23Z","receivedAt":"2025-06-16T09:44:36Z","isPatch":false,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"On Mon, Jun 16, 2025 at 6:10 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n>\n> > On Sun, Jun 15, 2025 at 6:13 AM Junio C Hamano <gitster@pobox.com> wrote:\n> >>\n> >> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n> >>\n> >> > What I meant was:\n> >> > You previously suggested that one good way to understand Git is to\n> >> > start from the initial commit of the Git repo and move forward\n> >> > chronologically through the commits.\n> >>\n> >> Not at all.  I only suggested to study the initial one.  It is more\n> >> like biology students learning the common principles that apply to\n> >> all kinds of life by studying a lot simpler organism as a model,\n> >> instead of studying a lot higher order ones like mammals.\n> >>\n> >> Moving forward is all your invention or hallucination ;-)\n> >>\n> > Fair enough I have read your biology metaphor\n> > into a full evolutionary theory.\n>\n> I should probably have said \"before\" instead of \"instead of\" in the\n> above.  You were looking for a way to see what higher order\n> organisms there are to study, after learning from the simplest\n> organism.\n>\n> \"git log --reverse -p\" is a simpler replacement for your shell\n> script loop to do so.\n>\n> If I were doing this, after studying the initial one, I would\n> probably see how much of what I learned from the initial version\n> remains in 1.0.0, 1.3.0, 1.5.3, and 1.6.0.\n>\n> 1.5.3 was probably the last version one can read cover to cover in\n> one sitting.  Anything after that version are just too big, I think,\n> but there probably are those with more patience than I have ;-).\n\nAgreed, it takes time to sincerely understand each function\n\nTill now how I've done is\nWhenever there was a bug report\nI acted like the compiler, tracing the file and function with pen and\npaper and found the quirk\nWhile this would work for bug fixes, I'm not sure if this is a good\npractice for big projects or a good practice in general.\n"}]}