git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Han-Wen Nienhuys <hanwen@google.com>
Date
Mar 22, 2021, 17:12 UTC
Message-ID
<CAFQ2z_OVbcxZtb-hS1DZ3X7FpdQD25W0VqtGLXdkQ4bjgCPS-w@mail.gmail.com>
In-Reply-To
<878s6fqgze.fsf@evledraar.gmail.com>

On Mon, Mar 22, 2021 at 5:40 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 27 quoted lines
>
>
> On Mon, Mar 22 2021, Han-Wen Nienhuys wrote:
>
> > On Mon, Mar 22, 2021 at 4:39 PM Ævar Arnfjörð Bjarmason
> > <avarab@gmail.com> wrote:
> >> We can know with !strcmp(rows[0][1], rows[1][0]) whether the latest
> >> update is a ff or non-ff (it is). As opposed to:
> >>
> >>     $ cut -d ' ' -f1-2 .git/logs/refs/remotes/origin/seen | head -n 2
> >>     8b26a41f4bf7e7c0f097cb91012d08fe8ae30e7f 0f3a981cbd5be5f97e9504ab770cd88f988fe820
> >>     0f3a981cbd5be5f97e9504ab770cd88f988fe820 fdd019edfe6bc60d0100d5751c41e4f6ad28a2ef
> >>
> >> Where the rows[0][1] value is not the same as rows[1][0].
> >
> > I'm confused.
> >
> > rows[0][1] == "0f3a981cbd5be5f97e9504ab770cd88f988fe820"
> > rows[1][0] == "0f3a981cbd5be5f97e9504ab770cd88f988fe820"
> >
> > they are the same. I don't understand your argument.
>
> Sorry, I mean same = ff update, not the same = non-ff. So I flipped
> those around in describing it.
>
> But in any case, the point is that you can reliably tell from a log of
> updates whether individual updates are ff or non-ff, as long as you:
?

$ git checkout -b non-ff origin/master Previous HEAD position was 59f4325222 Add "test-tool dump-reftable" command. Branch 'non-ff' set up to track remote branch 'master' from 'origin'. Switched to a new branch 'non-ff'

$ git reset --hard HEAD^ HEAD is now at 56a57652ef Sync with Git 2.30.2 for CVE-2021-21300

$ cat .git/logs/refs/heads/non-ff 0000000000000000000000000000000000000000 13d7ab6b5d7929825b626f050b62a11241ea4945 Han-Wen Nienhuys <hanwen@google.com> 1616432938 +0100 branch: Created from origin/master 13d7ab6b5d7929825b626f050b62a11241ea4945 56a57652ef8e4ca2f108a8719b8caeed5e153c95 Han-Wen Nienhuys <hanwen@google.com> 1616432948 +0100 reset: moving to HEAD^

How can I tell from this reflog that "moving to HEAD^" is a non-FF update?
-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 18 of 19 in “Distinguishing FF vs non-FF updates in the reflog?”
  1. Han-Wen NienhuysMar 17, 2021
  2. Martin FickMar 17, 2021
  3. Han-Wen NienhuysMar 18, 2021
  4. Jeff KingMar 18, 2021
  5. Martin FickMar 18, 2021
  6. Han-Wen NienhuysMar 22, 2021
  7. Martin FickMar 22, 2021
  8. Martin FickMar 18, 2021
  9. Jeff KingMar 18, 2021
  10. Jeff KingMar 18, 2021
  11. Han-Wen NienhuysMar 22, 2021
  12. Jeff KingMar 26, 2021
  13. Ævar Arnfjörð BjarmasonMar 22, 2021
  14. Han-Wen NienhuysMar 22, 2021
  15. Ævar Arnfjörð BjarmasonMar 22, 2021
  16. Han-Wen NienhuysMar 22, 2021
  17. Ævar Arnfjörð BjarmasonMar 22, 2021
  18. Han-Wen NienhuysMar 22, 2021
  19. Junio C HamanoMar 22, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.