public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail•com>
To: git@vger•kernel.org
Subject: Re: don't accept bogus N in `HEAD~N'
Date: Sun, 21 May 2006 23:42:47 +0200	[thread overview]
Message-ID: <e4qmsn$3mv$1@sea.gmane.org> (raw)
In-Reply-To: 87d5e7hxhl.fsf_-_@rho.meyering.net

Jim Meyering wrote:

> In a very shallow audit, I spotted code where overflow was not detected.
> But it's hardly critical.
> 
> Currently,
> 
>   git-diff HEAD HEAD
> 
> is equivalent to this
> 
>   git-diff HEAD HEAD~18446744073709551616   # aka 2^64
> 
> Exercising git-rev-parse directly, currently I get this:
> 
>   $ git-rev-parse --no-flags --sq HEAD~18446744073709551616
>   '639ca5497279607665847f2e3a11064441a8f2a6'
> 
> It'd be better to produce a diagnostic and fail:
> 
>   $ ./git-rev-parse --no-flags --sq -- HEAD~18446744073709551616 /dev/null
>   fatal: ambiguous argument 'HEAD~18446744073709551616': unknown revision or filename

Wouldn't it remove ability to say "to the root commit"?
One can do it now I guess exactly by specyfying overly large N.
Although there should probably be some limit... or not.

-- 
Jakub Narebski
Warsaw, Poland

  reply	other threads:[~2006-05-21 21:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-20 22:13 synchronizing incremental git changes to cvs Jim Meyering
2006-05-20 23:05 ` Johannes Schindelin
2006-05-21 13:40   ` Jim Meyering
2006-05-22 16:29     ` Pavel Roskin
2006-05-22 17:05       ` Jakub Narebski
2006-05-21  0:09 ` Martin Langhoff
2006-05-21 16:37   ` Jim Meyering
2006-05-21 18:21 ` Junio C Hamano
2006-05-21 21:31   ` Jim Meyering
2006-05-21 21:35   ` don't accept bogus N in `HEAD~N' Jim Meyering
2006-05-21 21:42     ` Jakub Narebski [this message]
2006-05-22  7:38       ` Jim Meyering
2006-05-22  8:16         ` Junio C Hamano
2006-05-22  8:25           ` Junio C Hamano
2006-05-22  6:57   ` avoid atoi, when possible; int overflow -> heap corruption Jim Meyering
2006-05-22 13:16     ` Morten Welinder
2006-05-22 13:31       ` Jim Meyering
2006-05-22 13:37       ` Jeff King
2006-05-22 13:54         ` Morten Welinder
2006-05-22 10:27   ` detect write failure, even for stdout Jim Meyering

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='e4qmsn$3mv$1@sea.gmane.org' \
    --to=jnareb@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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