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

Re: What's cooking in git.git (Nov 2015, #04; Tue, 24)

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 28, 2015, 17:09 UTC
Message-ID
<20151128170932.GC15706@vauxhall.crustytoothpaste.net>
In-Reply-To
<20151128163543.GA26759@sigill.intra.peff.net>
On Sat, Nov 28, 2015 at 11:35:43AM -0500, Jeff King wrote:
Show 15 quoted lines
> On Sat, Nov 28, 2015 at 03:40:10PM +0000, brian m. carlson wrote:
> 
> > On Tue, Nov 24, 2015 at 08:07:23PM -0500, Jeff King wrote:
> > > What's cooking in git.git (Nov 2015, #04; Tue, 24)
> > > --------------------------------------------------
> > > [New Topics]
> > 
> > I noticed the object_id series was missing from this list.  Was there
> > something that needed fixing or a reroll?
> 
> Thanks for bringing this up; I meant to send a note but forgot.
> 
> I got a bunch of conflicts trying to merge it into 'next' and 'pu' and
> punted on it. I think the tricky bits are coming from
> dt/refs-backend-pre-vtable, where there was a lot of code movement.

I think as for merging into the latest pu, the thing you want to do in refs.c is simply take what pu has. You'll have to fix up one additional struct object call site. The same thing goes for builtin/merge.c and builtin/branch.c, where the code I changed has since been eliminated.

I also noticed that merge-recursive.c and builtin/ff-refs.c needed some minor fixups as well, but a quick compile will show you where those are. I've included a diff for those two below.

-----%<-----
diff --git a/builtin/ff-refs.c b/builtin/ff-refs.c
index ae68cfbc..c9d37092 100644
--- a/builtin/ff-refs.c
+++ b/builtin/ff-refs.c
@@ -84,19 +84,19 @@ static void do_ref_update(struct ff_ref_data *data, struct ff_ref_details *detai
 		set_git_dir(details->wt->git_dir);
 		read_index(&the_index);
 
-		if (checkout_fast_forward(details->branch_commit->object.sha1,
-				details->upstream_commit->object.sha1, 1))
+		if (checkout_fast_forward(details->branch_commit->object.oid.hash,
+				details->upstream_commit->object.oid.hash, 1))
 			details->result_type = NON_FAST_FORWARD;
-		else if (update_ref("ff-refs", refname, details->upstream_commit->object.sha1,
-				details->branch_commit->object.sha1, 0, UPDATE_REFS_QUIET_ON_ERR)) {
+		else if (update_ref("ff-refs", refname, details->upstream_commit->object.oid.hash,
+				details->branch_commit->object.oid.hash, 0, UPDATE_REFS_QUIET_ON_ERR)) {
 			details->result_type = UNABLE_TO_UPDATE;
 			run_hook_le(NULL, "post-merge", "0", NULL);
 		}
 		discard_index(&the_index);
 		chdir(path.buf);
 		strbuf_release(&path);
-	} else if (update_ref("ff-refs", refname, details->upstream_commit->object.sha1,
-			details->branch_commit->object.sha1, 0, UPDATE_REFS_QUIET_ON_ERR))
+	} else if (update_ref("ff-refs", refname, details->upstream_commit->object.oid.hash,
+			details->branch_commit->object.oid.hash, 0, UPDATE_REFS_QUIET_ON_ERR))
 		details->result_type = UNABLE_TO_UPDATE;
 }
 
@@ -207,7 +207,7 @@ static int analize_refs(const char *refname,
 					details->upstream_commit);
 			details->merge_base = bases->item;
 
-			if (!hashcmp(upstream_hash, details->merge_base->object.sha1))
+			if (!hashcmp(upstream_hash, details->merge_base->object.oid.hash))
 				details->result_type = UP_TO_DATE;
 
 			else if (!in_merge_bases(details->branch_commit, details->upstream_commit))
diff --git a/merge-recursive.c b/merge-recursive.c
index 09d99640..50a16ebf 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1835,8 +1835,8 @@ int merge_trees(struct merge_options *o,
 	if (code != 0) {
 		if (o->gently)
 			return error(_("merging of trees %s and %s failed"),
-			    sha1_to_hex(head->object.sha1),
-			    sha1_to_hex(merge->object.sha1));
+			    oid_to_hex(&head->object.oid),
+			    oid_to_hex(&merge->object.oid));
 
 		if (show(o, 4) || o->call_depth)
 			die(_("merging of trees %s and %s failed"),
-----%<-----
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Jeff KingNext: Jeff King
Message 6 of 7 in “What's cooking in git.git (Nov 2015, #04; Tue, 24)”
  1. Jeff KingNov 25, 2015
  2. John KeepingNov 25, 2015
  3. Jeff KingNov 25, 2015
  4. brian m. carlsonNov 28, 2015
  5. Jeff KingNov 28, 2015
  6. brian m. carlsonNov 28, 2015
  7. Jeff KingDec 1, 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.