git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [ANNOUNCE] Git v1.8.3-rc0

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Apr 27, 2013, 05:32 UTC
Message-ID
<517B62D8.5020006@alum.mit.edu>
In-Reply-To
<CAH_OBievcf-_z_AX9UrmWL_HVFT2vSQTu+wXAjAFeQBM8iFSGw@mail.gmail.com>
On 04/27/2013 04:24 AM, shawn wilson wrote:
Show 11 quoted lines
> On Fri, Apr 26, 2013 at 8:22 PM, Junio C Hamano <gitster@pobox.com> wrote:
> 
>>  * There was no good way to ask "I have a random string that came from
>>    outside world. I want to turn it into a 40-hex object name while
>>    making sure such an object exists".  A new peeling suffix ^{object}
>>    can be used for that purpose, together with "rev-parse --verify".
>>
> 
> What does this mean / what is the reason behind this? I can only think
> it might be useful in a test suite to make sure git isn't doing
> anything stupid with hashes...?
The topic is discussed here:
http://git.661346.n2.nabble.com/Bug-in-quot-git-rev-parse-verify-quot-td7580929.html

As discussed in the thread, when verifying that an argument names an existing object, it is usually also appropriate to verify that the named object is of a particular type (or can be converted to a particular type), which could already be done with syntax like "$userstring^{commit}". But if, for example, you want to avoid unwrapping tags but also want to verify that the named object really exists, "$userstring^{object}" now provides a way.

And what do you have against test suites? :-)
Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: shawn wilsonNext: Junio C Hamano
Message 3 of 16 in “[ANNOUNCE] Git v1.8.3-rc0”
  1. Junio C HamanoApr 27, 2013
  2. shawn wilsonApr 27, 2013
  3. Michael HaggertyApr 27, 2013
  4. Junio C HamanoApr 28, 2013
  5. John KeepingApr 27, 2013
  6. Junio C HamanoApr 29, 2013
  7. Fix grammar in the 1.8.3 release notes.Marc Branchaud, Apr 29, 2013
  8. Junio C HamanoApr 29, 2013
  9. Junio C HamanoApr 29, 2013
  10. Marc BranchaudApr 30, 2013
  11. Lukas FleischerMay 1, 2013
  12. Marc BranchaudMay 1, 2013
  13. Junio C HamanoMay 1, 2013
  14. Junio C HamanoApr 29, 2013
  15. Eric SunshineApr 30, 2013
  16. Phil HordApr 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.