Re: [PATCH] Teach read-tree the -n|--dry-run option

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

 



Jens Lehmann <Jens.Lehmann@xxxxxx> writes:

> Using this option tells read-tree to not update the index. That makes it
> possible to check if updating the index would be successful without
> changing it.

Thanks for verifying the 3-way case as well.

> As using --dry-run is expected to have no side effects, this option makes
> no sense together with "-u".

I wondered if there be cases where "read-tree -m <1 to 3 trees>" will
succeed but the same command with "-u" can fail. If there were such cases,
we would need more than this patch does.

An obvious case is when you cannot write to your working tree, perhaps due
to ENOSPC or incorrect permission settings in the working tree, but I am
not worried about that. I am only worried about situations related to
version control (i.e. you may lose local changes).

I _think_ the only difference "-u" makes is that check_updates() makes
calls to checkout_entry(), and the only errors checkout_entry() would
catch are filesystem related ones. Even though there is one conditional
that says "if the cached stat does not match, you cannot checkout unless
you set .force to the checkout state", but unpack_trees() does set that
flag, so we should be safe.

Thanks.
--
To unsubscribe from this list: 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]