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

Re: Round-tripping fast-export/import changes commit hashes

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 28, 2021, 10:34 UTC
Message-ID
<87mtvolbuj.fsf@evledraar.gmail.com>
In-Reply-To
<CAPkN8xK9__74a3aEFsevfdW_hQ-vzWE+c=QypRacTktuZOfdSw@mail.gmail.com>
On Sun, Feb 28 2021, anatoly techtonik wrote:
Show 8 quoted lines
> On Sat, Feb 27, 2021 at 8:49 PM Elijah Newren <newren@gmail.com> wrote:
>>
>> Your second commit is signed.  Fast-export strips any extended headers
>> on commits, such as GPG signatures, because there's no way to keep
>> them in general.
>
> Why is it not possible to encode them with base64 and insert into the
> stream?

I think Elijah means that in the general case people are using fast export/import to export/import between different systems or in combination with a utility like git-filter-repo.

In those cases users are also changing the content of the repository, so the hashes will change, invalidating signatures.

But there's also cases where e.g. you don't modify the history, or only part of it, and could then preserve these headers. I think there's no inherent reason not to do so, just that nobody's cared enough to submit patches etc.

Show 8 quoted lines
>> There are also other things that will prevent a simple fast-export |
>> fast-import pipeline from preserving your history as-is besides signed
>> commits (most of these are noted in the "Inherited Limitations"
>> section over at
>> https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html):
>
> Is there any way to check what commits will be altered as a result of
> `fast-export` and why? Right now I don't see that it is reported.

I don't think so, but not being very familiar with fast export/import I don't see why it shouldn't have some option to not munge data like that, or to report it, if someone cared enough to track those issues & patch it...

Show 17 quoted lines
>> Hope that at least explains things for you, even if it doesn't give
>> you a workaround or a solution.
>
> Thanks. That is very helpful to know.
>
> The reason I am asking is because I tried to merge two repos with
> `reposurgeon` which operates on `fast-export` data. It is basically
> merging GitHub wiki into main repo,
>
> After successfully merging them I still can not send a PR, because
> it produces a huge amount of changes, because of the stripped info.
> It can be seen here:
>
> https://github.com/simons-public/protonfixes/compare/master...techtonik:master
>
> I tracked this behaviour in `reposurgeon` in this issue
> https://gitlab.com/esr/reposurgeon/-/issues/344
Previous: anatoly techtonikNext: anatoly techtonik
Message 4 of 21 in “Round-tripping fast-export/import changes commit hashes”
  1. anatoly techtonikFeb 27, 2021
  2. Elijah NewrenFeb 27, 2021
  3. anatoly techtonikFeb 28, 2021
  4. Ævar Arnfjörð BjarmasonFeb 28, 2021
  5. anatoly techtonikMar 1, 2021
  6. Junio C HamanoMar 1, 2021
  7. anatoly techtonikMar 2, 2021
  8. Johannes SixtMar 3, 2021
  9. Junio C HamanoMar 4, 2021
  10. anatoly techtonikAug 9, 2021
  11. Elijah NewrenAug 9, 2021
  12. anatoly techtonikAug 10, 2021
  13. Elijah NewrenAug 10, 2021
  14. anatoly techtonikDec 11, 2022
  15. Elijah NewrenJan 13, 2023
  16. Elijah NewrenMar 1, 2021
  17. Ævar Arnfjörð BjarmasonMar 1, 2021
  18. Elijah NewrenMar 1, 2021
  19. anatoly techtonikMar 2, 2021
  20. Ævar Arnfjörð BjarmasonMar 1, 2021
  21. anatoly techtonikMar 2, 2021

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.