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

[RFC PATCH v2 0/3] format-patch --complete / am --exact

From
Vegard Nossum <vegard.nossum@oracle.com>
Date
Oct 22, 2019, 11:45 UTC
Message-ID
<20191022114518.32055-1-vegard.nossum@oracle.com>

[I'm intentionally keeping the recipient list short to avoid hitting the Oracle spam filter on outgoing email, hopefully everybody on the git side who is interested will receive this via the mailing list and I will link this submission from the workflows list too.]

Background:

There seems to be a consensus in the Linux kernel development community that tracking patches, patchsets, reviews, and discussion of said patches is too difficult. One big problem is that there is often no reference to the email discussion in git history once the patch has been merged.

In order to simplify the tracking of patches, I proposed in [1] that we include enough metadata about a patch to reconstruct the commit SHA1s when emailing patches; this means that, assuming a patchset is based on a publicly available parent SHA1, we can track email patches in git and use the git SHA1 as a stable reference to a particular submission or its corresponding discussion. I basically view this as a foundation on which we can build a richer kernel development experience without sacrificing the current email-based workflow.

Since I started working on this feature, I also realised that 'git am' already has a mechanism to amend changelogs with a reference to the "Message-Id" of the email of a patch using the --message-id flag, and while this should IMHO be used a lot more for the kernel, it does not completely offset the utility of these patches.

I'm sending out an early v2 to get more feedback on the implementation, exact choice of flags and terminology (--exact, --complete, "metadata", etc.), changelogs.

Changes since v1:
 - moved metadata to the bottom of the diff
 - fixes to pass existing tests (0023, 3403, 4150, 4256, 5100)
 - handles format=flowed (best effort)
 - better changelogs
 - documentation
 - new tests
Todo:
 - 'git am --no-exact' _with_ known metadata could append the original
   sha1 (and/or mail reference) to the changelog
 - UTF-8/non-ASCII encodings
 - 'git am' error handling (e.g. wrong base)
 - more tests: --range-diff, --base=auto, 'am -s', etc.
 - GPG-signed commits [2]
Out of scope for now:
 - Ted's suggestion of a new flag for the base [3]
 - in-transit mangling
 - minisigs
 - empty commits and/or merge commits [4]

[1] https://lore.kernel.org/workflows/b9fb52b8-8168-6bf0-9a72-1e6c44a281a5@oracle.com/ [2] https://lore.kernel.org/workflows/56664222-6c29-09dc-ef78-7b380b113c4a@oracle.com/ [3] https://lore.kernel.org/workflows/20191017144708.GI25548@mit.edu/ [4] https://lore.kernel.org/workflows/xmqqeezc83i6.fsf@gitster-ct.c.googlers.com/

Next: Vegard Nossum
Message 1 of 7 in “format-patch --complete / am --exact”
  1. 0/3 format-patch --complete / am --exactVegard Nossum, Oct 22, 2019
  2. 1/3 format-patch: add --completeVegard Nossum, Oct 22, 2019
  3. 2/3 mailinfo: collect commit metadata from mailVegard Nossum, Oct 22, 2019
  4. brian m. carlsonOct 27, 2019
  5. Vegard NossumOct 28, 2019
  6. brian m. carlsonOct 29, 2019
  7. 3/3 am: add --exactVegard Nossum, Oct 22, 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.