Re: Making GitGitGadget conversion lossless
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 26, 2020, 21:01 UTC
- Message-ID
- <xmqq5zfthxlw.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20200226200929.z4aej74ohbkgcdza@chatter.i7.local>
Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:
> - parent/tree hashes
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.
As I said already, I do not think that the desire to get the bit-for-bit identical commit is compatible with the idea to discuss e-mailed patches---the pieces of patch e-mail will become "you may look at them, you may apply them, but it is no use to comment on them to get them improved". So, I dunno.