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

Re: [PATCH v2 07/15] t4011: abstract away SHA-1-specific constants

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 28, 2019, 23:59 UTC
Message-ID
<20191028235935.d7avz3f3hcuown2l@camp.crustytoothpaste.net>
In-Reply-To
<xmqqk18pa88h.fsf@gitster-ct.c.googlers.com>
On 2019-10-28 at 02:56:14, Junio C Hamano wrote:
Show 10 quoted lines
> > +short_oid () {
> > +	local oid=$(git hash-object "$1") &&
> > +	git rev-parse --short "$oid"
> > +}
> 
> Given that we do not use the former helper to compute a regular
> file object name without having a concrete file on the filesystem,
> I do not mind calling it symlink_oid at all.  But then this may want
> to be called file_oid to make the contrast better, and it would
> match the use of these two in a test near the end of this patch.
Yeah, I can make that change.
Show 26 quoted lines
> >  test_expect_success 'diff new symlink and file' '
> > -	cat >expected <<-\EOF &&
> > +	symlink=$(symlink_oid xyzzy) &&
> > +	cat >expected <<-EOF &&
> >  	diff --git a/frotz b/frotz
> >  	new file mode 120000
> > -	index 0000000..7c465af
> > +	index 0000000..$symlink
> 
> It is a mistake to name the variable "symlink", even though
> symlink_oid is a good name for this helper function.  
> 
> If you were showing a change that updates the symlink RelNotes from
> pointing at Documentation/RelNotes/2.0.0.txt to
> Documentation/RelNotes/2.1.0.txt, for example, you would say
> 
> 	old=$(symlink_oid Documentation/RelNotes/2.0.0.txt) &&
> 	new=$(symlink_oid Documentation/RelNotes/2.1.0.txt) &&
> 	cat expect <<-EOF &&
> 	diff --git a/RelNotes b/RelNotes
> 	index $old..$new
> 	...
> 	EOF
> 
> so I'd expect $new (on the right hand side of ..) would read more
> natural.
Can change.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Junio C HamanoNext: brian m. carlson
Message 10 of 19 in “SHA-256 test fixes, part 6”
  1. 00/15 SHA-256 test fixes, part 6brian m. carlson, Oct 28, 2019
  2. 01/15 t/oid-info: allow looking up hash algorithm namebrian m. carlson, Oct 28, 2019
  3. 03/15 rev-parse: add a --show-object-format optionbrian m. carlson, Oct 28, 2019
  4. 02/15 t/oid-info: add empty tree and empty blob valuesbrian m. carlson, Oct 28, 2019
  5. 04/15 t1305: avoid comparing extensionsbrian m. carlson, Oct 28, 2019
  6. 05/15 t3429: remove SHA1 annotationbrian m. carlson, Oct 28, 2019
  7. 06/15 t4010: abstract away SHA-1-specific constantsbrian m. carlson, Oct 28, 2019
  8. 07/15 t4011: abstract away SHA-1-specific constantsbrian m. carlson, Oct 28, 2019
  9. Junio C HamanoOct 28, 2019
  10. brian m. carlsonOct 28, 2019
  11. 08/15 t4015: abstract away SHA-1-specific constantsbrian m. carlson, Oct 28, 2019
  12. 10/15 t4034: abstract away SHA-1-specific constantsbrian m. carlson, Oct 28, 2019
  13. 11/15 t4038: abstract away SHA-1 specific constantsbrian m. carlson, Oct 28, 2019
  14. 09/15 t4027: make hash-size independentbrian m. carlson, Oct 28, 2019
  15. 12/15 t4039: abstract away SHA-1-specific constantsbrian m. carlson, Oct 28, 2019
  16. 15/15 t4048: abstract away SHA-1-specific constantsbrian m. carlson, Oct 28, 2019
  17. 13/15 t4044: update test to work with SHA-256brian m. carlson, Oct 28, 2019
  18. 14/15 t4045: make hash-size independentbrian m. carlson, Oct 28, 2019
  19. Junio C HamanoOct 29, 2019

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.