On Tue, Jul 04, 2017 at 05:24:08PM -0400, Jeff King wrote: > On Tue, Jul 04, 2017 at 07:58:06PM +0000, brian m. carlson wrote: > > > > And here's one more patch on top of those that's necessary to get the > > > tests to pass (I don't expect anybody to necessarily be applying this > > > slow string of patches; it's just to show the direction I'm looking in). > > > > I've looked at your original patch, which modified reflog-walk.c, and it > > does fix the issue. I'm happy to send in a patch with that and a test > > (provided you're okay with me adding your sign-off), or if you wanted to > > send in something a bit more complete, like the series of patches here, > > that's fine, too. > > I've been on vacation for the past week, but wrapping this up is on my > todo. I'll try to get to it tonight. OK, so here's what I came up with. The first patch is my original small fix with an extra test. I think that would be appropriate for 'maint'. Its behavior still has some quirks, but it avoids the confusion that you experienced and has a low risk of breaking anything else. The rest of it replaces the fake-parent thing with a more straight-forward iteration over the reflogs (i.e., a cleanup of the further patches I've been posting). After digging into it and especially after writing the new tests, I think I've convinced myself that this is the right way forward. I tried to anticipate the behavior changes and I think all of them are improvements. I won't be surprised if there's some hidden gotcha, though, so this is definitely not for 'maint'. The patches do textually depend on the fix from 1/6; my intent was that they'd be applied in sequence and only merge up the first one to maint. [1/6]: reflog-walk: skip over double-null oid due to HEAD rename [2/6]: t1414: document some reflog-walk oddities [3/6]: log: do not free parents when walking reflog [4/6]: get_revision_1(): replace do-while with an early return [5/6]: rev-list: check reflog_info before showing usage [6/6]: reflog-walk: stop using fake parents builtin/log.c | 4 +- builtin/rev-list.c | 3 +- reflog-walk.c | 117 ++++++++++++++----------------------------------- reflog-walk.h | 6 ++- revision.c | 39 ++++++++++------- t/t1414-reflog-walk.sh | 86 ++++++++++++++++++++++++++++++++++++ t/t3200-branch.sh | 10 +++++ 7 files changed, 160 insertions(+), 105 deletions(-) create mode 100755 t/t1414-reflog-walk.sh -Peff