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

Re: [PATCH] fast-import: fix lookup for new commits

From
AGAniket Gupta <aniketgupta3001@gmail.com>
Date
Oct 11, 2026, 19:38 UTC
Message-ID
<20261011193855.43162-1-aniketgupta3001@gmail.com>
In-Reply-To
<pull.2252.git.1791653078449.gitgitgadget@gmail.com>
Hello Marc,

Sorry for the noise, my first mail lost its In-Reply-To header on the way, so it is not in this thread. Resending the same review here.

I tried this on top of 6de20f609 with DEVELOPER=1 and did not get warnings.
Show 5 quoted lines
> Queries for commits created during the same 'git fast-import'  session
> result in a crash:
>     < reset refs/heads/newbranch
>     < from <new-commit-oid>
>     > fatal: not a valid commit: <new-commit-oid>

I was able to repro this. With the patch fsck is clean and it works nicely. Same goes for "commit" with "from <new-oid>", a tag made in the same session, and a tag of a tag. Existing commits and tags and "from <blob>" behave like before.

One small nitpick: there is a double space in "'git fast-import'  session".
> to avoid crash and (eventually) improve lookup speed.

Did you measure this? If not, maybe drop it or say it is only a possible side effect.

> +static struct object_entry *dereference(struct object_entry *oe, struct object_id *oid);
This is over 80 columns, can it be wrapped like the definition?
>  builtin/fast-import.c | 18 ++++++++++++++----

I could not find a test for this. Can you add one to t9300? You can get the new oid with get-mark and use it in a "reset ... from <oid>" in the same stream.

Thanks, Aniket

Previous: Marc Becker via GitGitGadgetNext: Marc Becker via GitGitGadget
Message 2 of 9 in “fast-import: fix lookup for new commits”
  1. fast-import: fix lookup for new commitsMarc Becker via GitGitGadget, Oct 10, 2026
  2. Aniket GuptaOct 11, 2026
  3. fast-import: fix lookup for new commits and tagsMarc Becker via GitGitGadget, Oct 12, 2026
  4. Junio C HamanoOct 13, 2026
  5. Junio C HamanoOct 13, 2026
  6. fast-import: allow 'from' to reference new commits and tags by oidMarc Becker via GitGitGadget, Oct 14, 2026
  7. Junio C HamanoOct 14, 2026
  8. fast-import: allow 'from' to reference new commits and tags by oidMarc Becker via GitGitGadget, Oct 14, 2026
  9. Junio C HamanoOct 14, 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.