From: Junio C Hamano <gitster@pobox•com>
To: "René Scharfe" <rene.scharfe@lsrfire•ath.cx>
Cc: git@vger•kernel.org, Jeff King <peff@peff•net>,
Michael Mueller <mmueller@vigilantsw•com>,
Ramkumar Ramachandra <artagnon@gmail•com>,
Junio C Hamano <gitster@pobox•com>
Subject: Re: [PATCH 1/3] sequencer: export commit_list_append()
Date: Wed, 25 Apr 2012 15:03:37 -0700 [thread overview]
Message-ID: <xmqqobqfbhae.fsf@junio.mtv.corp.google.com> (raw)
In-Reply-To: <4F98600F.6000404@lsrfire.ath.cx> ("René Scharfe"'s message of "Wed, 25 Apr 2012 22:35:27 +0200")
René Scharfe <rene.scharfe@lsrfire•ath.cx> writes:
> This function can be used in other parts of git. Give it a new home
> in commit.c.
>
> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire•ath.cx>
This makes sense. I got confused every time I had to "append to tail"
and had to draw boxes-and-arrows picture to make sure I understand how
to use "\(.*\) = &commit_list_insert(something, \1)->next" correctly.
There probably are tons of places that can use this thing.
$ git grep -c -e '\&commit_list_insert(.*)->next'
builtin/commit.c:4
builtin/diff-tree.c:1
builtin/merge.c:3
commit.c:4
revision.c:5
I however wonder if we can name "next" a bit better, but cannot come up
with a good name. It is the location that holds the pointer to the new
tail element if we append one. Some places may call it "tail" but that
gives a wrong impression that it points at the element at the end.
next prev parent reply other threads:[~2012-04-25 22:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-25 7:59 Possible segfault introduced in commit.c Michael Mueller
2012-04-25 11:14 ` Jeff King
2012-04-25 20:22 ` René Scharfe
2012-04-25 20:35 ` [PATCH 1/3] sequencer: export commit_list_append() René Scharfe
2012-04-25 22:03 ` Junio C Hamano [this message]
2012-04-30 21:07 ` René Scharfe
2012-04-25 20:35 ` [PATCH 2/3] revision: append to list instead of insert and reverse René Scharfe
2012-04-25 20:35 ` [PATCH 3/3] commit: remove commit_list_reverse() René Scharfe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqobqfbhae.fsf@junio.mtv.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=artagnon@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=mmueller@vigilantsw$(echo .)com \
--cc=peff@peff$(echo .)net \
--cc=rene.scharfe@lsrfire$(echo .)ath.cx \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox