From: Junio C Hamano <gitster@pobox.com>
To: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Cc: git@vger.kernel.org
Subject: Re: 'git reset -- NonExistingFile' succeeds
Date: Wed, 06 Nov 2019 10:51:11 +0900 [thread overview]
Message-ID: <xmqq36f1ydps.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <df35c20c-669e-35a1-9b2c-22940637b560@syntevo.com> (Alexandr Miloslavskiy's message of "Mon, 4 Nov 2019 11:24:01 +0100")
Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> writes:
> On 02.11.2019 5:49, Junio C Hamano wrote:
>> It's sort of expected ;-)
>
> Didn't expect such a detailed reply, thanks!
>
> Not really a problem for me, just I was surprised and thought that I'd
> ask about it.
>
> I came across this issue when writing a test for 'git reset'. I'll
> simply change the test to verify the repository state instead of
> expecting 'git reset' to fail.
As I said, it is expected that Git is not perfect and there would be
many little corners like this that can use improvements. IOW, it is
not unexpected that "git reset -- NoSuchFile" does not raise an
error, but that does not make it a bad idea to at least think about
teaching it to do so. There _might_ be fallouts, though; there may
be scripts by people that rely on 'git reset -- "$variable"' with
some random pathspec in a $variable to quietly become no-op when no
paths match (in which case, we'd have to mimic ls-files and add a
"--error-unmatch" option, perhaps).
prev parent reply other threads:[~2019-11-06 1:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 16:29 'git reset -- NonExistingFile' succeeds Alexandr Miloslavskiy
2019-11-02 4:49 ` Junio C Hamano
2019-11-04 10:24 ` Alexandr Miloslavskiy
2019-11-06 1:51 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq36f1ydps.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=alexandr.miloslavskiy@syntevo.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).