git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sitaram Chamarty <sitaramc@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git name-rev not accepting abbreviated SHA with --stdin
Date: Sat, 04 Jul 2015 06:56:54 +0530	[thread overview]
Message-ID: <5597365E.7070508@gmail.com> (raw)
In-Reply-To: <xmqqbnft5eja.fsf@gitster.dls.corp.google.com>

On 07/03/2015 11:06 PM, Junio C Hamano wrote:
> Sitaram Chamarty <sitaramc@gmail.com> writes:
> 
>> On 06/25/2015 05:41 AM, Junio C Hamano wrote:
>>> Sitaram Chamarty <sitaramc@gmail.com> writes:
>>>
>>>> This *is* documented, but I'm curious why this distinction is made.
>>>
>>> I think it is from mere laziness, and also in a smaller degree
>>> coming from an expectation that --stdin would be fed by another
>>> script like rev-list where feeding full 40-hex is less work than
>>> feeding unique abbreviated prefix.
>>
>> Makes sense; thanks.  Maybe if I feel really adventurous I will,
>> one day, look at the code :-)
> 
> Sorry, but I suspect this is not 100% laziness; it is meant to read
> text that has object names sprinkled in and output text with object
> names substituted.  I suspect that this was done to prevent a short
> string that may look like an object name like deadbabe from getting
> converted into an unrelated commit object name.

As a perl programmer, laziness is much more palatable to me as a reason
;-)

Jokes apart, I'm not sure the chances of *both* those things happening
-- an accidental hash-like string in the text *and* it matching an
existing hash -- are high enough to bother.  If it can be done without
too much code, it probably should.

  reply	other threads:[~2015-07-04  1:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24  3:29 git name-rev not accepting abbreviated SHA with --stdin Sitaram Chamarty
2015-06-25  0:11 ` Junio C Hamano
2015-06-25  2:01   ` Sitaram Chamarty
2015-07-03 17:36     ` Junio C Hamano
2015-07-04  1:26       ` Sitaram Chamarty [this message]
2015-07-04  2:03         ` Junio C Hamano

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=5597365E.7070508@gmail.com \
    --to=sitaramc@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).