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

Re: [PATCH v3 06/12] refs API: pass the "lock OID" to reflog "prepare"

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2021, 20:49 UTC
Message-ID
<xmqqzguclpr2.fsf@gitster.g>
In-Reply-To
<87lf5wstlv.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 32 quoted lines
> On Wed, Jul 21 2021, Han-Wen Nienhuys wrote:
>
>> On Wed, Jul 21, 2021 at 7:48 PM Junio C Hamano <gitster@pobox.com> wrote:
>>
>>  Junio C Hamano <gitster@pobox.com> writes:
>>
>>  > This obviously breaks the latest round of reftable topic, as it
>>  > still wants this type to take const oid, and I do not think using
>>  > on-filesystem lock as if we are using the files backend is not a
>>  > good solution.
>>
>>  Sorry for redundant negation.  "I do not think it is a good solution
>>  to have everybody pretend as if they are files backend when they
>>  lock refs." was what I meant.
>>
>> Reftable could easily read the current OID for the reference, if necessary. 
>
> (I'm replying to a mail of Han-Wen's that didn't make it on-list due to
> inline HTML, quoted here in its entirety sans signature, see
> https://lore.kernel.org/git/87eebptr7i.fsf@evledraar.gmail.com/)
>
> Junio: I can change the const around if desired. I thought we weren't
> particularly concerned about it in general except to avoid the verbosity
> of frequent casting, and in this case the lock API doesn't have "const".
>
> But as for the reftable incompatibility it seems to me irrespective of
> backend that a reflog API that supports expiry is going to want to have
> a callback for "give me a lock to expire this branch" and give you a
> reply of "OK, you have the lock, you can expire the log, and it's at
> this OID".
>
> Why would it be file-backend specific?

If you feed const oid to *_reflog_expire() method of any backend (including the ones that that are *not* files backend), and if you expect they all will use lockfile API to copy it into lock->old_oid so that it can be fed safely to prepare_fn(), then the arrangement for constness you have set up in your series would work out OK for everybody. But for any backend that does not use one-file-per-ref filesystem mapping, it is rather strange to use lockfile API for locking refs, no? THat is what I meant by files-backend specific.

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 86 of 88 in “refs file backend: remove dead "errno == EISDIR" code”
  1. refs file backend: remove dead "errno == EISDIR" codeÆvar Arnfjörð Bjarmason, Jul 14, 2021
  2. Jeff KingJul 14, 2021
  3. Ævar Arnfjörð BjarmasonJul 14, 2021
  4. Jeff KingJul 14, 2021
  5. Ævar Arnfjörð BjarmasonJul 15, 2021
  6. Jeff KingJul 15, 2021
  7. Junio C HamanoJul 17, 2021
  8. Jeff KingJul 17, 2021
  9. Junio C HamanoJul 19, 2021
  10. Junio C HamanoJul 19, 2021
  11. Ævar Arnfjörð BjarmasonJul 17, 2021
  12. 00/11 fix "git reflog expire" race & get rid of EISDIR in refs APIÆvar Arnfjörð Bjarmason, Jul 16, 2021
  13. 01/11 refs/packet: add missing BUG() invocations to reflog callbacksÆvar Arnfjörð Bjarmason, Jul 16, 2021
  14. 02/11 refs/files: remove unused REF_DELETING in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Jul 16, 2021
  15. Jeff KingJul 17, 2021
  16. Junio C HamanoJul 19, 2021
  17. Jeff KingJul 20, 2021
  18. 03/11 refs/files: remove unused "extras/skip" in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Jul 16, 2021
  19. 04/11 refs/files: remove unused "skip" in lock_raw_ref() tooÆvar Arnfjörð Bjarmason, Jul 16, 2021
  20. 05/11 refs/debug: re-indent argument list for "prepare"Ævar Arnfjörð Bjarmason, Jul 16, 2021
  21. 06/11 refs API: pass the "lock OID" to reflog "prepare"Ævar Arnfjörð Bjarmason, Jul 16, 2021
  22. Jeff KingJul 17, 2021
  23. Junio C HamanoJul 19, 2021
  24. Ævar Arnfjörð BjarmasonJul 19, 2021
  25. 07/11 refs: make repo_dwim_log() accept a NULL oidÆvar Arnfjörð Bjarmason, Jul 16, 2021
  26. 08/11 refs/files: add a comment about refs_reflog_exists() callÆvar Arnfjörð Bjarmason, Jul 16, 2021
  27. Jeff KingJul 17, 2021
  28. Junio C HamanoJul 19, 2021
  29. Jeff KingJul 20, 2021
  30. 09/11 reflog expire: don't lock reflogs using previously seen OIDÆvar Arnfjörð Bjarmason, Jul 16, 2021
  31. Jeff KingJul 17, 2021
  32. Han-Wen NienhuysAug 17, 2021
  33. Junio C HamanoAug 18, 2021
  34. Carlo Marcelo Arenas BelónAug 19, 2021
  35. Junio C HamanoAug 20, 2021
  36. 10/11 refs/files: remove unused "oid" in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Jul 16, 2021
  37. Jeff KingJul 17, 2021
  38. 11/11 refs/files: remove unused "errno == EISDIR" codeÆvar Arnfjörð Bjarmason, Jul 16, 2021
  39. Jeff KingJul 17, 2021
  40. Jeff KingJul 17, 2021
  41. 00/12 fix "git reflog expire" race & get rid of EISDIR in refs APIÆvar Arnfjörð Bjarmason, Jul 20, 2021
  42. 10/12 refs/files: remove unused "oid" in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Jul 20, 2021
  43. 05/12 refs/debug: re-indent argument list for "prepare"Ævar Arnfjörð Bjarmason, Jul 20, 2021
  44. 08/12 refs/files: add a comment about refs_reflog_exists() callÆvar Arnfjörð Bjarmason, Jul 20, 2021
  45. 07/12 refs: make repo_dwim_log() accept a NULL oidÆvar Arnfjörð Bjarmason, Jul 20, 2021
  46. 02/12 refs/files: remove unused REF_DELETING in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Jul 20, 2021
  47. Junio C HamanoAug 2, 2021
  48. 01/12 refs/packet: add missing BUG() invocations to reflog callbacksÆvar Arnfjörð Bjarmason, Jul 20, 2021
  49. 11/12 refs/files: remove unused "errno == EISDIR" codeÆvar Arnfjörð Bjarmason, Jul 20, 2021
  50. 09/12 reflog expire: don't lock reflogs using previously seen OIDÆvar Arnfjörð Bjarmason, Jul 20, 2021
  51. 03/12 refs/files: remove unused "extras/skip" in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Jul 20, 2021
  52. 06/12 refs API: pass the "lock OID" to reflog "prepare"Ævar Arnfjörð Bjarmason, Jul 20, 2021
  53. Junio C HamanoJul 21, 2021
  54. Junio C HamanoJul 21, 2021
  55. 12/12 refs/files: remove unused "errno != ENOTDIR" conditionÆvar Arnfjörð Bjarmason, Jul 20, 2021
  56. 04/12 refs/files: remove unused "skip" in lock_raw_ref() tooÆvar Arnfjörð Bjarmason, Jul 20, 2021
  57. 00/11 fix "git reflog expire" race & get rid of EISDIR in refs APIÆvar Arnfjörð Bjarmason, Jul 26, 2021
  58. 02/11 refs/files: remove unused REF_DELETING in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Jul 26, 2021
  59. 01/11 refs/packet: add missing BUG() invocations to reflog callbacksÆvar Arnfjörð Bjarmason, Jul 26, 2021
  60. 03/11 refs/files: remove unused "extras/skip" in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Jul 26, 2021
  61. 05/11 refs/debug: re-indent argument list for "prepare"Ævar Arnfjörð Bjarmason, Jul 26, 2021
  62. 04/11 refs/files: remove unused "skip" in lock_raw_ref() tooÆvar Arnfjörð Bjarmason, Jul 26, 2021
  63. 07/11 refs/files: add a comment about refs_reflog_exists() callÆvar Arnfjörð Bjarmason, Jul 26, 2021
  64. 09/11 refs/files: remove unused "oid" in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Jul 26, 2021
  65. 08/11 reflog expire: don't lock reflogs using previously seen OIDÆvar Arnfjörð Bjarmason, Jul 26, 2021
  66. Junio C HamanoAug 2, 2021
  67. Ævar Arnfjörð BjarmasonAug 4, 2021
  68. 10/11 refs/files: remove unused "errno == EISDIR" codeÆvar Arnfjörð Bjarmason, Jul 26, 2021
  69. 11/11 refs/files: remove unused "errno != ENOTDIR" conditionÆvar Arnfjörð Bjarmason, Jul 26, 2021
  70. 06/11 refs: make repo_dwim_log() accept a NULL oidÆvar Arnfjörð Bjarmason, Jul 26, 2021
  71. 00/13 fix "git reflog expire" race & get rid of EISDIR in refs APIÆvar Arnfjörð Bjarmason, Aug 23, 2021
  72. 01/13 refs/packet: add missing BUG() invocations to reflog callbacksÆvar Arnfjörð Bjarmason, Aug 23, 2021
  73. 02/13 refs/files: remove unused REF_DELETING in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Aug 23, 2021
  74. 03/13 refs: drop unused "flags" parameter to lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Aug 23, 2021
  75. 04/13 refs/files: remove unused "extras/skip" in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Aug 23, 2021
  76. 05/13 refs/files: remove unused "skip" in lock_raw_ref() tooÆvar Arnfjörð Bjarmason, Aug 23, 2021
  77. 06/13 refs/debug: re-indent argument list for "prepare"Ævar Arnfjörð Bjarmason, Aug 23, 2021
  78. 07/13 refs: make repo_dwim_log() accept a NULL oidÆvar Arnfjörð Bjarmason, Aug 23, 2021
  79. 08/13 refs/files: add a comment about refs_reflog_exists() callÆvar Arnfjörð Bjarmason, Aug 23, 2021
  80. 09/13 reflog expire: don't lock reflogs using previously seen OIDÆvar Arnfjörð Bjarmason, Aug 23, 2021
  81. 10/13 refs API: remove OID argument to reflog_expire()Ævar Arnfjörð Bjarmason, Aug 23, 2021
  82. 11/13 refs/files: remove unused "oid" in lock_ref_oid_basic()Ævar Arnfjörð Bjarmason, Aug 23, 2021
  83. 12/13 refs/files: remove unused "errno == EISDIR" codeÆvar Arnfjörð Bjarmason, Aug 23, 2021
  84. 13/13 refs/files: remove unused "errno != ENOTDIR" conditionÆvar Arnfjörð Bjarmason, Aug 23, 2021
  85. Ævar Arnfjörð BjarmasonJul 23, 2021
  86. Junio C HamanoJul 23, 2021
  87. Ævar Arnfjörð BjarmasonJul 26, 2021
  88. Junio C HamanoJul 26, 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.