From: Junio C Hamano <gitster@pobox.com>
To: Mark Rada <marada@uwaterloo.ca>
Cc: Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org, Jakub Narebski <jnareb@gmail.com>
Subject: Re: [RFC/PATCH v4 1/2] gitweb: check given hash before trying to create snapshot
Date: Sat, 12 Sep 2009 22:42:31 -0700 [thread overview]
Message-ID: <7vy6oj1jug.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4AAC8521.1060005@mailservices.uwaterloo.ca> (Mark Rada's message of "Sun\, 13 Sep 2009 01\:37\:37 -0400")
Mark Rada <marada@uwaterloo.ca> writes:
> On 09-09-12 11:30 PM, Junio C Hamano wrote:
>>> @@ -5196,8 +5202,9 @@ sub git_snapshot {
>>> die_error(403, "Unsupported snapshot format");
>>> }
>>>
>>> - if (!defined $hash) {
>>> - $hash = git_get_head_hash($project);
>>> + my $full_hash = git_get_full_hash($project, $hash);
>>> + if (!$full_hash) {
>>> + die_error(404, 'Hash id was not valid');
>>> }
>>
>> This is in the context of "snapshot", so obviously you care more about
>> just "such an object exists", don't you? You also want it to be a
>> tree-ish. Try giving it $hash = 'junio-gpg-pub' and see how it breaks.
>
> You have confused me. How is using 'junio-gpg-pub' different from the
> second test case that tries to use 'frizzumFrazzum'?
junio-gpg-pub tag exists in git.git but it tags a blob not a tree.
$ git rev-parse junio-gpg-pub
6019c27d966fe3ce8adcc0e9f12078eef96ca6ef
$ git archive junio-gpg-pub
fatal: not a tree object
next prev parent reply other threads:[~2009-09-13 5:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-13 0:09 [RFC/PATCH v4 1/2] gitweb: check given hash before trying to create snapshot Mark Rada
2009-09-13 3:30 ` Junio C Hamano
2009-09-13 5:37 ` Mark Rada
2009-09-13 5:42 ` Junio C Hamano [this message]
2009-09-13 15:03 ` Jakub Narebski
-- strict thread matches above, loose matches on Subject: below --
2009-09-12 23:03 Mark Rada
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=7vy6oj1jug.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=marada@uwaterloo.ca \
/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).