Re: What's cooking in git.git (May 2011, #06; Fri, 13)
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 15, 2011, 20:23 UTC
- Message-ID
- <7vfwofpvai.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <4DD0043D.1050101@web.de>
Jens Lehmann <Jens.Lehmann@web.de> writes:
Show 9 quoted lines
> Am 13.05.2011 22:03, schrieb Junio C Hamano: >> * jl/read-tree-m-dry-run (2011-05-11) 1 commit >> - Teach read-tree the -n|--dry-run option >> >> Looked good. We _might_ want to make -n simply ignore -u, though. > > Fine by me. Do you want me to send an updated version? If so, > should a warning be issued in that case or should that just > happen silently?
Later we _may_ have a condition where "read-tree -m" with some options (except "-n") may succeed but "read-tree -m -u" with the same other options may fail, and the reason to have "-n" is so that the caller can tell if the operation may or may not fail in advance without changing the state. Singling out "do not write INDEX" was a mistake to begin with.
How about "simply ignore" aka "silently"? We do not even have to make it sound like an user error, if we explain the option like this.
I think the change to the implementation would be trivial, but you would probably want to update the tests in 1002 (remove the one at the end that checks -u/-n incompatibility, and perhaps make sure "-n -u" combination does not touch anything as advertised).
Thanks.
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt index a35849f..46a96f2 100644 --- a/Documentation/git-read-tree.txt +++ b/Documentation/git-read-tree.txt @@ -55,8 +55,8 @@ OPTIONS -n:: --dry-run:: - Don't write the index file. This option isn't allowed together - with -u. + Check if the command would error out, without updating the index + nor the files in the working tree for real. -v:: Show the progress of checking files out.