Skip to content

Refactor the tag object (take 2)

Johan Herland git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest21 patches 33 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21Remove unnecessary code and comments on non-existing 8kB tag object restrictionmktag.c+0 -70 replies
2/21Return error messages when parsing fails.tag.c+30 -923 replies
3/21Refactoring to make verify_tag() and parse_tag_buffer() more similarmktag.c tag.c+46 -452 replies
4/21Refactor verification of "tagger" line to be more similar to verification of "type" and "tagger" linesmktag.c t/t3800-mktag.sh tag.c+14 -112 replies
5/21Make parse_tag_buffer_internal() handle item == NULLtag.c+29 -253 replies
6/21Refactor tag name verification loop to use index 'i' instead of incrementing pointer 'tag_line'mktag.c+16 -134 replies
7/21Copy the remaining differences from verify_tag() to parse_tag_buffer_internal()tag.c+48 -23 replies
8/21Switch from verify_tag() to parse_and_verify_tag_buffer() for verifying tag objects in git-mktagmktag.c t/t3800-mktag.sh tag.c +1 more+6 -50 replies
9/21Remove unneeded code from mktag.cmktag.c+0 -942 replies
10/21Free mktag's buffer before dyingmktag.c+8 -55 replies
11/21Rewrite error messages; fix up line lengthst/t3800-mktag.sh tag.c+40 -261 reply
12/21Use prefixcmp() instead of memcmp() for cleaner code with less magic numberstag.c+11 -43 replies
13/21Collect skipping of header field names and calculation of line lengths in one placetag.c+14 -71 reply
14/21Add proper parsing of "tagger" line, but only when thorough_verify is settag.c+34 -142 replies
15/21Make tag names (i.e. the tag object's "tag" line) optionalbuiltin-log.c t/t3800-mktag.sh tag.c +1 more+34 -271 reply
16/21Introduce optional "keywords" on tag objectstag.c tag.h+54 -76 replies
17/21Update comments on tag objects in mktag.cmktag.c tag.c+23 -90 replies
18/21git-fsck: Do thorough verification of tag objectsbuiltin-fsck.c+15 -00 replies
19/21Documentation/git-mktag: Document the changes in tag object structureDocumentation/git-mktag.txt+30 -110 replies
20/21git-mktag tests: Expand on mktag selftests according to the new tag object structuret/t3800-mktag.sh+200 -120 replies
21/21Add fsck_verify_ref_to_tag_object() to verify that refname matches name stored in tag objectbuiltin-fsck.c+26 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/21] Refactor the tag object (take 2)

This patch series implements part of the ground work for the 'notes' feature discussed earlier in the thread "[PATCH 00/15] git-note: A mechanism for providing free-form after-the-fact annotations on commits".

The following patches refactors the tag object by:
1. Unifying parsing and verification of tag objects (patches 1-9)
2. Do better and more thorough verification of tag objects (patches 10-13)
3. Making the "tagger" header mandatory as far as possible (patch 14)
4. Making the "tag" header optional (patch 15)
5. Introducing a new optional "keywords" header (patch 16)
6. Auxiliary changes supporting the above (patches 17-21)

This patch series replaces the earlier patch series of the same name (plus the current bugfixes on top of that series). It's also much easier on the eyes for those with 80 chars wide displays. Also, the selftest suite should run successfully at any point in this patch series.

Here's the shortlog:

Johan Herland (21):
Remove unnecessary code and comments on non-existing 8kB tag object restriction Return error messages when parsing fails.
Refactoring to make verify_tag() and parse_tag_buffer() more similar
Refactor verification of "tagger" line to be more similar to verification of "type" and "tagger" lines Make parse_tag_buffer_internal() handle item == NULL
Refactor tag name verification loop to use index 'i' instead of incrementing pointer 'tag_line' Copy the remaining differences from verify_tag() to parse_tag_buffer_internal() Switch from verify_tag() to parse_and_verify_tag_buffer() for verifying tag objects in git-mktag Remove unneeded code from mktag.c
Free mktag's buffer before dying
Rewrite error messages; fix up line lengths
Use prefixcmp() instead of memcmp() for cleaner code with less magic numbers
Collect skipping of header field names and calculation of line lengths in one place Add proper parsing of "tagger" line, but only when thorough_verify is set
Make tag names (i.e. the tag object's "tag" line) optional
Introduce optional "keywords" on tag objects
Update comments on tag objects in mktag.c
git-fsck: Do thorough verification of tag objects
Documentation/git-mktag: Document the changes in tag object structure
git-mktag tests: Expand on mktag selftests according to the new tag object structure Add fsck_verify_ref_to_tag_object() to verify that refname matches name stored in tag object

 Documentation/git-mktag.txt |   41 +++++--
 builtin-fsck.c              |   41 +++++++
 builtin-log.c               |    2 +-
 mktag.c                     |  147 +++++-------------------
 t/t3800-mktag.sh            |  231 ++++++++++++++++++++++++++++++++++---
 tag.c                       |  268 +++++++++++++++++++++++++++++++++++--------
 tag.h                       |    5 +-
 7 files changed, 540 insertions(+), 195 deletions(-)

Have fun!

...Johan