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

Re: [RFC/PATCH 1/1] format-patch: add an option to record base tree info

From
Jacob Keller <jacob.keller@gmail.com>
Date
Feb 22, 2016, 07:30 UTC
Message-ID
<CA+P7+xqotNdbKHB4jbzEKZ7brPtz4vrg9HGBmia-aV2Z-kC=aQ@mail.gmail.com>
In-Reply-To
<xmqqmvqt8jgz.fsf@gitster.mtv.corp.google.com>
On Sun, Feb 21, 2016 at 8:19 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> If you are OK with accepting a patch application to a tree with the
> same blobs the diff was taken from, then the format-patch output
> already has all the necessary information.  For each "diff --git"
> part, there is the "index $old..$new" line that records preimage and
> postimage blob object ID, so you should be able to find a tree that
> has the matching blobs in the paths mentioned in the patch, and it
> is guaranteed that the patch would apply cleanly to such a tree.
>
> Of course, that requires the recipient of the patch to have the all
> the blobs mentioned as the preimage in the patch, but it would be a
> reasonable assumption, as your patch assumes that the recipient has
> the commit, and if he has a commit by definition he would have all
> the blobs recorded by that commit.
>

Sorry for a sort of tangent here, but what method would you recommend for asking git to locate a commit which matches all those blobs? Is there any already existing plumbing to do such a thing?

Regards, Jake

Previous: Junio C HamanoNext: Fengguang Wu
Message 4 of 29 in “Add an option to git-format-patch to record base tree info”
  1. 0/1 Add an option to git-format-patch to record base tree infoXiaolong Ye, Feb 22, 2016
  2. 1/1 format-patch: add an option to record base tree infoXiaolong Ye, Feb 22, 2016
  3. Junio C HamanoFeb 22, 2016
  4. Jacob KellerFeb 22, 2016
  5. Fengguang WuFeb 23, 2016
  6. Junio C HamanoFeb 23, 2016
  7. Fengguang WuFeb 23, 2016
  8. H. Peter AnvinFeb 23, 2016
  9. Fengguang WuFeb 23, 2016
  10. Dan CarpenterFeb 23, 2016
  11. Fengguang WuFeb 23, 2016
  12. Dan CarpenterFeb 23, 2016
  13. Fengguang WuFeb 24, 2016
  14. Junio C HamanoFeb 24, 2016
  15. Fengguang WuFeb 24, 2016
  16. Junio C HamanoFeb 24, 2016
  17. Junio C HamanoFeb 23, 2016
  18. Eric W. BiedermanFeb 23, 2016
  19. Junio C HamanoFeb 23, 2016
  20. H. Peter AnvinFeb 23, 2016
  21. Eric W. BiedermanFeb 23, 2016
  22. H. Peter AnvinFeb 24, 2016
  23. Stefan BellerFeb 23, 2016
  24. Michael J GruberFeb 24, 2016
  25. Junio C HamanoFeb 24, 2016
  26. Fengguang WuFeb 24, 2016
  27. Fengguang WuFeb 24, 2016
  28. Eric W. BiedermanFeb 23, 2016
  29. Fengguang WuFeb 24, 2016

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.