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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shawn Pearce <spearce@xxxxxxxxxxx> writes:

> Junio C Hamano <junkio@xxxxxxx> wrote:
>> Shawn Pearce <spearce@xxxxxxxxxxx> 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) ||

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]