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

[PATCH 37/43] refs: move some defines from refs-be-files.c to refs.h

From
David Turner <dturner@twopensource.com>
Date
Sep 3, 2015, 01:55 UTC
Message-ID
<1441245313-11907-38-git-send-email-dturner@twopensource.com>
In-Reply-To
<1441245313-11907-1-git-send-email-dturner@twopensource.com>
This allows them to be used by other ref backends.
Signed-off-by: David Turner <dturner@twopensource.com>
---
 refs-be-files.c | 24 ------------------------
 refs.h          | 24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/refs-be-files.c b/refs-be-files.c
index 71c39ca..ec7ec8d 100644
--- a/refs-be-files.c
+++ b/refs-be-files.c
@@ -14,30 +14,6 @@ struct ref_lock {
 };
 
 /*
- * Flag passed to lock_ref_sha1_basic() telling it to tolerate broken
- * refs (i.e., because the reference is about to be deleted anyway).
- */
-#define REF_DELETING	0x02
-
-/*
- * Used as a flag in ref_update::flags when a loose ref is being
- * pruned.
- */
-#define REF_ISPRUNING	0x04
-
-/*
- * Used as a flag in ref_update::flags when the reference should be
- * updated to new_sha1.
- */
-#define REF_HAVE_NEW	0x08
-
-/*
- * Used as a flag in ref_update::flags when old_sha1 should be
- * checked.
- */
-#define REF_HAVE_OLD	0x10
-
-/*
  * Used as a flag in ref_update::flags when the lockfile needs to be
  * committed.
  */
diff --git a/refs.h b/refs.h
index fd461e9..e5ef8a3 100644
--- a/refs.h
+++ b/refs.h
@@ -193,6 +193,30 @@ struct ref_transaction {
 #define DO_FOR_EACH_PER_WORKTREE_ONLY 0x02
 
 /*
+ * Flag passed to lock_ref_sha1_basic() telling it to tolerate broken
+ * refs (i.e., because the reference is about to be deleted anyway).
+ */
+#define REF_DELETING	0x02
+
+/*
+ * Used as a flag in ref_update::flags when a loose ref is being
+ * pruned.
+ */
+#define REF_ISPRUNING	0x04
+
+/*
+ * Used as a flag in ref_update::flags when the reference should be
+ * updated to new_sha1.
+ */
+#define REF_HAVE_NEW	0x08
+
+/*
+ * Used as a flag in ref_update::flags when old_sha1 should be
+ * checked.
+ */
+#define REF_HAVE_OLD	0x10
+
+/*
  * The signature for the callback function for the for_each_*()
  * functions below.  The memory pointed to by the refname and sha1
  * arguments is only guaranteed to be valid for the duration of a
-- 
2.0.4.315.gad8727a-twtrsrc
Previous: David TurnerNext: David Turner
Message 43 of 54 in “refs lmdb backend”
  1. 00/43 refs lmdb backendDavid Turner, Sep 3, 2015
  2. 01/43 refs.c: create a public version of verify_refname_availableDavid Turner, Sep 3, 2015
  3. Junio C HamanoSep 3, 2015
  4. David TurnerSep 4, 2015
  5. 02/43 refs: make repack_without_refs and is_branch publicDavid Turner, Sep 3, 2015
  6. 04/43 refs.c: add a new refs.c file to hold all common refs codeDavid Turner, Sep 3, 2015
  7. 05/43 refs.c: move update_ref to refs.cDavid Turner, Sep 3, 2015
  8. 06/43 refs.c: move delete_ref and delete_refs to the common codeDavid Turner, Sep 3, 2015
  9. 07/43 refs.c: move read_ref_at to the common refs fileDavid Turner, Sep 3, 2015
  10. 08/43 refs.c: move the hidden refs functions to the common codeDavid Turner, Sep 3, 2015
  11. 09/43 refs.c: move dwim and friend functions to the common refs codeDavid Turner, Sep 3, 2015
  12. 10/43 refs.c: move warn_if_dangling_symref* to the common codeDavid Turner, Sep 3, 2015
  13. 11/43 refs.c: move read_ref, read_ref_full and ref_exists to the common codeDavid Turner, Sep 3, 2015
  14. 12/43 refs.c: move resolve_refdup to commonDavid Turner, Sep 3, 2015
  15. 13/43 refs.c: move check_refname_format to the common codeDavid Turner, Sep 3, 2015
  16. 14/43 refs.c: move is_branch to the common codeDavid Turner, Sep 3, 2015
  17. 15/43 refs.c: move prettify_refname to the common codeDavid Turner, Sep 3, 2015
  18. 16/43 refs.c: move ref iterators to the common codeDavid Turner, Sep 3, 2015
  19. 17/43 refs.c: move head_ref_namespaced to the common codeDavid Turner, Sep 3, 2015
  20. 18/43 refs-be-files.c: add a backend method structure with transaction functionsDavid Turner, Sep 3, 2015
  21. 19/43 refs-be-files.c: add methods for misc ref operationsDavid Turner, Sep 3, 2015
  22. 20/43 refs-be-files.c: add methods for the ref iteratorsDavid Turner, Sep 3, 2015
  23. Junio C HamanoSep 25, 2015
  24. David TurnerSep 25, 2015
  25. Junio C HamanoSep 25, 2015
  26. 21/43 refs-be-files.c: add method for for_each_reftype_...David Turner, Sep 3, 2015
  27. 22/43 refs-be-files.c: add do_for_each_per_worktree_refDavid Turner, Sep 3, 2015
  28. 23/43 refs.c: move refname_is_safe to the common codeDavid Turner, Sep 3, 2015
  29. 24/43 refs.h: document make refname_is_safe and add it to headerDavid Turner, Sep 3, 2015
  30. David TurnerSep 3, 2015
  31. 25/43 refs.c: move copy_msg to the common codeDavid Turner, Sep 3, 2015
  32. 26/43 refs.c: move peel_object to the common codeDavid Turner, Sep 3, 2015
  33. 27/43 refs.c: move should_autocreate_reflog to common codeDavid Turner, Sep 3, 2015
  34. 28/43 refs.c: add ref backend init functionDavid Turner, Sep 3, 2015
  35. 29/43 refs.c: add methods for reflogDavid Turner, Sep 3, 2015
  36. 30/43 refs.c: add method for initial ref transaction commitDavid Turner, Sep 3, 2015
  37. 31/43 initdb: move safe_create_dir into common codeDavid Turner, Sep 3, 2015
  38. 32/43 refs.c: add method for initializing refs dbDavid Turner, Sep 3, 2015
  39. 33/43 refs.c: make struct ref_transaction genericDavid Turner, Sep 3, 2015
  40. 34/43 refs-be-files.c: add method to rename refsDavid Turner, Sep 3, 2015
  41. 35/43 refs-be-files.c: add method to expire reflogsDavid Turner, Sep 3, 2015
  42. 36/43 run-command: track total number of commands runDavid Turner, Sep 3, 2015
  43. 37/43 refs: move some defines from refs-be-files.c to refs.hDavid Turner, Sep 3, 2015
  44. 38/43 refs: make some files backend functions publicDavid Turner, Sep 3, 2015
  45. 39/43 refs: break out a ref conflict checkDavid Turner, Sep 3, 2015
  46. 40/43 refs: allow ref backend to be set for cloneDavid Turner, Sep 3, 2015
  47. 41/43 refs: add register_refs_backendDavid Turner, Sep 3, 2015
  48. 42/43 refs: add LMDB refs backendDavid Turner, Sep 3, 2015
  49. Junio C HamanoSep 3, 2015
  50. 43/43 refs: tests for db backendDavid Turner, Sep 3, 2015
  51. Junio C HamanoSep 3, 2015
  52. David TurnerSep 4, 2015
  53. David TurnerSep 17, 2015
  54. Junio C HamanoSep 17, 2015

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.