From: Junio C Hamano <gitster@pobox.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: git@vger.kernel.org, Samuel Tardieu <sam@rfc1149.net>
Subject: Re: [PATCH] Permit refspec source side to parse as a sha1
Date: Thu, 20 Mar 2008 22:30:01 -0700 [thread overview]
Message-ID: <7vmyosskyu.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LNX.1.00.0803210014100.19665@iabervon.org> (Daniel Barkalow's message of "Fri, 21 Mar 2008 01:09:24 -0400 (EDT)")
Daniel Barkalow <barkalow@iabervon.org> writes:
> So we should call the same code to parse the string, have that code do no
> validation at all, and have the caller validate the return as appropriate.
> The parsing doesn't depend at all on whether it's for fetching or pushing.
Obviously you did not read my patch before responding.
While I would agree that removing the check from parsing and add necessary
checks to all callers would be another way to catch the same kind of
breakages,
(1) it would be more code to change, and I do not see a clear advantage,
in that approach, especially given the discussion that lead to
$gmane/77413;
(2) the error reporting by the callers that use the parsed result will
not be able to say "Invalid refspec '%s'" on the source string,
simply because the source string is not available to them anymore;
(3) worse yet, the older code even discarded part of the user input, so
the error reporting that uses the parsed src/dst pair may not even be
similar to the problematic input the user gave us to begin with,
making it harder for the user to spot what we did not like and
correct it.
In any case, don't you agree that the patch you responded to is much
easier to understand what we are (and we are not) checking than the
original code?
next prev parent reply other threads:[~2008-03-21 5:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-21 0:54 [PATCH] Permit refspec source side to parse as a sha1 Daniel Barkalow
2008-03-21 4:10 ` Junio C Hamano
2008-03-21 4:50 ` Junio C Hamano
2008-03-21 5:09 ` Daniel Barkalow
2008-03-21 5:30 ` Junio C Hamano [this message]
2008-03-21 5:57 ` Daniel Barkalow
2008-03-21 6:26 ` Junio C Hamano
2008-03-21 16:08 ` Daniel Barkalow
2008-03-21 22:17 ` [PATCH] remote.c: Fix overtight refspec validation Junio C Hamano
2008-03-21 23:12 ` Daniel Barkalow
2008-03-21 23:59 ` Junio C Hamano
2008-03-22 0:36 ` Daniel Barkalow
2008-03-22 19:48 ` Junio C Hamano
2008-03-22 20:45 ` Daniel Barkalow
2008-03-26 1:45 ` Linus Torvalds
2008-03-26 3:31 ` Junio C Hamano
2008-03-26 4:11 ` Junio C Hamano
2008-03-26 5:42 ` Daniel Barkalow
2008-03-26 5:46 ` Junio C Hamano
2008-03-26 6:22 ` Jeff King
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vmyosskyu.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=sam@rfc1149.net \
/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.
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 NNTP newsgroup(s).