Thread (18 messages) 18 messages, 4 authors, 2021-03-26

Re: Distinguishing FF vs non-FF updates in the reflog?

flat view

From: Martin Fick <hidden>
Date: 2021-03-22 17:46:29

On Monday, March 22, 2021 1:31:25 PM MDT Han-Wen Nienhuys wrote:
On Thu, Mar 18, 2021 at 11:24 PM Martin Fick [off-list ref] wrote:
quoted
On Thursday, March 18, 2021 9:58:56 AM MDT Han-Wen Nienhuys wrote:
quoted
On Wed, Mar 17, 2021 at 10:22 PM Martin Fick [off-list ref] 
wrote:
quoted
quoted
quoted
On Wednesday, March 17, 2021 9:06:06 PM MDT Han-Wen Nienhuys wrote:
quoted
I'm working on some extensions to Gerrit for which it would be very
beneficial if we could tell from the reflog if an update is a
fast-forward or not: if we find a SHA1 in the reflog, and see there
were only FF updates since, we can be sure that the SHA1 is
reachable
from the branch, without having to open packfiles and decode
commits.
I don't think this would be reliable.

1) Not all updates make it to the reflogs
2) Reflogs can be edited or mucked with
3) On NFS reflogs can outright be wrong even when used properly as
their
are caching issues. We specifically have seen entries that appear to
be
FFs that were not.
Can you tell a little more about 3) ? SInce we don't annotate non-FF
vs FF today, what does "appear to be FFs" mean?
To be honest I don't recall for sure, but I will describe what I think has
happened. I think that we have seen a server(A) update a branch from
C1 to C2A, and then later another server(B) update the same branch from C1
to C2B. Obviously the move from C2A to C2B is not a FF, but that move is
not what is recorded. Each of those updates was a FF when viewed as
separate entries,
I think those would fail with the way that Gerrit uses JGit, because
C1 -> C2B would fail with LOCK_ERROR.
If jgit knew that the branch no longer pointed to C1, then yes it should fail 
with LOCK_ERROR. However this situation is believed to arise due to jgit's 
caching which could make it think that the branch still points to C1 even 
thought it has already been advanced to C2A! :(

-Martin

-- 
The Qualcomm Innovation Center, Inc. is a member of Code 
Aurora Forum, hosted by The Linux Foundation
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help