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

Re: [git patches] libata updates, GPG signed (but see admin notes)

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Nov 3, 2011, 01:45 UTC
Message-ID
<CA+55aFwXu=+HdQ5nW11Ts5p-V=KgpxjyagKqB+Xv+qBOEEWXvQ@mail.gmail.com>
In-Reply-To
<CA+55aFx0oCd6-sh0psYxho-s=sHAK0RHXJHfLewRuUcdXzxZbg@mail.gmail.com>

On Wed, Nov 2, 2011 at 6:19 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote:

Show 5 quoted lines
>
> I'm not saying that you shouldn't use them - go ahead and use the
> feature if you like it. But please spare me your excuses for stupid
> workarounds that come from the fact that they aren't a good match for
> sane workflows.

Btw, having now done odd things with signed tags (because we've used them as a side-band verification mechanism), I can certainly also say that the signed tags have their set of problems too.

So signed tags aren't perfect. They were designed for making releases, and that shows very clearly in how git works with them. The default choices that git makes are very awkward indeed when you use signed tags as "security tokens".

But unlike the "sign the commit" approach, those are implementation and UI issues, not "fundamentally broken design" issues.

For example, fetching a single signed tag with git is surprisingly hard. It *shouldn't* be hard - and there's no underlying technical or design reason why it would be hard, but it is. Why? Because all the git actions when it comes to tags are all geared towards one particular use, that is *not* about the signature checking aspect of them.

Here's an example: Rusty Russell now makes nice signed tags for the things he asks me to pull, and then states them in the pull message. So he will mention that he has a tag named

   rusty@rustcorp.com.au-v3.1-8068-g5087a50
in his git repository at
   git://github.com/rustyrussell/linux.git

and while I don't think his tag names are all that wonderful, it makes sense from an automated script kind of standpoint.

Now, let's try to get that tag:
  [torvalds@i5 linux]$ git fetch
git://github.com/rustyrussell/linux.git
rusty@rustcorp.com.au-v3.1-8068-g5087a50
  fatal: Couldn't find remote ref rusty@rustcorp.com.au-v3.1-8068-g5087a50
oops. Ok, so his tag naming is *really* akward. Whatever. Let's try again:
   [torvalds@i5 linux]$ git fetch
git://github.com/rustyrussell/linux.git
refs/tags/rusty@rustcorp.com.au-v3.1-8068-g5087a50
   From git://github.com/rustyrussell/linux
    * tag
rusty@rustcorp.com.au-v3.1-8068-g5087a50 -> FETCH_HEAD
Ahh, success!

Oops. Nope. It turns out that git will *peel* the tag when you fetch it, so FETCH_HEAD actually doesn't contain the tag object at all, but the commit object that the tag pointed to. MAJOR FAIL.

Quite frankly, I think that's a git bug, but it's a git bug because "git fetch" was designed to get the commit to merge. Fair enough. Let's work around it, and rename the tag at the same time:

   [torvalds@i5 linux]$ git fetch
git://github.com/rustyrussell/linux.git
refs/tags/rusty@rustcorp.com.au-v3.1-8068-g5087a50:refs/tags/rusty
   From git://github.com/rustyrussell/linux
    * [new tag]
rusty@rustcorp.com.au-v3.1-8068-g5087a50 -> rusty
    * [new tag]
rusty@rustcorp.com.au-v3.1-2-gb1e4d20 ->
rusty@rustcorp.com.au-v3.1-2-gb1e4d20
    * [new tag]
rusty@rustcorp.com.au-v3.1-4896-g0acf000 ->
rusty@rustcorp.com.au-v3.1-4896-g0acf000
    * [new tag]
rusty@rustcorp.com.au-v3.1-8068-g5087a50 ->
rusty@rustcorp.com.au-v3.1-8068-g5087a50
WTF? Now we finally *did* get the tag, and we can do
   git verify-tag rusty

and that will work. But what the hell happened? We got three other tags too that we didn't even ask for!

So we have actual git bugs here, that relate to the fact that we've treated signed tags specially, and have magic code to basically say "if there's a signed tag that is reachable from the thing you pull, and you're not just doing a temporary pull into FETCH_HEAD, we'll fetch that signed tag too".

Again - not a fundamental design mistake in the data structures, and it actually made sense from a "signed tags are important release points" standpoint, but it makes it *really* inconvenient to use signed tags for signature verification.

Also, the fact that the signed tag gets peeled when we do fetch into FETCH_HEAD also means that we can't actually save the signature in resulting the merge commit. The merge, instead of being able to perhaps save the information that we merged a nice trusted signed point, only has the commit.

But practically, all of these issues should be pretty easily solvable. So it should be quite easy to make

    git pull <repo> <tag-name>

just do the right thing - including verifying the tag, and adding the information in the tag into the merge commit message.

So signed tags are not mis-designed from a conceptual standpoint - they just work really really awkwardly right now for what the kernel would like to do with them.

With a few UI fixes, I think the signed tag thing would "just work".

That said, I do think that the "signature in the pull request" should also "just work", and I'm not entirely sure which one is better. It might be more convenient to get the signature data from the pull request. So I'm not at all married the the notion of using signed tags for this.

                       Linus
Previous: Linus TorvaldsNext: Shawn Pearce
Message 35 of 81 in “Re: [git patches] libata updates, GPG signed (but see admin notes)”
  1. Ingo MolnarOct 31, 2011
  2. Junio C HamanoOct 31, 2011
  3. Ingo MolnarOct 31, 2011
  4. Junio C HamanoOct 31, 2011
  5. Ted Ts'oOct 31, 2011
  6. Junio C HamanoOct 31, 2011
  7. Linus TorvaldsOct 31, 2011
  8. H. Peter AnvinOct 31, 2011
  9. Linus TorvaldsOct 31, 2011
  10. H. Peter AnvinOct 31, 2011
  11. Linus TorvaldsOct 31, 2011
  12. Junio C HamanoOct 31, 2011
  13. Linus TorvaldsOct 31, 2011
  14. Ingo MolnarNov 2, 2011
  15. Jochen StriepeNov 2, 2011
  16. Junio C HamanoOct 31, 2011
  17. Junio C HamanoOct 31, 2011
  18. H. Peter AnvinOct 31, 2011
  19. Ted Ts'oOct 31, 2011
  20. H. Peter AnvinOct 31, 2011
  21. Linus TorvaldsOct 31, 2011
  22. H. Peter AnvinOct 31, 2011
  23. Linus TorvaldsOct 31, 2011
  24. James BottomleyNov 1, 2011
  25. Jeff GarzikOct 31, 2011
  26. H. Peter AnvinNov 1, 2011
  27. Jiri KosinaOct 31, 2011
  28. Junio C HamanoNov 1, 2011
  29. Linus TorvaldsNov 1, 2011
  30. Junio C HamanoNov 1, 2011
  31. Linus TorvaldsNov 2, 2011
  32. Junio C HamanoNov 2, 2011
  33. Shawn PearceNov 3, 2011
  34. Linus TorvaldsNov 3, 2011
  35. Linus TorvaldsNov 3, 2011
  36. Shawn PearceNov 3, 2011
  37. Linus TorvaldsNov 3, 2011
  38. Jochen StriepeNov 3, 2011
  39. Linus TorvaldsNov 3, 2011
  40. David WoodhouseNov 10, 2011
  41. Marc BranchaudNov 10, 2011
  42. Linus TorvaldsNov 3, 2011
  43. Linus TorvaldsNov 3, 2011
  44. Junio C HamanoNov 4, 2011
  45. Junio C HamanoNov 4, 2011
  46. Linus TorvaldsNov 4, 2011
  47. Jeff KingNov 5, 2011
  48. Junio C HamanoNov 5, 2011
  49. Junio C HamanoNov 3, 2011
  50. Junio C HamanoNov 3, 2011
  51. Linus TorvaldsNov 3, 2011
  52. Ted Ts'oNov 4, 2011
  53. Linus TorvaldsNov 4, 2011
  54. valdis.kletnieks@vt.eduNov 7, 2011
  55. Linus TorvaldsNov 7, 2011
  56. Junio C HamanoNov 5, 2011
  57. Linus TorvaldsNov 5, 2011
  58. Junio C HamanoNov 5, 2011
  59. Linus TorvaldsNov 6, 2011
  60. Junio C HamanoNov 9, 2011
  61. Johan HerlandNov 10, 2011
  62. Junio C HamanoNov 10, 2011
  63. Johan HerlandNov 10, 2011
  64. Junio C HamanoNov 10, 2011
  65. Johan HerlandNov 11, 2011
  66. Junio C HamanoNov 11, 2011
  67. Junio C HamanoNov 10, 2011
  68. Linus TorvaldsNov 3, 2011
  69. Junio C HamanoNov 4, 2011
  70. Linus TorvaldsNov 4, 2011
  71. Jeff KingNov 3, 2011
  72. Robin H. JohnsonNov 3, 2011
  73. Junio C HamanoNov 3, 2011
  74. Ted Ts'oNov 1, 2011
  75. Junio C HamanoNov 2, 2011
  76. david@lang.hmNov 2, 2011
  77. Linus TorvaldsNov 2, 2011
  78. David WoodhouseNov 10, 2011
  79. Michael J GruberNov 2, 2011
  80. Junio C HamanoNov 2, 2011
  81. Michael J GruberNov 2, 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.