* Question: regarding understanding code base
@ 2025-06-14 12:43 JAYATHEERTH K
2025-06-14 15:43 ` Junio C Hamano
2025-06-15 0:26 ` Ben Knoble
0 siblings, 2 replies; 9+ messages in thread
From: JAYATHEERTH K @ 2025-06-14 12:43 UTC (permalink / raw)
To: GIT Mailing-list; +Cc: Junio C Hamano
Ok so a couple of weeks ago, in this thread[1]
Junio advised that one of the best ways to understand git is to go back to the
_inital commit_ and travel back to the latest ones.
And I happened to quite like this idea, cause I still have to dig up a
lot of things in git.
The main question is
What are the best and smallest set of git commands to do this as
I can set this up as an alias and use this trick for many other projects too.
1 - https://lore.kernel.org/git/xmqqfrh3qe2w.fsf@gitster.g/
Thank you,
- Jayatheerth
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: regarding understanding code base
2025-06-14 12:43 Question: regarding understanding code base JAYATHEERTH K
@ 2025-06-14 15:43 ` Junio C Hamano
2025-06-15 0:24 ` JAYATHEERTH K
2025-06-15 0:26 ` Ben Knoble
1 sibling, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2025-06-14 15:43 UTC (permalink / raw)
To: JAYATHEERTH K; +Cc: GIT Mailing-list
JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:
> The main question is
> What are the best and smallest set of git commands to do this as
> I can set this up as an alias and use this trick for many other projects too.
Sorry, but I have no idea what you are trying to refer to as "this"
in "commands to do this" and also "this" in "use this trick", so I
cannot help you here.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: regarding understanding code base
2025-06-14 15:43 ` Junio C Hamano
@ 2025-06-15 0:24 ` JAYATHEERTH K
2025-06-15 0:43 ` Junio C Hamano
0 siblings, 1 reply; 9+ messages in thread
From: JAYATHEERTH K @ 2025-06-15 0:24 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
On Sat, Jun 14, 2025 at 9:13 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:
>
> > The main question is
> > What are the best and smallest set of git commands to do this as
> > I can set this up as an alias and use this trick for many other projects too.
>
> Sorry, but I have no idea what you are trying to refer to as "this"
> in "commands to do this" and also "this" in "use this trick", so I
> cannot help you here.
>
>
What I meant was:
You previously suggested that one good way to understand Git is to
start from the initial commit of the Git repo and move forward
chronologically through the commits.
I'd like to turn this approach into a repeatable workflow, possibly
through an alias or small script.
So my question is:
What is the smallest and most effective set of Git commands to:
- Start from the initial commit of a repository
- Walk forward through history (one commit at a time) probably which
changes my file system (I currently use a terminal based command)
I use
git rev-list --reverse HEAD | while read commit; do
echo "=== Commit: $commit ==="
git show --color --stat --patch --pretty=fuller "$commit"
read -p "Press enter to continue to the next commit..."
done
I wanted to know if there are any better ways
Thanks again,
- Jayatheerth
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: regarding understanding code base
2025-06-15 0:24 ` JAYATHEERTH K
@ 2025-06-15 0:43 ` Junio C Hamano
2025-06-15 0:48 ` JAYATHEERTH K
0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2025-06-15 0:43 UTC (permalink / raw)
To: JAYATHEERTH K; +Cc: GIT Mailing-list
JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:
> What I meant was:
> You previously suggested that one good way to understand Git is to
> start from the initial commit of the Git repo and move forward
> chronologically through the commits.
Not at all. I only suggested to study the initial one. It is more
like biology students learning the common principles that apply to
all kinds of life by studying a lot simpler organism as a model,
instead of studying a lot higher order ones like mammals.
Moving forward is all your invention or hallucination ;-)
> - Start from the initial commit of a repository
>
> - Walk forward through history (one commit at a time) probably which
> changes my file system (I currently use a terminal based command)
>
> I use
> git rev-list --reverse HEAD | while read commit; do
> echo "=== Commit: $commit ==="
> git show --color --stat --patch --pretty=fuller "$commit"
> read -p "Press enter to continue to the next commit..."
> done
>
> I wanted to know if there are any better ways
Like "git log --reverse -p"?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: regarding understanding code base
2025-06-15 0:43 ` Junio C Hamano
@ 2025-06-15 0:48 ` JAYATHEERTH K
2025-06-16 0:40 ` Junio C Hamano
0 siblings, 1 reply; 9+ messages in thread
From: JAYATHEERTH K @ 2025-06-15 0:48 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
On Sun, Jun 15, 2025 at 6:13 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:
>
> > What I meant was:
> > You previously suggested that one good way to understand Git is to
> > start from the initial commit of the Git repo and move forward
> > chronologically through the commits.
>
> Not at all. I only suggested to study the initial one. It is more
> like biology students learning the common principles that apply to
> all kinds of life by studying a lot simpler organism as a model,
> instead of studying a lot higher order ones like mammals.
>
> Moving forward is all your invention or hallucination ;-)
>
Fair enough I have read your biology metaphor
into a full evolutionary theory.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: regarding understanding code base
2025-06-15 0:48 ` JAYATHEERTH K
@ 2025-06-16 0:40 ` Junio C Hamano
2025-06-16 9:44 ` JAYATHEERTH K
0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2025-06-16 0:40 UTC (permalink / raw)
To: JAYATHEERTH K; +Cc: GIT Mailing-list
JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:
> On Sun, Jun 15, 2025 at 6:13 AM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:
>>
>> > What I meant was:
>> > You previously suggested that one good way to understand Git is to
>> > start from the initial commit of the Git repo and move forward
>> > chronologically through the commits.
>>
>> Not at all. I only suggested to study the initial one. It is more
>> like biology students learning the common principles that apply to
>> all kinds of life by studying a lot simpler organism as a model,
>> instead of studying a lot higher order ones like mammals.
>>
>> Moving forward is all your invention or hallucination ;-)
>>
> Fair enough I have read your biology metaphor
> into a full evolutionary theory.
I should probably have said "before" instead of "instead of" in the
above. You were looking for a way to see what higher order
organisms there are to study, after learning from the simplest
organism.
"git log --reverse -p" is a simpler replacement for your shell
script loop to do so.
If I were doing this, after studying the initial one, I would
probably see how much of what I learned from the initial version
remains in 1.0.0, 1.3.0, 1.5.3, and 1.6.0.
1.5.3 was probably the last version one can read cover to cover in
one sitting. Anything after that version are just too big, I think,
but there probably are those with more patience than I have ;-).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: regarding understanding code base
2025-06-16 0:40 ` Junio C Hamano
@ 2025-06-16 9:44 ` JAYATHEERTH K
0 siblings, 0 replies; 9+ messages in thread
From: JAYATHEERTH K @ 2025-06-16 9:44 UTC (permalink / raw)
To: Junio C Hamano; +Cc: GIT Mailing-list
On Mon, Jun 16, 2025 at 6:10 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:
>
> > On Sun, Jun 15, 2025 at 6:13 AM Junio C Hamano <gitster@pobox.com> wrote:
> >>
> >> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:
> >>
> >> > What I meant was:
> >> > You previously suggested that one good way to understand Git is to
> >> > start from the initial commit of the Git repo and move forward
> >> > chronologically through the commits.
> >>
> >> Not at all. I only suggested to study the initial one. It is more
> >> like biology students learning the common principles that apply to
> >> all kinds of life by studying a lot simpler organism as a model,
> >> instead of studying a lot higher order ones like mammals.
> >>
> >> Moving forward is all your invention or hallucination ;-)
> >>
> > Fair enough I have read your biology metaphor
> > into a full evolutionary theory.
>
> I should probably have said "before" instead of "instead of" in the
> above. You were looking for a way to see what higher order
> organisms there are to study, after learning from the simplest
> organism.
>
> "git log --reverse -p" is a simpler replacement for your shell
> script loop to do so.
>
> If I were doing this, after studying the initial one, I would
> probably see how much of what I learned from the initial version
> remains in 1.0.0, 1.3.0, 1.5.3, and 1.6.0.
>
> 1.5.3 was probably the last version one can read cover to cover in
> one sitting. Anything after that version are just too big, I think,
> but there probably are those with more patience than I have ;-).
Agreed, it takes time to sincerely understand each function
Till now how I've done is
Whenever there was a bug report
I acted like the compiler, tracing the file and function with pen and
paper and found the quirk
While this would work for bug fixes, I'm not sure if this is a good
practice for big projects or a good practice in general.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Question: regarding understanding code base
2025-06-14 12:43 Question: regarding understanding code base JAYATHEERTH K
2025-06-14 15:43 ` Junio C Hamano
@ 2025-06-15 0:26 ` Ben Knoble
2025-06-15 0:37 ` JAYATHEERTH K
1 sibling, 1 reply; 9+ messages in thread
From: Ben Knoble @ 2025-06-15 0:26 UTC (permalink / raw)
To: JAYATHEERTH K; +Cc: GIT Mailing-list, Junio C Hamano
> Le 14 juin 2025 à 08:44, JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> a écrit :
>
> Ok so a couple of weeks ago, in this thread[1]
> Junio advised that one of the best ways to understand git is to go back to the
> _inital commit_ and travel back to the latest ones.
>
> And I happened to quite like this idea, cause I still have to dig up a
> lot of things in git.
> The main question is
> What are the best and smallest set of git commands to do this as
> I can set this up as an alias and use this trick for many other projects too.
If you want a checkout of the root commit, assuming there’s only one, something like
git rev-list | sed -n \$p | xargs git switch --detach
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.”
>
> 1 - https://lore.kernel.org/git/xmqqfrh3qe2w.fsf@gitster.g/
>
>
> Thank you,
>
> - Jayatheerth
>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Question: regarding understanding code base
2025-06-15 0:26 ` Ben Knoble
@ 2025-06-15 0:37 ` JAYATHEERTH K
0 siblings, 0 replies; 9+ messages in thread
From: JAYATHEERTH K @ 2025-06-15 0:37 UTC (permalink / raw)
To: Ben Knoble; +Cc: GIT Mailing-list, Junio C Hamano
On Sun, Jun 15, 2025 at 5:56 AM Ben Knoble <ben.knoble@gmail.com> wrote:
>
>
> > Le 14 juin 2025 à 08:44, JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> a écrit :
> >
> > Ok so a couple of weeks ago, in this thread[1]
> > Junio advised that one of the best ways to understand git is to go back to the
> > _inital commit_ and travel back to the latest ones.
> >
> > And I happened to quite like this idea, cause I still have to dig up a
> > lot of things in git.
> > The main question is
> > What are the best and smallest set of git commands to do this as
> > I can set this up as an alias and use this trick for many other projects too.
>
> If you want a checkout of the root commit, assuming there’s only one, something like
>
> git rev-list | sed -n \$p | xargs git switch --detach
>
> 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.”
>
By _travel back to the latest ones_ I think I should have said travel
_forward to the latest ones_
But I meant to incrementally get to the _latest commit_ from the
_initial commit_
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-06-16 9:44 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-14 12:43 Question: regarding understanding code base JAYATHEERTH K
2025-06-14 15:43 ` Junio C Hamano
2025-06-15 0:24 ` JAYATHEERTH K
2025-06-15 0:43 ` Junio C Hamano
2025-06-15 0:48 ` JAYATHEERTH K
2025-06-16 0:40 ` Junio C Hamano
2025-06-16 9:44 ` JAYATHEERTH K
2025-06-15 0:26 ` Ben Knoble
2025-06-15 0:37 ` JAYATHEERTH K
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox