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

Re: [PATCH 3/5] make "git unpack-file" a built-in

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 22, 2010, 18:04 UTC
Message-ID
<7vmy06vwvy.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.00.1001220826230.13231@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 31 quoted lines
> From: Linus Torvalds <torvalds@linux-foundation.org>
> Date: Fri, 22 Jan 2010 07:38:03 -0800
>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> ---
> Again.. No surprises.
> ...
> diff --git a/unpack-file.c b/builtin-unpack-file.c
> similarity index 89%
> rename from unpack-file.c
> rename to builtin-unpack-file.c
> index e9d8934..608590a 100644
> --- a/unpack-file.c
> +++ b/builtin-unpack-file.c
> @@ -22,18 +22,15 @@ static char *create_temp_file(unsigned char *sha1)
>  	return path;
>  }
>  
> -int main(int argc, char **argv)
> +int cmd_unpack_file(int argc, const char **argv, const char *prefix)
>  {
>  	unsigned char sha1[20];
>  
> -	git_extract_argv0_path(argv[0]);
> -
>  	if (argc != 2 || !strcmp(argv[1], "-h"))
>  		usage("git unpack-file <sha1>");
>  	if (get_sha1(argv[1], sha1))
>  		die("Not a valid object name %s", argv[1]);
>  
> -	setup_git_directory();

This will now require "git unpack-file -h" to be run in a git controlled directory, so strictly speaking it changes behaviour.

Not that anybody would care that much, though.
Previous: Linus TorvaldsNext: Linus Torvalds
Message 7 of 9 in “make more commands built-in”
  1. 0/5 make more commands built-inLinus Torvalds, Jan 22, 2010
  2. 1/5 make "merge-index" a built-inLinus Torvalds, Jan 22, 2010
  3. PATCH 2/5] make "mktag" a built-inLinus Torvalds, Jan 22, 2010
  4. 3/5 make "git unpack-file" a built-inLinus Torvalds, Jan 22, 2010
  5. 4/5 make "git pack-redundant" a built-inLinus Torvalds, Jan 22, 2010
  6. 5/5 make "index-pack" a built-inLinus Torvalds, Jan 22, 2010
  7. Junio C HamanoJan 22, 2010
  8. Linus TorvaldsJan 22, 2010
  9. Linus TorvaldsJan 22, 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.