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

Re: Making GitGitGadget conversion lossless

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 26, 2020, 22:27 UTC
Message-ID
<xmqqo8tlgf2f.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20200226213515.t2aa4o4nquaaz6vg@chatter.i7.local>
Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:
Show 23 quoted lines
> On Wed, Feb 26, 2020 at 01:01:15PM -0800, Junio C Hamano wrote:
>> Isn't this already available by recording the base-commit
>> information?
>> 
>> > - author/committer information
>> > - cryptographic attestation (gpgsig)
>> 
>> I think you are aiming to come up with bit-for-bit identical commit
>> the sender had, and I would imagine that the easiest and least
>> disruptive way to do so is to add a compressed and ascii-armored
>> copy of "git cat-file commit" output of the original commit after
>> the "---" line before the diff/diffstat of the e-mailed patch.  The
>> receiving end can then act on it when given some option by
>> 
>>  - first recover the contents of the commit object (call it #1);
>>  - learn the parent commit(s) and check out the tree;
>>  - apply the patch in the remainder of the patch e-mail to the tree;
>>  - make sure that the result of patch application gives the tree object
>>    recorded in #1;
>>  - run "hash-object -t commit -w" over #1 that gives you a commit
>>    object that is bit-for-bit identical.
>
> Right, I just don't want to be doing this in a separate tool. :)

Yes, and I just outlined how it can be expressed in the "format-patch" output format, and implemented on the "am" side, as part of "git".

Previous: Konstantin Ryabitsev
Message 5 of 5 in “Making GitGitGadget conversion lossless”
  1. Konstantin RyabitsevFeb 26, 2020
  2. Junio C HamanoFeb 26, 2020
  3. Vegard NossumFeb 26, 2020
  4. Konstantin RyabitsevFeb 26, 2020
  5. Junio C HamanoFeb 26, 2020

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.