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

Re: [PATCH v4 0/4] scalar: make unregister idempotent

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 27, 2022, 16:31 UTC
Message-ID
<xmqqtu4s7p9q.fsf@gitster.g>
In-Reply-To
<pull.1358.v4.git.1664287021.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 12 quoted lines
> I noticed this while we were updating the microsoft/git fork to include
> v2.38.0-rc0. I don't think 'git maintenance unregister' was idempotent
> before, but instead some change in 'scalar unregister' led to it relying on
> the return code of 'git maintenance unregister'. Our functional tests expect
> 'scalar unregister' to be idempotent, and I think that's a good pattern for
> 'git maintenance unregister', so I'm fixing it at that layer.
>
> Despite finding this during the 2.38.0-rc0 integration, this isn't critical
> to the release.
>
> Perhaps an argument could be made that "failure means it wasn't registered
> before", but I think that isn't terribly helpful.

I happen _not_ to share the idea that "unregister is expected to be idempotent" is a good pattern at all, and it is a better pattern to make failure mean that the object specified to be acted upon did not even exist (cf. "rm no-such-file"). But that aside, does what the above paragraphs mention still true for this round, namely, you are "fixing" it at that (i.e. "maintenance unregister") layer?

The cover letter does not become part of the permanent history, so it is not a huge deal as long as the reviewers know what they are looking at ;-). Just leaving a note in case somebody who missed the iterations up to v3 is now interested in the topic.

Thanks for a quick iteration.
Previous: Junio C HamanoNext: Derrick Stolee
Message 33 of 34 in “maintenance: make unregister idempotent”
  1. maintenance: make unregister idempotentDerrick Stolee via GitGitGadget, Sep 20, 2022
  2. Junio C HamanoSep 21, 2022
  3. Derrick StoleeSep 22, 2022
  4. Junio C HamanoSep 22, 2022
  5. Derrick StoleeSep 22, 2022
  6. Junio C HamanoSep 22, 2022
  7. 0/2 scalar: make unregister idempotentDerrick Stolee via GitGitGadget, Sep 22, 2022
  8. 2/2 scalar: make 'unregister' idempotentDerrick Stolee via GitGitGadget, Sep 22, 2022
  9. 1/2 maintenance: add 'unregister --force'Derrick Stolee via GitGitGadget, Sep 22, 2022
  10. SZEDER GáborSep 23, 2022
  11. Derrick StoleeSep 26, 2022
  12. Ævar Arnfjörð BjarmasonSep 26, 2022
  13. Derrick StoleeSep 26, 2022
  14. Junio C HamanoSep 26, 2022
  15. 0/3 scalar: make unregister idempotentDerrick Stolee via GitGitGadget, Sep 26, 2022
  16. 1/3 maintenance: add 'unregister --force'Derrick Stolee via GitGitGadget, Sep 26, 2022
  17. Junio C HamanoSep 26, 2022
  18. Derrick StoleeSep 26, 2022
  19. Junio C HamanoSep 26, 2022
  20. Derrick StoleeSep 27, 2022
  21. Derrick StoleeSep 27, 2022
  22. Ævar Arnfjörð BjarmasonSep 27, 2022
  23. Derrick StoleeSep 27, 2022
  24. 2/3 scalar: make 'unregister' idempotentDerrick Stolee via GitGitGadget, Sep 26, 2022
  25. 3/3 gc: replace config subprocesses with API callsDerrick Stolee via GitGitGadget, Sep 26, 2022
  26. Junio C HamanoSep 26, 2022
  27. 0/4 scalar: make unregister idempotentDerrick Stolee via GitGitGadget, Sep 27, 2022
  28. 1/4 maintenance: add 'unregister --force'Derrick Stolee via GitGitGadget, Sep 27, 2022
  29. 2/4 scalar: make 'unregister' idempotentDerrick Stolee via GitGitGadget, Sep 27, 2022
  30. 3/4 gc: replace config subprocesses with API callsDerrick Stolee via GitGitGadget, Sep 27, 2022
  31. 4/4 string-list: document iterator behavior on NULL inputDerrick Stolee via GitGitGadget, Sep 27, 2022
  32. Junio C HamanoSep 27, 2022
  33. Junio C HamanoSep 27, 2022
  34. Derrick StoleeSep 27, 2022

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.