Re: [PATCH v3] fast-export: fix regression skipping some merge-commits
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- Apr 21, 2018, 07:00 UTC
- Message-ID
- <CAN0heSqQckJT-4mHbwoP_XjbE2-UH8+k2nG6mnN76_t3nzO_xw@mail.gmail.com>
- In-Reply-To
- <xmqqh8o5b4ww.fsf@gitster-ct.c.googlers.com>
On 21 April 2018 at 05:43, Junio C Hamano <gitster@pobox.com> wrote:
Show 29 quoted lines
> but I do not think the updated "fix" below is better. It might be > just aesthetics and I suspect I won't find it as disturbing if we > could push with > > object_array_push(commits, (struct object *)commit); > > or something that is more clearly symmetric to object_array_pop(). > The "Queue again" comment is needed only because use of "add" > highlights the lack of symmetry. > > With add_object_array(), it looks somewhat more odd than your > previous > > peek it to check; > if (it should not be molested) > return; > pop to mark it consumed; > consume it; > > sequence, in which peek() and pop() were more obviously related > operations on the same "array" object. > > And I do not think it is a good idea to introduce _push() only for > symmetry (it would merely be a less capable version of add whose > name is spelled differently). Hence my preference for peek-check-pop > over pop-oops-push-again-but-push-spelled-as-add. > > Not worth a reroll, though. I just wanted to spread better design > sense to contributors ;-)
Thanks for your wise words. :-) One thing that just occurred to me is that if the original site where we `add_object_array()` all objects starts adding a non-NULL `name` for some reason, then we need to remember to do the same with this new caller. I suspect that at that time, at the latest, we will be switching to peek-check-pop.
Thanks for sharing your thoughts.
Martin