Re: [PATCH 2/3] checkout: clear commit marks after detached-orphan check
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 20, 2011, 19:05 UTC
- Message-ID
- <7v8vw9wr2i.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20110320090918.GB15948@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> This uses for_each_ref to re-find the list of commits we touched in our > traversal, which feels a little hacky. prepare_revision_walk already > generates the exact list of tips, but unfortunately writes it > into revs->commits, which then gets munged by limit_list in the second > half of prepare_revision_walk. I wonder if it should keep a copy > elsewhere in revs...
There is a precedence in merge-bases codepath that tries to be reusable by doing its own clearing (C.f. get_merge_bases_many() and its use of cleanup parameter). If that codepath becomes cleaner if prepare_revision_walk() left an extra copy in revs structure, it would be a strong sign that it is worth doing, I think.