Re: [PATCH 1/3] sequencer: export commit_list_append()

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/3] sequencer: export commit_list_append()

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:40

René Scharfe [off-list ref] writes:
This function can be used in other parts of git.  Give it a new home
in commit.c.

Signed-off-by: Rene Scharfe <redacted>
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.

Re: [PATCH 1/3] sequencer: export commit_list_append()

From: René Scharfe <hidden>
Date: 2016-06-15 22:53:41

Am 26.04.2012 00:03, schrieb Junio C Hamano:
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.
Perhaps tail_next?  And it's perhaps a good idea to include it in the 
struct instead of letting callers maintain it separately.

René
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help