From: Jeff King Date: Wed, 20 Jan 2016 01:34:36 GMT Subject: Re: [PATCH] filter-branch: resolve $commit^{tree} in no-index case Message-ID: <20160120013436.GA24541@sigill.intra.peff.net> In-Reply-To: <20160120012253.GD16090@google.com> On Tue, Jan 19, 2016 at 05:22:53PM -0800, Jonathan Nieder wrote: > > I'm actually a little iffy on it because it switches to "diff-tree" from > > a raw-sha1 comparison. For a well-formed repo, that shouldn't matter. > > But what if you had a commit that was replacing a malformed tree object, > > but not otherwise changing the diff? We might drop it as "empty", even > > though you'd prefer to keep it. > > Mph. We could get the best of both worlds by introducing a "git > rev-parse --compare " that compares object ids. Actually... > > How about something like this? Thanks. I had in my head that we could do something like that, but hadn't quite worked it out. I think what you wrote works. If you want to wrap it up into a patch, I'd be OK with it, but note that it still falls afoul of changing $tree in a user-visible way (so you should note that in the commit message). -Peff