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

Re: [PATCH] Add --temp and --stage=all options to checkout-index.

From
Junio C Hamano <junkio@cox.net>
Date
Mar 5, 2006, 05:29 UTC
Message-ID
<7vlkvpihm4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060303151331.GA16369@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
Show 6 quoted lines
> Junio C Hamano <junkio@cox.net> wrote:
>> Shawn Pearce <spearce@spearce.org> writes:
>> 
>> >  Unfortunately this change lead me down a path which changed the core
>> >  checkout code also used by apply and read-tree.
>> 

I would have preferred not to add to_tempfile member to the checkout struct. Instead, if checkout_entry has non NULL topath, check out to a temporary location and return the path; otherwise behave the way it did before.

That way everybody else would not need to declare useless topath[] array on the stack and pass it to checkout_entry (instead they would just pass NULL because they are not interested in checking out to temporary files).

I am unsure about what the tempfile option should do when asked to checkout a symbolic link. Creating a temporary regular file that has the readlink result does not sound very useful to me.

BTW, in any case, I think there is one breakage that needs to be fixed with something like this...

---
diff --git a/apply.c b/apply.c
index 5a2cf54..727d63d 100644
--- a/apply.c
+++ b/apply.c
@@ -1311,6 +1311,7 @@ static int check_patch(struct patch *pat
 				costate.force = 0;
 				costate.quiet = 0;
 				costate.not_new = 0;
+				costate.to_tempfile = 0;
 				costate.refresh_cache = 1;
 				if (checkout_entry(active_cache[pos],
 						   &costate, topath) ||
Previous: Shawn PearceNext: Shawn Pearce
Message 4 of 6 in “Add --temp and --stage=all options to checkout-index.”
  1. Add --temp and --stage=all options to checkout-index.Shawn Pearce, Mar 3, 2006
  2. Junio C HamanoMar 3, 2006
  3. Shawn PearceMar 3, 2006
  4. Junio C HamanoMar 5, 2006
  5. Shawn PearceMar 5, 2006
  6. Junio C HamanoMar 5, 2006

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.