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

[PATCH 0/7] Tidy up the constants related to ref_update::flags

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Oct 28, 2017, 09:49 UTC
Message-ID
<cover.1509183413.git.mhagger@alum.mit.edu>

Nothing earth-shattering here; just cleaning up some internal details that have bothered me for a while:

* Make it clearer which flag values the packed backend might confront.
* Reduce the visibility of the constants that are only relevant to the
  files backend. The most notable of these is `REF_ISPRUNING`, which
  previously was special-cased in
  `REF_TRANSACTION_UPDATE_ALLOWED_FLAGS` even though it shouldn't be
  used by callers outside of the refs module.
* Die (rather then silently ignoring) if any disallowed flags are
  passed to `ref_transaction_update()` or friends.
* Rename `REF_NODEREF` to `REF_NO_DEREF` (otherwise it's easy to read
  as `REF_NODE_REF`!)
* Rename `REF_ISPRUNING` to `REF_IS_PRUNING`.
* Make the constants' numerical values correspond to their order.
* Improve a lot of docstrings.

This patch series depends on `bc/object-id`, mostly so that the comments can talk about OIDs rather than SHA-1s.

These patches are also available as branch `tidy-ref-update-flags` from my GitHub fork [1].

Michael
[1] https://github.com/mhagger/git
Michael Haggerty (7):
  files_transaction_prepare(): don't leak flags to packed transaction
  prune_ref(): call `ref_transaction_add_update()` directly
  ref_transaction_update(): die on disallowed flags
  ref_transaction_add_update(): remove a check
  refs: tidy up and adjust visibility of the `ref_update` flags
  refs: rename constant `REF_NODEREF` to `REF_NO_DEREF`
  refs: rename constant `REF_ISPRUNING` to `REF_IS_PRUNING`
 builtin/am.c           |   2 +-
 builtin/branch.c       |   2 +-
 builtin/checkout.c     |   2 +-
 builtin/clone.c        |   4 +-
 builtin/notes.c        |   2 +-
 builtin/remote.c       |   6 +--
 builtin/symbolic-ref.c |   2 +-
 builtin/update-ref.c   |   4 +-
 refs.c                 |   6 +--
 refs.h                 |  67 ++++++++++++++++-------------
 refs/files-backend.c   | 113 +++++++++++++++++++++++++++++++++++++------------
 refs/refs-internal.h   |  67 +++++++----------------------
 sequencer.c            |   6 +--
 13 files changed, 155 insertions(+), 128 deletions(-)
-- 
2.14.1
Next: Michael Haggerty
Message 1 of 14 in “Tidy up the constants related to ref_update::flags”
  1. 0/7 Tidy up the constants related to ref_update::flagsMichael Haggerty, Oct 28, 2017
  2. 2/7 prune_ref(): call `ref_transaction_add_update()` directlyMichael Haggerty, Oct 28, 2017
  3. 3/7 ref_transaction_update(): die on disallowed flagsMichael Haggerty, Oct 28, 2017
  4. 1/7 files_transaction_prepare(): don't leak flags to packed transactionMichael Haggerty, Oct 28, 2017
  5. Junio C HamanoOct 30, 2017
  6. Michael HaggertyNov 5, 2017
  7. Junio C HamanoNov 6, 2017
  8. 4/7 ref_transaction_add_update(): remove a checkMichael Haggerty, Oct 28, 2017
  9. 6/7 refs: rename constant `REF_NODEREF` to `REF_NO_DEREF`Michael Haggerty, Oct 28, 2017
  10. Junio C HamanoOct 30, 2017
  11. 5/7 refs: tidy up and adjust visibility of the `ref_update` flagsMichael Haggerty, Oct 28, 2017
  12. Martin ÅgrenNov 1, 2017
  13. Michael HaggertyNov 5, 2017
  14. 7/7 refs: rename constant `REF_ISPRUNING` to `REF_IS_PRUNING`Michael Haggerty, Oct 28, 2017

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.