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

Re: [PATCH v3] commit-tree: add missing --gpg-sign flag

From
Brandon Richardson <brandon1024.br@gmail.com>
Date
Jan 19, 2019, 18:05 UTC
Message-ID
<CAETBDP5Ve=85Jtkb55=htPO1eiZQmqG7deUX_BF6ih259gY-XQ@mail.gmail.com>
In-Reply-To
<20190119154552.12189-1-martin.agren@gmail.com>
Hi Martin,
Show 17 quoted lines
> I looked into this test in a bit more detail, and it seems to be quite
> hard to get right. Part of the reason is that `git commit-tree` requires
> a bit more careful use than `git commit`, but part of it is that the
> tests that we already have for `git commit-tree [-S]` right before the
> ones you're adding are a bit too loose, IMHO. So they're not ideal for
> copy-pasting... I've come up with the patch below, which you might want
> to use as a basis for your work.
>
> That is, you could `git am --scissors` this patch on a fresh branch and
> `git commit --amend --signoff --no-edit` it (see
> Documentation/SubmittingPatches, "forwarding somebody else's patch"),
> then base your work on it, e.g., by cherry-picking your v3 commit.
>
> I think you would want to add 2x3 lines of tests (3 for `--gpg-sign`, 3
> for `--gpg-sign=...`). That would give you eleventh-signed and
> twelfth-signed and you wouldn't need any invocation of `git commit` (so
> no thirteenth-signed).

Just finished adding in the changes you suggested, and everything looks good on my end. I based my changes on the patch you provided.

> Or, a bit simpler:
>
>   oid=$(echo 10 | git commit-tree -S HEAD^{tree}) &&
>   git tag tenth-signed "$oid"

Just noticed your latest email. Do you prefer it this way? If so, I can amend what I have before I submit v4.

When I submit v4, should I submit the patch you created as well, given that my changes are based off of it?

Brandon
Previous: Martin ÅgrenNext: Martin Ågren
Message 4 of 6 in “commit-tree: add missing --gpg-sign flag”
  1. commit-tree: add missing --gpg-sign flagBrandon Richardson, Jan 19, 2019
  2. Martin ÅgrenJan 19, 2019
  3. Martin ÅgrenJan 19, 2019
  4. Brandon RichardsonJan 19, 2019
  5. Martin ÅgrenJan 19, 2019
  6. Brandon RichardsonJan 19, 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.