From: Justin Tobler <jltobler@gmail.com>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: git@vger.kernel.org, ps@pks.im
Subject: Re: [PATCH v4 1/4] pack-write: make index-pack output comment hash agnostic
Date: Mon, 26 Oct 2026 10:44:35 -0500 [thread overview]
Message-ID: <at9v9p64l72xFEi8@denethor> (raw)
In-Reply-To: <CAOLa=ZTnEJDPB6_fdFQFcM=zV21HEZ4gzzhWqB=A_euSzUut_w@mail.gmail.com>
On 26/10/26 08:01AM, Karthik Nayak wrote:
> Justin Tobler <jltobler@gmail.com> writes:
>
> > /*
> > - * The first thing we expect from index-pack's output
> > - * is "pack\t%40s\n" or "keep\t%40s\n" (46 bytes) where
> > - * %40s is the newly created pack SHA1 name. In the "keep"
> > - * case, we need it to remove the corresponding .keep file
> > - * later on. If we don't get that then tough luck with it.
> > + * The first thing we expect from index-pack's output is
> > + * "pack\t<name>\n" or "keep\t<name>\n", where <name> is the hexadecimal
> > + * name of the packfile it has just written. The line is therefore five
> > + * bytes of prefix, `hexsz` bytes of name, and a trailing newline. A
> > + * "keep" prefix tells us that index-pack has also created the
> > + * corresponding ".keep" file.
> > + *
> > + * In the "keep" case, we need it to remove the corresponding ".keep"
> > + * file later on. If we don't get that then tough luck with it.
>
> We start off saying we expect either '"pack\t<name>\n" or
> "keep\t<name>\n"'. But the last line makes it seem like the latter is
> always expected? Is that the case, or should this comment be moved to
> the caller in 'fetch-pack.c'?
Even though all callers of this function specify the `--keep` option to
the git-index-pack(1) generating the output, it is expected that the
output may be either "pack" or "keep". When git-index-pack(1) tries to
create a lockfile, but one already exists, it simply ignores the error
and returns a "pack" output line. The last line is from the original
comment and indicates that when we do identify that a ".keep" file was
created, it is something the caller must handle later on.
The intent of this patch was just to update the comment to be hash
agnostic. The next patch splits out the `read_index_pack_report()`
function from `index_pack_lockfile()` and the last comment line is
removed accordingly. So I'm inclined to leave this patch as-is.
-Justin
next prev parent reply other threads:[~2026-10-26 15:44 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 2:28 [PATCH 0/3] object-file: fix ".keep" lockfile ownership in ODB transactions Justin Tobler
2026-10-16 2:28 ` [PATCH 1/3] pack-write: lift and expose index-pack report parsing Justin Tobler
2026-10-16 6:58 ` Patrick Steinhardt
2026-10-16 17:30 ` Justin Tobler
2026-10-16 2:29 ` [PATCH 2/3] object-file: explicitly write ".keep" lockfile Justin Tobler
2026-10-16 6:58 ` Patrick Steinhardt
2026-10-16 18:37 ` Justin Tobler
2026-10-16 2:29 ` [PATCH 3/3] object-file: write ".keep" lockfiles during transaction commit Justin Tobler
2026-10-16 6:58 ` Patrick Steinhardt
2026-10-16 19:22 ` Justin Tobler
2026-10-16 21:37 ` [PATCH v2 0/4] object-file: fix ".keep" lockfile ownership in ODB transactions Justin Tobler
2026-10-16 21:37 ` [PATCH v2 1/4] pack-write: make index-pack output comment hash agnostic Justin Tobler
2026-10-16 21:37 ` [PATCH v2 2/4] pack-write: lift and expose index-pack report parsing Justin Tobler
2026-10-16 21:37 ` [PATCH v2 3/4] object-file: explicitly write ".keep" lockfile Justin Tobler
2026-10-19 6:14 ` Patrick Steinhardt
2026-10-19 21:44 ` Justin Tobler
2026-10-16 21:37 ` [PATCH v2 4/4] object-file: write ".keep" lockfiles during transaction commit Justin Tobler
2026-10-19 6:14 ` Patrick Steinhardt
2026-10-20 13:28 ` [PATCH v3 0/4] object-file: fix ".keep" lockfile ownership in ODB transactions Justin Tobler
2026-10-20 13:28 ` [PATCH v3 1/4] pack-write: make index-pack output comment hash agnostic Justin Tobler
2026-10-20 13:28 ` [PATCH v3 2/4] pack-write: lift and expose index-pack report parsing Justin Tobler
2026-10-20 13:28 ` [PATCH v3 3/4] object-file: explicitly write ".keep" lockfile Justin Tobler
2026-10-20 14:26 ` Patrick Steinhardt
2026-10-20 15:51 ` Justin Tobler
2026-10-21 16:47 ` Junio C Hamano
2026-10-20 13:29 ` [PATCH v3 4/4] object-file: write ".keep" lockfiles during transaction commit Justin Tobler
2026-10-20 14:15 ` [PATCH v3 0/4] object-file: fix ".keep" lockfile ownership in ODB transactions Patrick Steinhardt
2026-10-21 18:25 ` [PATCH v4 " Justin Tobler
2026-10-21 18:25 ` [PATCH v4 1/4] pack-write: make index-pack output comment hash agnostic Justin Tobler
2026-10-26 15:01 ` Karthik Nayak
2026-10-26 15:44 ` Justin Tobler [this message]
2026-10-21 18:25 ` [PATCH v4 2/4] pack-write: lift and expose index-pack report parsing Justin Tobler
2026-10-21 18:25 ` [PATCH v4 3/4] object-file: explicitly write ".keep" lockfile Justin Tobler
2026-10-26 16:08 ` Karthik Nayak
2026-10-27 18:26 ` Justin Tobler
2026-10-27 18:32 ` Justin Tobler
2026-10-26 21:51 ` Karthik Nayak
2026-10-21 18:25 ` [PATCH v4 4/4] object-file: write ".keep" lockfiles during transaction commit Justin Tobler
2026-10-26 21:49 ` Karthik Nayak
2026-10-22 5:56 ` [PATCH v4 0/4] object-file: fix ".keep" lockfile ownership in ODB transactions Patrick Steinhardt
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=at9v9p64l72xFEi8@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.