From: Paolo Bonzini <bonzini@gnu.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Git mailing list <git@vger.kernel.org>
Subject: Re: [PATCH] make commit --interactive lock index
Date: Thu, 29 May 2008 16:40:57 +0200 [thread overview]
Message-ID: <483EC079.1050008@gnu.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0805291454270.13507@racer.site.net>
>>>> + assert (!(interactive && pathspec && *pathspec));
>>> As pathspec is specified indirectly by the user, I think an assert()
>>> here is actively wrong.
>> But the program may still guarantee a condition by checking it
>> elsewhere. I don't need to teach you about that, do I? In particular,
>> the assert checks that this:
>>
>> if (interactive && argc > 0)
>> die("Paths with --interactive does not make sense.");
>>
>> ... is equivalent to !pathspec || !*pathspec.
>
> Okay, I have to spell it out:
>
> I think that the assert() here is not helpful at all, and that you should
> rather do the "if () die()" thingie.
The "if() die ()" thingie is already in builtin-commit.c, so we won't
ever get a pathspec in the "add --interactive" case. If we do,
something else has already been done incorrectly before -- not by the
user but by the programmer.
Paolo
next prev parent reply other threads:[~2008-05-29 14:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-29 8:09 [PATCH] make commit --interactive lock index Paolo Bonzini
2008-05-29 12:43 ` Johannes Schindelin
2008-05-29 13:12 ` Paolo Bonzini
2008-05-29 13:55 ` Johannes Schindelin
2008-05-29 14:40 ` Paolo Bonzini [this message]
2008-05-29 17:51 ` Alex Riesen
2008-05-29 18:00 ` Paolo Bonzini
2008-05-29 18:56 ` Alex Riesen
2008-05-29 19:17 ` Paolo Bonzini
2008-05-30 5:29 ` Junio C Hamano
2008-05-30 7:42 ` Paolo Bonzini
2008-06-02 13:52 ` Paolo Bonzini
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=483EC079.1050008@gnu.org \
--to=bonzini@gnu.org \
--cc=Johannes.Schindelin@gmx.de \
--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).