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

[PATCH v7 5/6] refs: add create_only option to refs_update_symref

From
Bence Ferdinandy <bence@ferdinandy.com>
Date
Oct 12, 2024, 23:03 UTC
Message-ID
<20241012230428.3259229-5-bence@ferdinandy.com>
In-Reply-To
<20241012230428.3259229-1-bence@ferdinandy.com>

Allow the caller to specify that it only wants to update the symref if it does not already exist. Silently ignore the error from the transaction API if the symref already exists.

Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
---
Notes:
    v4: new patch
    v5: no change
    
    v6: - switched from bool to int for create_only
        - refactored logic in refs_update_symref with goto as layed out by
          Junio
    
    v7: - change commit prefix to be more in line with project standards
        - refactored code to accommodate changes in the first patch, but
          otherwise no change
 builtin/branch.c          |  2 +-
 builtin/checkout.c        |  5 +++--
 builtin/clone.c           |  8 +++++---
 builtin/notes.c           |  3 ++-
 builtin/remote.c          |  9 ++++++---
 builtin/symbolic-ref.c    |  2 +-
 builtin/worktree.c        |  2 +-
 refs.c                    | 30 ++++++++++++++++++++++--------
 refs.h                    |  2 +-
 reset.c                   |  2 +-
 sequencer.c               |  3 ++-
 setup.c                   |  3 ++-
 t/helper/test-ref-store.c |  2 +-
 13 files changed, 48 insertions(+), 25 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index 6c87690b58..2fcbcbfd59 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -559,7 +559,7 @@ static int replace_each_worktree_head_symref(struct worktree **worktrees,
 			continue;
 
 		refs = get_worktree_ref_store(worktrees[i]);
-		if (refs_update_symref(refs, "HEAD", newref, logmsg, NULL))
+		if (refs_update_symref(refs, "HEAD", newref, logmsg, NULL, 0))
 			ret = error(_("HEAD of working tree %s is not updated"),
 				    worktrees[i]->path);
 	}
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 356ee9bcde..9abb71dc07 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1015,7 +1015,8 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
 			describe_detached_head(_("HEAD is now at"), new_branch_info->commit);
 		}
 	} else if (new_branch_info->path) {	/* Switch branches. */
-		if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", new_branch_info->path, msg.buf, NULL) < 0)
+		if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", new_branch_info->path,
+					msg.buf, NULL, 0) < 0)
 			die(_("unable to update HEAD"));
 		if (!opts->quiet) {
 			if (old_branch_info->path && !strcmp(new_branch_info->path, old_branch_info->path)) {
@@ -1479,7 +1480,7 @@ static int switch_unborn_to_new_branch(const struct checkout_opts *opts)
 		die(_("You are on a branch yet to be born"));
 	strbuf_addf(&branch_ref, "refs/heads/%s", opts->new_branch);
 	status = refs_update_symref(get_main_ref_store(the_repository),
-				    "HEAD", branch_ref.buf, "checkout -b", NULL);
+				    "HEAD", branch_ref.buf, "checkout -b", NULL, 0);
 	strbuf_release(&branch_ref);
 	if (!opts->quiet)
 		fprintf(stderr, _("Switched to a new branch '%s'\n"),
diff --git a/builtin/clone.c b/builtin/clone.c
index ead2af20ea..87e8f1421a 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -661,7 +661,7 @@ static void update_remote_refs(const struct ref *refs,
 		strbuf_addstr(&head_ref, "HEAD");
 		if (refs_update_symref(get_main_ref_store(the_repository), head_ref.buf,
 				       remote_head_points_at->peer_ref->name,
-				       msg, NULL) < 0)
+				       msg, NULL, 0) < 0)
 			die(_("unable to update %s"), head_ref.buf);
 		strbuf_release(&head_ref);
 	}
@@ -673,7 +673,8 @@ static void update_head(const struct ref *our, const struct ref *remote,
 	const char *head;
 	if (our && skip_prefix(our->name, "refs/heads/", &head)) {
 		/* Local default branch link */
-		if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", our->name, NULL, NULL) < 0)
+		if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", our->name,
+					NULL, NULL, 0) < 0)
 			die(_("unable to update HEAD"));
 		if (!option_bare) {
 			refs_update_ref(get_main_ref_store(the_repository),
@@ -702,7 +703,8 @@ static void update_head(const struct ref *our, const struct ref *remote,
 		 * Unborn head from remote; same as "our" case above except
 		 * that we have no ref to update.
 		 */
-		if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", unborn, NULL, NULL) < 0)
+		if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", unborn,
+					NULL, NULL, 0) < 0)
 			die(_("unable to update HEAD"));
 		if (!option_bare)
 			install_branch_config(0, head, remote_name, unborn);
diff --git a/builtin/notes.c b/builtin/notes.c
index ba646f06ff..7b3138e3c3 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -980,7 +980,8 @@ static int merge(int argc, const char **argv, const char *prefix)
 			die(_("a notes merge into %s is already in-progress at %s"),
 			    notes_ref, wt->path);
 		free_worktrees(worktrees);
-		if (refs_update_symref(get_main_ref_store(the_repository), "NOTES_MERGE_REF", notes_ref, NULL, NULL))
+		if (refs_update_symref(get_main_ref_store(the_repository), "NOTES_MERGE_REF", notes_ref,
+					NULL, NULL, 0))
 			die(_("failed to store link to current notes ref (%s)"),
 			    notes_ref);
 		fprintf(stderr, _("Automatic notes merge failed. Fix conflicts in %s "
diff --git a/builtin/remote.c b/builtin/remote.c
index 2b6948439f..d60ec6e907 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -244,7 +244,8 @@ static int add(int argc, const char **argv, const char *prefix)
 		strbuf_reset(&buf2);
 		strbuf_addf(&buf2, "refs/remotes/%s/%s", name, master);
 
-		if (refs_update_symref(get_main_ref_store(the_repository), buf.buf, buf2.buf, "remote add", NULL))
+		if (refs_update_symref(get_main_ref_store(the_repository), buf.buf, buf2.buf,
+					"remote add", NULL, 0))
 			result = error(_("Could not setup master '%s'"), master);
 	}
 
@@ -864,7 +865,8 @@ static int mv(int argc, const char **argv, const char *prefix)
 		strbuf_reset(&buf3);
 		strbuf_addf(&buf3, "remote: renamed %s to %s",
 				item->string, buf.buf);
-		if (refs_update_symref(get_main_ref_store(the_repository), buf.buf, buf2.buf, buf3.buf, NULL))
+		if (refs_update_symref(get_main_ref_store(the_repository), buf.buf, buf2.buf,
+					buf3.buf, NULL, 0))
 			die(_("creating '%s' failed"), buf.buf);
 		display_progress(progress, ++refs_renamed_nr);
 	}
@@ -1470,7 +1472,8 @@ static int set_head(int argc, const char **argv, const char *prefix)
 		/* make sure it's valid */
 		if (!refs_ref_exists(refs, buf2.buf))
 			result |= error(_("Not a valid ref: %s"), buf2.buf);
-		else if (refs_update_symref(refs, buf.buf, buf2.buf, "remote set-head", &buf_prev))
+		else if (refs_update_symref(refs, buf.buf, buf2.buf,
+					"remote set-head", &buf_prev, 0))
 			result |= error(_("Could not setup %s"), buf.buf);
 		else if (opt_a) {
 			report_set_head_auto(argv[0], head_name, &buf_prev);
diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c
index 7728fbc3c1..cfbb53b30c 100644
--- a/builtin/symbolic-ref.c
+++ b/builtin/symbolic-ref.c
@@ -88,7 +88,7 @@ int cmd_symbolic_ref(int argc,
 		if (check_refname_format(argv[1], REFNAME_ALLOW_ONELEVEL) < 0)
 			die("Refusing to set '%s' to invalid ref '%s'", argv[0], argv[1]);
 		ret = !!refs_update_symref(get_main_ref_store(the_repository),
-					   argv[0], argv[1], msg, NULL);
+					   argv[0], argv[1], msg, NULL, 0);
 		break;
 	default:
 		usage_with_options(git_symbolic_ref_usage, options);
diff --git a/builtin/worktree.c b/builtin/worktree.c
index a7ab4193c1..2e95367235 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -517,7 +517,7 @@ static int add_worktree(const char *path, const char *refname,
 		ret = refs_update_ref(wt_refs, NULL, "HEAD", &commit->object.oid,
 				      NULL, 0, UPDATE_REFS_MSG_ON_ERR);
 	else
-		ret = refs_update_symref(wt_refs, "HEAD", symref.buf, NULL, NULL);
+		ret = refs_update_symref(wt_refs, "HEAD", symref.buf, NULL, NULL, 0);
 	if (ret)
 		goto done;
 
diff --git a/refs.c b/refs.c
index b964ac44d0..29c020e78e 100644
--- a/refs.c
+++ b/refs.c
@@ -2115,26 +2115,40 @@ int peel_iterated_oid(struct repository *r, const struct object_id *base, struct
 
 int refs_update_symref(struct ref_store *refs, const char *ref,
 		       const char *target, const char *logmsg,
-		       struct strbuf *referent)
+		       struct strbuf *referent, int create_only)
 {
 	struct ref_transaction *transaction;
 	struct strbuf err = STRBUF_INIT;
-	int ret = 0;
+	int ret = 0, prepret = 0;
 
 	transaction = ref_store_transaction_begin(refs, &err);
-	if (!transaction ||
-		ref_transaction_update(transaction, ref, NULL, NULL,
-				   target, NULL, REF_NO_DEREF,
-				   logmsg, &err) ||
-		ref_transaction_prepare(transaction, &err)) {
+	if (!transaction) {
+	error_return:
 		ret = error("%s", err.buf);
 		goto cleanup;
 	}
+	if (create_only) {
+		if (ref_transaction_create(transaction, ref, NULL, target,
+					   REF_NO_DEREF, logmsg, &err))
+			goto error_return;
+		prepret = ref_transaction_prepare(transaction, &err);
+		if (prepret && prepret != TRANSACTION_CREATE_EXISTS)
+			goto error_return;
+	} else {
+		if (ref_transaction_update(transaction, ref, NULL, NULL,
+					   target, NULL, REF_NO_DEREF,
+					   logmsg, &err) ||
+			ref_transaction_prepare(transaction, &err))
+			goto error_return;
+	}
+
 	if (referent)
 		refs_read_symbolic_ref(refs, ref, referent);
 
+	if (prepret == TRANSACTION_CREATE_EXISTS)
+		goto cleanup;
 	if (ref_transaction_commit(transaction, &err))
-		ret = error("%s", err.buf);
+		goto error_return;
 
 cleanup:
 	strbuf_release(&err);
diff --git a/refs.h b/refs.h
index c83b1ec76e..41ae384f11 100644
--- a/refs.h
+++ b/refs.h
@@ -572,7 +572,7 @@ int refs_copy_existing_ref(struct ref_store *refs, const char *oldref,
 
 int refs_update_symref(struct ref_store *refs, const char *refname,
 		       const char *target, const char *logmsg,
-		       struct strbuf *referent);
+		       struct strbuf *referent, int create_only);
 
 enum action_on_err {
 	UPDATE_REFS_MSG_ON_ERR,
diff --git a/reset.c b/reset.c
index cc36a9ed56..919fb84f5f 100644
--- a/reset.c
+++ b/reset.c
@@ -76,7 +76,7 @@ static int update_refs(const struct reset_head_opts *opts,
 		if (!ret)
 			ret = refs_update_symref(get_main_ref_store(the_repository),
 						 "HEAD", switch_to_branch,
-						 reflog_head, NULL);
+						 reflog_head, NULL, 0);
 	}
 	if (!ret && run_hook)
 		run_hooks_l(the_repository, "post-checkout",
diff --git a/sequencer.c b/sequencer.c
index 23b162924c..103d0ddfb2 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -5107,7 +5107,8 @@ static int pick_commits(struct repository *r,
 			}
 			msg = reflog_message(opts, "finish", "returning to %s",
 				head_ref.buf);
-			if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", head_ref.buf, msg, NULL)) {
+			if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", head_ref.buf,
+						msg, NULL, 0)) {
 				res = error(_("could not update HEAD to %s"),
 					head_ref.buf);
 				goto cleanup_head_ref;
diff --git a/setup.c b/setup.c
index d95f051465..9bbc655ee4 100644
--- a/setup.c
+++ b/setup.c
@@ -2275,7 +2275,8 @@ void create_reference_database(enum ref_storage_format ref_storage_format,
 			die(_("invalid initial branch name: '%s'"),
 			    initial_branch);
 
-		if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", ref, NULL, NULL) < 0)
+		if (refs_update_symref(get_main_ref_store(the_repository), "HEAD", ref,
+					NULL, NULL, 0) < 0)
 			exit(1);
 		free(ref);
 	}
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c
index a911302bea..f72b029e51 100644
--- a/t/helper/test-ref-store.c
+++ b/t/helper/test-ref-store.c
@@ -120,7 +120,7 @@ static int cmd_create_symref(struct ref_store *refs, const char **argv)
 	const char *target = notnull(*argv++, "target");
 	const char *logmsg = *argv++;
 
-	return refs_update_symref(refs, refname, target, logmsg, NULL);
+	return refs_update_symref(refs, refname, target, logmsg, NULL, 0);
 }
 
 static struct flag_definition transaction_flags[] = {
-- 
2.47.0.7.g072c39eddb.dirty
Previous: Bence FerdinandyNext: Bence Ferdinandy
Message 57 of 258 in “set remote/HEAD with fetch”
  1. 0/2 set remote/HEAD with fetchBence Ferdinandy, Sep 10, 2024
  2. 1/2 fetch: set-head with --set-head optionBence Ferdinandy, Sep 10, 2024
  3. Junio C HamanoSep 10, 2024
  4. Bence FerdinandySep 11, 2024
  5. Junio C HamanoSep 11, 2024
  6. 0/2 fetch: set remote/HEAD if missingBence Ferdinandy, Sep 19, 2024
  7. 2/2 fetch: set remote/HEAD if it does not existBence Ferdinandy, Sep 19, 2024
  8. Junio C HamanoSep 19, 2024
  9. Bence FerdinandySep 20, 2024
  10. 1/2 update_symref: add REF_CREATE_ONLY optionBence Ferdinandy, Sep 19, 2024
  11. Junio C HamanoSep 19, 2024
  12. Bence FerdinandySep 20, 2024
  13. Phillip WoodSep 21, 2024
  14. Bence FerdinandySep 21, 2024
  15. Junio C HamanoSep 22, 2024
  16. Bence FerdinandySep 29, 2024
  17. Patrick SteinhardtSep 30, 2024
  18. Bence FerdinandySep 30, 2024
  19. 0/5 improve handling of remote/HEADBence Ferdinandy, Sep 30, 2024
  20. 1/5 refs_update_symref: atomically record overwritten refBence Ferdinandy, Sep 30, 2024
  21. Junio C HamanoOct 1, 2024
  22. 2/5 set-head: better output for --autoBence Ferdinandy, Sep 30, 2024
  23. Junio C HamanoOct 1, 2024
  24. 5/5 fetch: set remote/HEAD if it does not existBence Ferdinandy, Sep 30, 2024
  25. 3/5 transaction: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Sep 30, 2024
  26. 4/5 refs_update_symref: add create_only optionBence Ferdinandy, Sep 30, 2024
  27. Junio C HamanoOct 3, 2024
  28. Bence FerdinandyOct 3, 2024
  29. 1/6 refs_update_symref: atomically record overwritten refBence Ferdinandy, Oct 9, 2024
  30. 5/6 refs_update_symref: add create_only optionBence Ferdinandy, Oct 9, 2024
  31. Junio C HamanoOct 9, 2024
  32. 6/6 fetch: set remote/HEAD if it does not existBence Ferdinandy, Oct 9, 2024
  33. Junio C HamanoOct 9, 2024
  34. 1/6 refs_update_symref: atomically record overwritten refBence Ferdinandy, Oct 10, 2024
  35. 2/6 set-head: add new variable for readabilityBence Ferdinandy, Oct 10, 2024
  36. 4/6 transaction: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Oct 10, 2024
  37. karthik nayakOct 10, 2024
  38. Junio C HamanoOct 11, 2024
  39. 3/6 set-head: better output for --autoBence Ferdinandy, Oct 10, 2024
  40. karthik nayakOct 10, 2024
  41. Bence FerdinandyOct 11, 2024
  42. Junio C HamanoOct 11, 2024
  43. karthik nayakOct 11, 2024
  44. Bence FerdinandyOct 12, 2024
  45. karthik nayakOct 15, 2024
  46. Phillip WoodOct 15, 2024
  47. Bence FerdinandyOct 15, 2024
  48. 6/6 fetch: set remote/HEAD if it does not existBence Ferdinandy, Oct 10, 2024
  49. 5/6 refs_update_symref: add create_only optionBence Ferdinandy, Oct 10, 2024
  50. 1/6 refs: atomically record overwritten ref in update_symrefBence Ferdinandy, Oct 12, 2024
  51. 2/6 remote set-head: add new variable for readabilityBence Ferdinandy, Oct 12, 2024
  52. 4/6 refs: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Oct 12, 2024
  53. Phillip WoodOct 13, 2024
  54. Bence FerdinandyOct 13, 2024
  55. Phillip WoodOct 14, 2024
  56. 3/6 remote set-head: better output for --autoBence Ferdinandy, Oct 12, 2024
  57. 5/6 refs: add create_only option to refs_update_symrefBence Ferdinandy, Oct 12, 2024
  58. 6/6 fetch: set remote/HEAD if it does not existBence Ferdinandy, Oct 12, 2024
  59. Phillip WoodOct 13, 2024
  60. Bence FerdinandyOct 13, 2024
  61. Phillip WoodOct 15, 2024
  62. Bence FerdinandyOct 15, 2024
  63. Bence FerdinandyOct 19, 2024
  64. 0/6 set-head/fetch remote/HEAD updates, small change from v7Bence Ferdinandy, Oct 14, 2024
  65. 1/6 refs: atomically record overwritten ref in update_symrefBence Ferdinandy, Oct 14, 2024
  66. karthik nayakOct 15, 2024
  67. Bence FerdinandyOct 15, 2024
  68. 2/6 remote set-head: add new variable for readabilityBence Ferdinandy, Oct 14, 2024
  69. 4/6 refs: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Oct 14, 2024
  70. 5/6 refs: add create_only option to refs_update_symrefBence Ferdinandy, Oct 14, 2024
  71. 6/6 fetch: set remote/HEAD if it does not existBence Ferdinandy, Oct 14, 2024
  72. 3/6 remote set-head: better output for --autoBence Ferdinandy, Oct 14, 2024
  73. karthik nayakOct 15, 2024
  74. Bence FerdinandyOct 15, 2024
  75. Taylor BlauOct 16, 2024
  76. Bence FerdinandyOct 16, 2024
  77. Taylor BlauOct 16, 2024
  78. Bence FerdinandyOct 17, 2024
  79. 0/7 set-head/fetch remote/HEAD updatesBence Ferdinandy, Oct 19, 2024
  80. 1/7 t/t5505-remote: set default branch to mainBence Ferdinandy, Oct 19, 2024
  81. 2/7 refs: atomically record overwritten ref in update_symrefBence Ferdinandy, Oct 19, 2024
  82. 3/7 remote set-head: refactor for readabilityBence Ferdinandy, Oct 19, 2024
  83. 5/7 refs: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Oct 19, 2024
  84. 4/7 remote set-head: better output for --autoBence Ferdinandy, Oct 19, 2024
  85. 6/7 refs: add create_only option to refs_update_symref_extendedBence Ferdinandy, Oct 19, 2024
  86. 7/7 fetch: set remote/HEAD if it does not existBence Ferdinandy, Oct 19, 2024
  87. Bence FerdinandyOct 21, 2024
  88. 0/8 set-head/fetch remote/HEAD updatesBence Ferdinandy, Oct 22, 2024
  89. 1/8 t/t5505-remote: set default branch to mainBence Ferdinandy, Oct 22, 2024
  90. Kristoffer HaugsbakkOct 22, 2024
  91. Bence FerdinandyOct 22, 2024
  92. Taylor BlauOct 23, 2024
  93. Bence FerdinandyOct 23, 2024
  94. Taylor BlauOct 23, 2024
  95. 2/8 refs: atomically record overwritten ref in update_symrefBence Ferdinandy, Oct 22, 2024
  96. 4/8 remote set-head: better output for --autoBence Ferdinandy, Oct 22, 2024
  97. 5/8 refs: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Oct 22, 2024
  98. 6/8 refs: add create_only option to refs_update_symref_extendedBence Ferdinandy, Oct 22, 2024
  99. 7/8 fetch: set remote/HEAD if it does not existBence Ferdinandy, Oct 22, 2024
  100. 8/8 fetch set_head: handle mirrored bare repositoriesBence Ferdinandy, Oct 22, 2024
  101. 3/8 remote set-head: refactor for readabilityBence Ferdinandy, Oct 22, 2024
  102. 0/8 set-head/fetch remote/HEAD updatesBence Ferdinandy, Oct 23, 2024
  103. 1/8 t/t5505-remote: set default branch to mainBence Ferdinandy, Oct 23, 2024
  104. Junio C HamanoNov 15, 2024
  105. Bence FerdinandyNov 15, 2024
  106. 2/8 refs: atomically record overwritten ref in update_symrefBence Ferdinandy, Oct 23, 2024
  107. Junio C HamanoNov 15, 2024
  108. Bence FerdinandyNov 15, 2024
  109. Bence FerdinandyNov 15, 2024
  110. Junio C HamanoNov 16, 2024
  111. Bence FerdinandyNov 17, 2024
  112. Junio C HamanoNov 18, 2024
  113. Patrick SteinhardtNov 18, 2024
  114. Bence FerdinandyNov 18, 2024
  115. Patrick SteinhardtNov 18, 2024
  116. Bence FerdinandyNov 18, 2024
  117. 3/8 remote set-head: refactor for readabilityBence Ferdinandy, Oct 23, 2024
  118. Junio C HamanoNov 15, 2024
  119. 4/8 remote set-head: better output for --autoBence Ferdinandy, Oct 23, 2024
  120. Junio C HamanoNov 15, 2024
  121. Bence FerdinandyNov 15, 2024
  122. Bence FerdinandyNov 15, 2024
  123. Junio C HamanoNov 16, 2024
  124. Junio C HamanoNov 16, 2024
  125. Bence FerdinandyNov 16, 2024
  126. 5/8 refs: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Oct 23, 2024
  127. 6/8 refs: add create_only option to refs_update_symref_extendedBence Ferdinandy, Oct 23, 2024
  128. 8/8 fetch set_head: handle mirrored bare repositoriesBence Ferdinandy, Oct 23, 2024
  129. 7/8 fetch: set remote/HEAD if it does not existBence Ferdinandy, Oct 23, 2024
  130. Kristoffer HaugsbakkOct 23, 2024
  131. Bence FerdinandyOct 23, 2024
  132. Bence FerdinandyNov 14, 2024
  133. 0/9 set-head/fetch remote/HEAD updatesBence Ferdinandy, Nov 18, 2024
  134. 1/9 t/t5505-remote: set default branch to mainBence Ferdinandy, Nov 18, 2024
  135. Junio C HamanoNov 20, 2024
  136. 3/9 refs: atomically record overwritten ref in update_symrefBence Ferdinandy, Nov 18, 2024
  137. 2/9 refs: standardize output of refs_read_symbolic_refBence Ferdinandy, Nov 18, 2024
  138. Junio C HamanoNov 19, 2024
  139. Patrick SteinhardtNov 19, 2024
  140. Junio C HamanoNov 19, 2024
  141. Patrick SteinhardtNov 19, 2024
  142. Bence FerdinandyNov 19, 2024
  143. Junio C HamanoNov 19, 2024
  144. Bence FerdinandyNov 19, 2024
  145. Patrick SteinhardtNov 19, 2024
  146. Bence FerdinandyNov 19, 2024
  147. 5/9 remote set-head: better output for --autoBence Ferdinandy, Nov 18, 2024
  148. Junio C HamanoNov 19, 2024
  149. Bence FerdinandyNov 19, 2024
  150. Junio C HamanoNov 19, 2024
  151. Bence FerdinandyNov 19, 2024
  152. Bence FerdinandyNov 20, 2024
  153. Junio C HamanoNov 20, 2024
  154. 4/9 remote set-head: refactor for readabilityBence Ferdinandy, Nov 18, 2024
  155. 6/9 refs: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Nov 18, 2024
  156. 7/9 refs: add create_only option to refs_update_symref_extendedBence Ferdinandy, Nov 18, 2024
  157. Junio C HamanoNov 19, 2024
  158. 9/9 fetch set_head: handle mirrored bare repositoriesBence Ferdinandy, Nov 18, 2024
  159. 8/9 fetch: set remote/HEAD if it does not existBence Ferdinandy, Nov 18, 2024
  160. Junio C HamanoNov 19, 2024
  161. Bence FerdinandyNov 19, 2024
  162. Junio C HamanoNov 20, 2024
  163. Junio C HamanoNov 20, 2024
  164. Bence FerdinandyNov 20, 2024
  165. 00/10 set-head/fetch remote/HEAD updatesBence Ferdinandy, Nov 21, 2024
  166. 01/10 t/t5505-remote: set default branch to mainBence Ferdinandy, Nov 21, 2024
  167. 03/10 refs: standardize output of refs_read_symbolic_refBence Ferdinandy, Nov 21, 2024
  168. karthik nayakNov 22, 2024
  169. Bence FerdinandyNov 22, 2024
  170. Bence FerdinandyNov 22, 2024
  171. karthik nayakNov 22, 2024
  172. Bence FerdinandyNov 22, 2024
  173. Junio C HamanoNov 25, 2024
  174. Bence FerdinandyNov 26, 2024
  175. karthik nayakNov 26, 2024
  176. Junio C HamanoNov 26, 2024
  177. Bence FerdinandyNov 26, 2024
  178. Junio C HamanoNov 26, 2024
  179. Bence FerdinandyNov 26, 2024
  180. Bence FerdinandyNov 22, 2024
  181. 02/10 t/t5505-remote: test failure of set-headBence Ferdinandy, Nov 21, 2024
  182. Junio C HamanoNov 22, 2024
  183. 04/10 refs: atomically record overwritten ref in update_symrefBence Ferdinandy, Nov 21, 2024
  184. 05/10 remote set-head: refactor for readabilityBence Ferdinandy, Nov 21, 2024
  185. 07/10 refs: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Nov 21, 2024
  186. 08/10 refs: add create_only option to refs_update_symref_extendedBence Ferdinandy, Nov 21, 2024
  187. 06/10 remote set-head: better output for --autoBence Ferdinandy, Nov 21, 2024
  188. 10/10 fetch set_head: handle mirrored bare repositoriesBence Ferdinandy, Nov 21, 2024
  189. 09/10 fetch: set remote/HEAD if it does not existBence Ferdinandy, Nov 21, 2024
  190. 00/10 set-head/fetch remote/HEAD updatesBence Ferdinandy, Nov 22, 2024
  191. 01/10 t/t5505-remote: set default branch to mainBence Ferdinandy, Nov 22, 2024
  192. 03/10 refs: standardize output of refs_read_symbolic_refBence Ferdinandy, Nov 22, 2024
  193. 02/10 t/t5505-remote: test failure of set-headBence Ferdinandy, Nov 22, 2024
  194. 04/10 refs: atomically record overwritten ref in update_symrefBence Ferdinandy, Nov 22, 2024
  195. 05/10 remote set-head: refactor for readabilityBence Ferdinandy, Nov 22, 2024
  196. 07/10 refs: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Nov 22, 2024
  197. 06/10 remote set-head: better output for --autoBence Ferdinandy, Nov 22, 2024
  198. 08/10 refs: add create_only option to refs_update_symref_extendedBence Ferdinandy, Nov 22, 2024
  199. 10/10 fetch set_head: handle mirrored bare repositoriesBence Ferdinandy, Nov 22, 2024
  200. 09/10 fetch: set remote/HEAD if it does not existBence Ferdinandy, Nov 22, 2024
  201. Josh SteadmonDec 5, 2024
  202. Josh SteadmonDec 5, 2024
  203. Bence FerdinandyDec 5, 2024
  204. Josh SteadmonDec 5, 2024
  205. Fix `git fetch --tags` in repo with no configured remoteJosh Steadmon, Dec 5, 2024
  206. Junio C HamanoDec 6, 2024
  207. Junio C HamanoDec 6, 2024
  208. Junio C HamanoDec 6, 2024
  209. Re* [PATCH] Fix `git fetch --tags` in repo with no configured remoteJunio C Hamano, Dec 6, 2024
  210. Re* [PATCH] Fix `git fetch --tags` in repo with no configured remoteJunio C Hamano, Dec 6, 2024
  211. Bence FerdinandyDec 6, 2024
  212. Junio C HamanoDec 6, 2024
  213. Bence FerdinandyDec 5, 2024
  214. fetch: add configuration for set_head behaviourBence Ferdinandy, Nov 27, 2024
  215. Junio C HamanoNov 27, 2024
  216. Bence FerdinandyNov 27, 2024
  217. Junio C HamanoNov 28, 2024
  218. Bence FerdinandyNov 28, 2024
  219. Junio C HamanoNov 28, 2024
  220. 0/2 set_head finishing touchesBence Ferdinandy, Dec 3, 2024
  221. 1/2 fetch set_head: add warn-if-not-$branch optionBence Ferdinandy, Dec 3, 2024
  222. Junio C HamanoDec 4, 2024
  223. Bence FerdinandyDec 4, 2024
  224. 2/2 remote set-head: set followRemoteHEAD to "warn" if "always"Bence Ferdinandy, Dec 3, 2024
  225. Junio C HamanoDec 4, 2024
  226. 1/3 fetch set_head: move warn advice into advise_if_enabledBence Ferdinandy, Dec 4, 2024
  227. 2/3 fetch set_head: add warn-if-not-$branch optionBence Ferdinandy, Dec 4, 2024
  228. 3/3 remote set-head: set followRemoteHEAD to "warn" if "always"Bence Ferdinandy, Dec 4, 2024
  229. Kristoffer HaugsbakkDec 4, 2024
  230. Junio C HamanoDec 4, 2024
  231. Kristoffer HaugsbakkDec 4, 2024
  232. Bence FerdinandyDec 5, 2024
  233. 1/3 fetch set_head: move warn advice into advise_if_enabledBence Ferdinandy, Dec 5, 2024
  234. 2/3 fetch set_head: add warn-if-not-$branch optionBence Ferdinandy, Dec 5, 2024
  235. 2/3 fetch set_head: add warn-if-not-$branch optionTeng Long, Jan 5, 2025
  236. Bence FerdinandyJan 5, 2025
  237. fetch: fix erroneous set_head advice messageBence Ferdinandy, Jan 5, 2025
  238. Junio C HamanoJan 6, 2025
  239. 3/3 remote set-head: set followRemoteHEAD to "warn" if "always"Bence Ferdinandy, Dec 5, 2024
  240. Junio C HamanoDec 4, 2024
  241. fetch: add configuration for set_head behaviourBence Ferdinandy, Nov 28, 2024
  242. fetch: add configuration for set_head behaviourBence Ferdinandy, Nov 28, 2024
  243. Junio C HamanoDec 2, 2024
  244. fetch: add configuration for set_head behaviourBence Ferdinandy, Nov 28, 2024
  245. 2/6 set-head: add new variable for readabilityBence Ferdinandy, Oct 9, 2024
  246. Junio C HamanoOct 9, 2024
  247. Bence FerdinandyOct 9, 2024
  248. 4/6 transaction: add TRANSACTION_CREATE_EXISTS errorBence Ferdinandy, Oct 9, 2024
  249. Junio C HamanoOct 9, 2024
  250. 3/6 set-head: better output for --autoBence Ferdinandy, Oct 9, 2024
  251. Junio C HamanoOct 9, 2024
  252. Junio C HamanoOct 10, 2024
  253. Ramsay JonesOct 10, 2024
  254. Bence FerdinandyOct 10, 2024
  255. 2/2 set-head: do not update if there is no changeBence Ferdinandy, Sep 10, 2024
  256. Junio C HamanoSep 10, 2024
  257. Bence FerdinandySep 11, 2024
  258. Junio C HamanoSep 11, 2024

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.