Subject: Re: [PATCH] interpret_nth_last_branch(): avoid traversing the reflogs twice

From: Thomas Rast <[email-masked]>
Date: Tue, 20 Jan 2009 01:11:32 +0100

Johannes Schindelin wrote:
> > Junio C Hamano <[email-masked]> writes:
> > > You can have quite a many reflog entries, but you typically won't recall
> > > which branch you were on after switching branches for more than several
> > > times.
> 
> This, together with a removal of the hard-coded limit of 16 could be 
> squashed with this patch:

You know, I'm quite puzzled as to why we had working code that could
read the reflog backwards earlier in this thread, but it got shot down
solely based on impact and line counts, and you now have to jump
through hoops to work around the lack of this exact functionality.

So how about I resurrect the part about for_each_reflog_ent() and
_backward(), without touching read_ref_at().  This would actually
avoid the worst (hard to check) part of the patch since the
refactoring of for_each_reflog_ent()'s error checking is quite trivial
and IMHO actually results in more readable code.

I'm just asking because I'm not particularly inclined to do it first
and get rejected _again_.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch