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

[PATCHv2 0/2] fast-import: tighten parsing of mark references

From
PWPete Wyckoff <pw@padd.com>
Date
Apr 3, 2012, 01:51 UTC
Message-ID
<1333417910-17955-1-git-send-email-pw@padd.com>
In-Reply-To
<20120401225407.GA12127@padd.com>

Thanks Dmitry, Jonathan and Junio for the comments. I'm happy to have fast-import be strict about its format, and have added code and tests that demand exactly one space, or an end-of-line, as necessary. I also made sure the other error messages involved with parsing datarefs are correct.

Jonathan, good observation on CRLF users. If we did want to cater to them, doing it centrally in read_next_command() would be the way to go. But why bother.

Regarding fixing up all end-of-line number parsing, I think the only other one is dates. Both "raw" and "now" check for garbage at end-of-line, but "rfc2822" uses a generic function that accepts junk. I'm not motivated to add a lot of code to fix that corner case.

Junio, I made the commit message more clear. For the idea of combining find_mark + parse_mark, that isn't general enough for all users. This is the construct used in many places:

    oe = find_mark(parse_mark_ref_space(p, &x));

Also, I did the unit tests first, to make sure things were broken as I expected. You can squash it all together if you prefer.

		-- Pete
Pete Wyckoff (2):
  fast-import: test behavior of garbage after mark references
  fast-import: tighten parsing of mark references
 fast-import.c          |   97 ++++++++++++++----
 t/t9300-fast-import.sh |  267 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 342 insertions(+), 22 deletions(-)
-- 
1.7.10.rc2.2.g38670
Previous: Junio C HamanoNext: Pete Wyckoff
Message 8 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.