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

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 24, 2011, 23:18 UTC
Message-ID
<7v39k37kmo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4DDC1DF9.9030109@web.de>
Jens Lehmann <Jens.Lehmann@web.de> writes:
Show 16 quoted lines
> 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 <Jens.Lehmann@web.de>
> ---
A very sane and clear description. Good.
Show 10 quoted lines
> 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?
Previous: Jens LehmannNext: Jens Lehmann
Message 2 of 7 in “unpack-trees: add the dry_run flag to unpack_trees_options”
  1. unpack-trees: add the dry_run flag to unpack_trees_optionsJens Lehmann, May 24, 2011
  2. Junio C HamanoMay 24, 2011
  3. 0/2 Teach read-tree the -n|--dry-run optionJens Lehmann, May 25, 2011
  4. 1/2 unpack-trees: add the dry_run flag to unpack_trees_optionsJens Lehmann, May 25, 2011
  5. Junio C HamanoMay 25, 2011
  6. 2/2 Teach read-tree the -n|--dry-run optionJens Lehmann, May 25, 2011
  7. Junio C HamanoMay 25, 2011

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.