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

Re: [PATCH] fast-import: tag may point to any object type

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 11, 2010, 17:14 UTC
Message-ID
<20100111171454.GO32155@spearce.org>
In-Reply-To
<1263186165-23920-1-git-send-email-dpotapov@gmail.com>
Dmitry Potapov <dpotapov@gmail.com> wrote:
Show 21 quoted lines
> If you tried to export the official git repository, and then to import it
> back then git-fast-import would die complaining that "Mark :1 not a commit".
> 
> Accordingly to a generated crash file, Mark 1 is not a commit but a blob,
> which is pointed by junio-gpg-pub tag. Because git-tag allows to create such
> tags, git-fast-import should import them.
> 
> Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
> ---
>  fast-import.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fast-import.c b/fast-import.c
> index cd87049..e99990d 100644
> --- a/fast-import.c
> +++ b/fast-import.c
> @@ -2305,6 +2305,7 @@ static void parse_new_tag(void)
>  	struct tag *t;
>  	uintmax_t from_mark = 0;
>  	unsigned char sha1[20];
> +	enum object_type type = OBJ_COMMIT;
NAK.

Your patch is the right idea. But you need to make sure all of the branch arms are handled correctly.

That is, if we do this, the get_sha1() on line 2459 should also
permit non-commit objects, and the lookup_branch() earlier up on
line 2451 should do "type = OBJ_COMMIT".
  
-- 
Shawn.
Previous: Dmitry PotapovNext: Dmitry Potapov
Message 2 of 5 in “fast-import: tag may point to any object type”
  1. fast-import: tag may point to any object typeDmitry Potapov, Jan 11, 2010
  2. Shawn O. PearceJan 11, 2010
  3. fast-import: tag may point to any object typeDmitry Potapov, Jan 13, 2010
  4. Shawn O. PearceJan 13, 2010
  5. fast-import: tag may point to any object typeDmitry Potapov, Jan 14, 2010

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.