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

Re: [PATCH v2.5 2/2] tag: prevent nested tags

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 3, 2019, 07:32 UTC
Message-ID
<xmqqzhp7sfw4.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190402230345.GA5004@dev-l>
Denton Liu <liu.denton@gmail.com> writes:
> This is the first use of the '%n$<fmt>' style of printf format in the
> *.[ch] files in our codebase, but it's supported by POSIX[1] and there
> are existing uses for it in po/*.po files, so hopefully it won't cause

The latter is a stronger indication that this should be OK than the former ;-) Thanks for digging and noting.

Show 11 quoted lines
> diff --git a/Documentation/config/advice.txt b/Documentation/config/advice.txt
> index 88620429ea..ec4f6ae658 100644
> --- a/Documentation/config/advice.txt
> +++ b/Documentation/config/advice.txt
> @@ -90,4 +90,6 @@ advice.*::
>  	waitingForEditor::
>  		Print a message to the terminal whenever Git is waiting for
>  		editor input from the user.
> +	nestedTag::
> +		Advice shown if a user attempts to recursively tag a tag object.
>  --

In addition to 'advice', we may have to add a configuration to help projects that wants to tag tag objects regularly so that they do not have to keep typing "--allow-nested-tag". But that can wait until a participant of such a project comes forward and makes a case for their workflow.

> +chain of custody by signing someone else's signed tag. However, in
> +practice, this is typically a mistake so we prevent it from happening by
> +default unless specifically requested.

I am not sure if this is so bad, actually. Why do we need to treat it as a mistake? When a command that wants a commit is fed a tag (either a tag that directly refers to a commit, or a tag that tags another tag that refers to a commit), the command knows how to peel so it's not like the user is forced to say "git log T^{commit}".

And if something that *MUST* take a commit refuses to (or more likely, forges to) peel a tag down to a commit and yields an error, I think that is what needs fixing, not the command that creates a tag.

So, I am fairly negative on this change---unless it is made much more clear in the doc and/or in the proposed log message what practical downside there are to the end users if we do not stop this "mistake", that is.

> +Automatically erroring on nested tags was introduced in Git version
> +2.22.0.

And please do not write something like this. A feature gets in a release when it is ready, and we may not ship this in 2.22.

"git tag --help" the user is running may or may not have the paragraph about "nested tag", depending on the existence of the feature in the version of Git the user is running, so there is no need to say something like that.

And no, I do not buy arguments like "random web servers serve different versions of documentation without identifying which version of Git they describe".

Previous: Denton LiuNext: Junio C Hamano
Message 28 of 48 in “Strange annotated tag issue”
  1. Robert DaileyMar 21, 2019
  2. Bryan TurnerMar 21, 2019
  3. Jeff KingMar 21, 2019
  4. Jeff KingMar 21, 2019
  5. Robert DaileyMar 25, 2019
  6. Jeff KingMar 25, 2019
  7. Robert DaileyMar 25, 2019
  8. Bryan TurnerMar 25, 2019
  9. Jeff KingMar 25, 2019
  10. Ævar Arnfjörð BjarmasonMar 25, 2019
  11. Jeff KingMar 25, 2019
  12. 0/3 tag: prevent recursive tagsDenton Liu, Mar 26, 2019
  13. 1/3 tag: prevent recursive tagsDenton Liu, Mar 26, 2019
  14. Denton LiuMar 26, 2019
  15. Ævar Arnfjörð BjarmasonMar 26, 2019
  16. Elijah NewrenMar 27, 2019
  17. Ævar Arnfjörð BjarmasonMar 27, 2019
  18. Robert DaileyMar 28, 2019
  19. 2/3 t7004: ensure recursive tag behavior is workingDenton Liu, Mar 26, 2019
  20. Ævar Arnfjörð BjarmasonMar 26, 2019
  21. 3/3 git-tag.txt: document --allow-recursive-tag optionDenton Liu, Mar 26, 2019
  22. Ævar Arnfjörð BjarmasonMar 26, 2019
  23. Jeff KingMar 26, 2019
  24. 0/2 tag: prevent nested tagsDenton Liu, Apr 2, 2019
  25. 1/2 tag: fix formattingDenton Liu, Apr 2, 2019
  26. 2/2 tag: prevent nested tagsDenton Liu, Apr 2, 2019
  27. 2/2 tag: prevent nested tagsDenton Liu, Apr 2, 2019
  28. Junio C HamanoApr 3, 2019
  29. Junio C HamanoApr 3, 2019
  30. Robert DaileyApr 3, 2019
  31. Junio C HamanoApr 4, 2019
  32. Robert DaileyApr 4, 2019
  33. Junio C HamanoApr 4, 2019
  34. Robert DaileyApr 5, 2019
  35. Johannes SixtApr 3, 2019
  36. Denton LiuApr 3, 2019
  37. Jeff KingApr 4, 2019
  38. Junio C HamanoApr 4, 2019
  39. Jeff KingApr 4, 2019
  40. Junio C HamanoApr 4, 2019
  41. Jeff KingApr 4, 2019
  42. Eckhard MaaßApr 11, 2019
  43. Junio C HamanoApr 12, 2019
  44. Elijah NewrenApr 5, 2019
  45. Junio C HamanoApr 5, 2019
  46. 0/2 tag: advise on recursive taggingDenton Liu, Apr 4, 2019
  47. 1/2 tag: fix formattingDenton Liu, Apr 4, 2019
  48. 2/2 tag: advise on nested tagsDenton Liu, Apr 4, 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.