All of lore.kernel.org
 help / color / mirror / Atom feed
From: Justin Tobler <jltobler@gmail.com>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org, ps@pks.im
Subject: Re: [PATCH v3 4/4] tmp-objdir: merge loose object index when migrating tmpdir
Date: Fri, 30 Oct 2026 10:40:01 -0500	[thread overview]
Message-ID: <auS4SzrVGYfAG8KA@denethor> (raw)
In-Reply-To: <CAOLa=ZR2AmC4EDM7V2A9UainUZ5md=dQT_pnJycxuqV7BhfxxA@mail.gmail.com>

On 26/10/30 08:55PM, Karthik Nayak wrote:
> Justin Tobler <jltobler@gmail.com> writes:
> 
> > diff --git a/loose.c b/loose.c
> > index f2e111c25e..0ce9c7486e 100644
> > --- a/loose.c
> > +++ b/loose.c
> > @@ -311,3 +311,50 @@ void loose_object_map_clear(struct loose_object_map **map)
> >  	free(m);
> >  	*map = NULL;
> >  }
> > +
> > +int loose_object_idx_merge(struct repository *repo, const char *src,
> > +			   const char *dst)
> >
> 
> Nit: should we name this `loose_object_map_merge()` to stay consistent
> with the other `loose_object_map...()` functions?

I specifically did not call it `loose_object_map_merge()` because,
unlike the other similarly named functions, this one does not update the
in-memory loose object map for the object source. Here we are only
merging the "loose-object-idx" files.

> > +	if (loose_object_map_write(repo, map, fd) < 0) {
> > +		ret = error_errno(_("unable to write %s"),
> > +				  get_lock_file_path(&lock));
> > +		goto out;
> > +	}
> > +
> > +	if (commit_lock_file(&lock) < 0) {
> > +		ret = error_errno(_("unable to write %s"), dst);
> 
> Nit: Shouldn't this be unable to commit/rename? This will differentiate
> from the above write error

I choose "write" here because logically we are trying atomically write
the final "loose-object-idx" file. IMO, I think the difference in
filepath should be sufficient to differentiate between the two as well.
Ultimately though, I don't feel strongly either way about this and am
not sure it's worth a reroll, so I'm inclined to leave it as-is.

-Justin

  reply	other threads:[~2026-10-30 15:40 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 23:40 [PATCH] tmp-objdir: merge loose object index when migrating tmpdir Justin Tobler
2026-10-23 12:19 ` Patrick Steinhardt
2026-10-23 21:25   ` Justin Tobler
2026-10-26  6:39     ` Patrick Steinhardt
2026-10-26 17:58       ` Justin Tobler
2026-10-29  0:24 ` [PATCH v2 0/4] loose: fix migrating "loose-object-idx" with batch fsync Justin Tobler
2026-10-29  0:24   ` [PATCH v2 1/4] loose: use finite timeout when locking "loose-object-idx" file Justin Tobler
2026-10-29  8:05     ` Patrick Steinhardt
2026-10-29  0:24   ` [PATCH v2 2/4] loose: lift loose object index parsing logic into helper Justin Tobler
2026-10-29  8:05     ` Patrick Steinhardt
2026-10-29 21:10       ` Justin Tobler
2026-10-29  0:24   ` [PATCH v2 3/4] loose: lift loose object index writing " Justin Tobler
2026-10-29  8:05     ` Patrick Steinhardt
2026-10-29 21:18       ` Justin Tobler
2026-10-29  0:24   ` [PATCH v2 4/4] tmp-objdir: merge loose object index when migrating tmpdir Justin Tobler
2026-10-29  8:05     ` Patrick Steinhardt
2026-10-29 21:20       ` Justin Tobler
2026-10-29 22:22   ` [PATCH v2 0/4] loose: fix migrating "loose-object-idx" with batch fsync Junio C Hamano
2026-10-29 22:45     ` Justin Tobler
2026-10-29 23:22   ` [PATCH v3 " Justin Tobler
2026-10-29 23:22     ` [PATCH v3 1/4] loose: use finite timeout when locking "loose-object-idx" file Justin Tobler
2026-10-30 10:43       ` Karthik Nayak
2026-10-29 23:22     ` [PATCH v3 2/4] loose: lift loose object index parsing logic into helper Justin Tobler
2026-10-30 10:50       ` Karthik Nayak
2026-10-30 15:31         ` Justin Tobler
2026-10-29 23:22     ` [PATCH v3 3/4] loose: lift loose object index writing " Justin Tobler
2026-10-29 23:22     ` [PATCH v3 4/4] tmp-objdir: merge loose object index when migrating tmpdir Justin Tobler
2026-10-30 11:55       ` Karthik Nayak
2026-10-30 15:40         ` Justin Tobler [this message]
2026-10-30  6:20     ` [PATCH v3 0/4] loose: fix migrating "loose-object-idx" with batch fsync Patrick Steinhardt
2026-10-30 15:40       ` Justin Tobler
2026-10-30 10:38     ` Karthik Nayak
2026-10-30 15:43       ` Justin Tobler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auS4SzrVGYfAG8KA@denethor \
    --to=jltobler@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.com \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.