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

Re: [PATCH] xdiff-interface: stop using the_repository

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 9, 2026, 09:48 UTC
Message-ID
<aYmtab_uqMZBygAG@pks.im>
In-Reply-To
<f58fa33d-b015-4339-819a-9d91be60cd0c@web.de>
On Sun, Feb 08, 2026 at 02:47:40PM +0100, René Scharfe wrote:
Show 12 quoted lines
> diff --git a/xdiff-interface.c b/xdiff-interface.c
> index 1a35556380..cd7493730b 100644
> --- a/xdiff-interface.c
> +++ b/xdiff-interface.c
> @@ -7,6 +6,7 @@
>  #include "config.h"
>  #include "hex.h"
>  #include "odb.h"
> +#include "repository.h"
>  #include "strbuf.h"
>  #include "xdiff-interface.h"
>  #include "xdiff/xtypes.h"

It's a bit surprising that we have to add this include, but I assume that we use a function that's declared in this file?

Show 17 quoted lines
> @@ -177,18 +177,19 @@ int read_mmfile(mmfile_t *ptr, const char *filename)
>  	return 0;
>  }
>  
> -void read_mmblob(mmfile_t *ptr, const struct object_id *oid)
> +void read_mmblob(mmfile_t *ptr, struct object_database *odb,
> +		 const struct object_id *oid)
>  {
>  	unsigned long size;
>  	enum object_type type;
>  
> -	if (oideq(oid, null_oid(the_hash_algo))) {
> +	if (is_null_oid(oid)) {
>  		ptr->ptr = xstrdup("");
>  		ptr->size = 0;
>  		return;
>  	}
Arguably the commit coudl've been split up into three:
  1. The change to `is_null_oid()`.
  2. Adding the ODB to the parameter.
  3. Removing the macro and adding the include.

So that each of those could have a bit more explanation. But I guess the changes are smallish enough so that this borders on okay-ish, so I won't insist on such a change.

Other than that this patch looks good to me, thanks!
Patrick
Previous: René ScharfeNext: René Scharfe
Message 2 of 14 in “xdiff-interface: stop using the_repository”
  1. xdiff-interface: stop using the_repositoryRené Scharfe, Feb 8, 2026
  2. Patrick SteinhardtFeb 9, 2026
  3. René ScharfeFeb 9, 2026
  4. Junio C HamanoFeb 9, 2026
  5. René ScharfeFeb 9, 2026
  6. Junio C HamanoFeb 9, 2026
  7. René ScharfeFeb 9, 2026
  8. Elijah NewrenFeb 9, 2026
  9. Junio C HamanoFeb 9, 2026
  10. René ScharfeFeb 15, 2026
  11. René ScharfeFeb 15, 2026
  12. xdiff-interface: stop using the_repositoryRené Scharfe, Feb 9, 2026
  13. Patrick SteinhardtFeb 10, 2026
  14. Junio C HamanoFeb 10, 2026

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.