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

Re: [PATCH/RFC] get_sha1: prefer 40-hex ref name over 40-hex SHA-1

From
Thomas Rast <trast@inf.ethz.ch>
Date
May 2, 2013, 08:55 UTC
Message-ID
<87r4hpu5f8.fsf@linux-k42r.v.cablecom.net>
In-Reply-To
<1367377282-9862-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 14 quoted lines
> +test_expect_success 'rev-parse 20-hex ref' '
> +	REF=`git rev-parse HEAD` &&
> +	VAL=`echo| git commit-tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904` &&
> +	git update-ref refs/heads/$REF $VAL &&
> +	test `git rev-parse $REF` = $VAL
> +'
> +
> +test_expect_success 'rev-parse ambiguous 20-hex ref' '
> +	REF=`git rev-parse HEAD` &&
> +	VAL=`echo| git commit-tree -p HEAD 4b825dc642cb6eb9a060e54bf8d69288fbee4904` &&
> +	git update-ref refs/tags/$REF $VAL &&
> +	test `git rev-parse $REF 2>err` = $VAL &&
> +	grep "refname.*ambiguous" err
> +'
Shouldn't these say s/20-hex/40-hex/?
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Nguyễn Thái Ngọc Duy
Message 8 of 8 in “get_sha1: prefer 40-hex ref name over 40-hex SHA-1”
  1. get_sha1: prefer 40-hex ref name over 40-hex SHA-1Nguyễn Thái Ngọc Duy, May 1, 2013
  2. Eric SunshineMay 1, 2013
  3. Jonathan NiederMay 1, 2013
  4. Duy NguyenMay 2, 2013
  5. get_sha1: improve ambiguity warning regarding SHA-1 and ref namesNguyễn Thái Ngọc Duy, May 4, 2013
  6. Junio C HamanoMay 7, 2013
  7. get_sha1: warn about full or short object names that look like refsNguyễn Thái Ngọc Duy, May 29, 2013
  8. Thomas RastMay 2, 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.