Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: [RFC PATCH] unpack-trees: add the dry_run flag to unpack_trees_options

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:18

Possibly related (same subject, not in this thread)

Jens Lehmann [off-list ref] writes:
Until now there was no way to test if unpack_trees() with update=1 would
succeed without really updating the work tree. The reason for that is that
setting update to 0 does skip the tests for new files and deactivates the
sparse handling, thereby making that unsuitable as a dry run.

Add the new dry_run flag to struct unpack_trees_options unpack_trees().
Setting that together with the update flag will check if the work tree
update would be successful without doing it for real.

The only class of problems that is not detected at the moment are file
system conditions like ENOSPC or missing permissions. Also the index
entries of updated files are not as they would be after a real checkout
because lstat() isn't run as the files aren't updated for real.

Signed-off-by: Jens Lehmann <redacted>
---
A very sane and clear description. Good.
AFAICS this patch enables the user to achieve a dry run by calling
unpack_trees() with both update and dry_run set.

My "Teach read-tree the -n|--dry-run option" adapted to this new flag
runs all tests successfully ...


 unpack-trees.c |    4 ++--
 unpack-trees.h |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
But on which change does this come?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help