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

Re: [PATCHv3] fast-import: tighten parsing of mark references

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 5, 2012, 02:24 UTC
Message-ID
<20120405022422.GB20687@burratino>
In-Reply-To
<20120405015121.GA10945@padd.com>
Pete Wyckoff wrote:
> This addresses all of Jonathan's comments, in particular:
Nice.  Thanks much.  I only have a few small worries left:
[...]
> +++ b/t/t9300-fast-import.sh
> @@ -2635,4 +2635,280 @@ test_expect_success \
[...]
> +test_expect_success 'S: filemodify with garbage after sha1 must fail' '
> +	sha1=$(grep -w :103 marks | cut -d\  -f2) &&
"grep -w" isn't used elsewhere in the testsuite.  Is it portable?
[...]
Show 17 quoted lines
> +# inline is misspelled; fast-import thinks it is some unknown dataref
> +# and complains "Invalid SHA1"
> +test_expect_success 'S: notemodify with garbage after inline dataref must fail' '
> +	test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
> +	commit refs/heads/S
> +	committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
> +	data <<COMMIT
> +	commit S note dataref inline
> +	COMMIT
> +	N inlineX :2
> +	data <<BLOB
> +	note blob
> +	BLOB
> +	EOF
> +	cat err &&
> +	test_i18ngrep "nvalid SHA1" err
> +'

If I understood the discussion before correctly, this error message is suboptimal and something like "invalid dataref" would be a little clearer, right?

That's orthogonal to what this patch is about so I'm not suggesting changing it. But shouldn't the test just check that fast-import fails without committing to any particular message?

Cheers, Jonathan

Previous: Pete WyckoffNext: Junio C Hamano
Message 19 of 22 in “fast-import: catch garbage after marks in from/merge”
  1. fast-import: catch garbage after marks in from/mergePete Wyckoff, Apr 1, 2012
  2. Jonathan NiederApr 1, 2012
  3. Pete WyckoffApr 2, 2012
  4. Dmitry IvankovApr 2, 2012
  5. Junio C HamanoApr 2, 2012
  6. Jonathan NiederApr 2, 2012
  7. Junio C HamanoApr 2, 2012
  8. 0/2 fast-import: tighten parsing of mark referencesPete Wyckoff, Apr 3, 2012
  9. 1/2 fast-import: test behavior of garbage after mark referencesPete Wyckoff, Apr 3, 2012
  10. Jonathan NiederApr 3, 2012
  11. Pete WyckoffApr 4, 2012
  12. Jonathan NiederApr 4, 2012
  13. 2/2 fast-import: tighten parsing of mark referencesPete Wyckoff, Apr 3, 2012
  14. Jonathan NiederApr 3, 2012
  15. Pete WyckoffApr 4, 2012
  16. Jonathan NiederApr 4, 2012
  17. Sverre RabbelierApr 3, 2012
  18. [PATCHv3] fast-import: tighten parsing of mark referencesPete Wyckoff, Apr 5, 2012
  19. Jonathan NiederApr 5, 2012
  20. Junio C HamanoApr 5, 2012
  21. [PATCHv4] fast-import: tighten parsing of datarefsPete Wyckoff, Apr 7, 2012
  22. Junio C HamanoApr 10, 2012

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.