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

Re: [PATCH v2 00/12] Pulling signed/annotated tags

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Nov 8, 2011, 05:31 UTC
Message-ID
<CA+55aFyEuuT25m00uakL66YKSpT-zjoiBreymFSbuHmtARq6yw@mail.gmail.com>
In-Reply-To
<7vsjlzyza7.fsf@alter.siamese.dyndns.org>
On Mon, Nov 7, 2011 at 9:10 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
>
> Eek.
>
> The mergetag stuff is a dump of "cat-file tag" so if you have a line that
> begins with "object " the parsing side (which does not exist yet) would
> have trouble. We would need to devise e.g. adding number of lines at the
> beginning, or something.
Might I suggest making it simpler still to parse?

Change "strbuf_add_lines()" to have two *different* prefixes: one for the first line, and one for "continuation lines".

Then you can just use the same prefix if you want to - and get the semantics you have now for that helper.

But instead of just having "mergetag" as the prefix for all the lines copied from the merge, wouldn't it be nice and easy to have "mergetag" as the prefix for the *first* line of each copied tag, but then have some other tag for lines 2..n?

I think that would be *way* easier to parse, and I think something like that could be a good generic model for any multi-line thing - have the first line tagged, and the rest have just the continuation marker. You don't really need to repeat the tag over and over again each line, it just causes ambiguoity as shown by this example.

But I don't have any really strong opinions on it. I just think it's a good idea to make it easy to parse both mechanically and human-visually, and "number of lines" doesn't strike me as being very human-friendly.

         Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 30 of 32 in “Pulling signed tag”
  1. 00/10 Pulling signed tagJunio C Hamano, Nov 5, 2011
  2. 01/10 Split GPG interface into its own helper libraryJunio C Hamano, Nov 5, 2011
  3. 02/10 fetch: do not store peeled tag object names in FETCH_HEADJunio C Hamano, Nov 5, 2011
  4. 03/10 merge: notice local merging of tags and keep it unwrappedJunio C Hamano, Nov 5, 2011
  5. 04/10 fetch: allow "git fetch $there v1.0" to fetch a tagJunio C Hamano, Nov 5, 2011
  6. 05/10 tests: distinguish merges of tags and commitsJunio C Hamano, Nov 5, 2011
  7. 06/10 refs DWIMmery: use the same rule for both "git fetch" and othersJunio C Hamano, Nov 5, 2011
  8. 07/10 fmt-merge-msg: avoid early returnsJunio C Hamano, Nov 5, 2011
  9. 08/10 fmt-merge-msg: package options into a structureJunio C Hamano, Nov 5, 2011
  10. 09/10 fmt-merge-msg: Add contents of merged tag in the merge messageJunio C Hamano, Nov 5, 2011
  11. Johannes SixtNov 5, 2011
  12. Junio C HamanoNov 6, 2011
  13. 10/10 merge: force edit mode when merging a tag objectJunio C Hamano, Nov 5, 2011
  14. Nguyen Thai Ngoc DuyNov 5, 2011
  15. 00/12 Pulling signed/annotated tagsJunio C Hamano, Nov 8, 2011
  16. 01/12 Split GPG interface into its own helper libraryJunio C Hamano, Nov 8, 2011
  17. 02/12 fetch: do not store peeled tag object names in FETCH_HEADJunio C Hamano, Nov 8, 2011
  18. 03/12 merge: notice local merging of tags and keep it unwrappedJunio C Hamano, Nov 8, 2011
  19. 04/12 fetch: allow "git fetch $there v1.0" to fetch a tagJunio C Hamano, Nov 8, 2011
  20. 05/12 refs DWIMmery: use the same rule for both "git fetch" and othersJunio C Hamano, Nov 8, 2011
  21. 06/12 fmt-merge-msg: avoid early returnsJunio C Hamano, Nov 8, 2011
  22. 07/12 fmt-merge-msg: package options into a structureJunio C Hamano, Nov 8, 2011
  23. 08/12 fmt-merge-msg: Add contents of merged tag in the merge messageJunio C Hamano, Nov 8, 2011
  24. 09/12 merge: make usage of commit->util more extensibleJunio C Hamano, Nov 8, 2011
  25. 10/12 merge: record tag objects without peeling in MERGE_HEADJunio C Hamano, Nov 8, 2011
  26. 11/12 commit: copy merged signed tags to headers of merge commitJunio C Hamano, Nov 8, 2011
  27. 12/12 merge: force edit mode when merging a tag objectJunio C Hamano, Nov 8, 2011
  28. Linus TorvaldsNov 8, 2011
  29. Junio C HamanoNov 8, 2011
  30. Linus TorvaldsNov 8, 2011
  31. Junio C HamanoNov 8, 2011
  32. Junio C HamanoNov 8, 2011

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.