Re: [PATCH v2 1/3] stash: add test to ensure reflog --rewrite --updatref behavior
- From
John Cai <johncai86@gmail.com>
- Date
- Feb 24, 2022, 14:53 UTC
- Message-ID
- <9AC71167-BED8-4003-A5B2-072B7913FA62@gmail.com>
- In-Reply-To
- <xmqqczjdp2g8.fsf@gitster.g>
Hi Junio,
On 23 Feb 2022, at 18:50, Junio C Hamano wrote:
Show 19 quoted lines
> John Cai <johncai86@gmail.com> writes: > >> Yes, this is true but that doesn't seem to test the --rewrite functionality. >> I could be missing something, but it seems that the reflog --rewrite option >> will write the LHS old oid value in the .git/logs/refs/stash file. When >> --rewrite isn't used, the reflog delete still does the right thing to the >> RHS entry. >> >> I couldn't find any way to check this LFS value other than reaching into the >> actual file. If there is a way that would be preferable. > > Ah, that one. > > As 2b81fab2 (git-reflog: add option --rewrite to update reflog > entries while expiring, 2008-02-22) says, the redundant half of the > reflog entry only matters to "certain sanity checks" and would not > be even visible to normal ref API users. I wonder why we need to > even say "--rewrite" in the first place. Perhaps we should > implicitly set it always and eventually deprecate that option.
Yeah, that makes sense. I had this thought as I was figuring out how to test this. I can take care of this in a separate patch series