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

Round-tripping fast-export/import changes commit hashes

From
anatoly techtonik <techtonik@gmail.com>
Date
Feb 27, 2021, 12:31 UTC
Message-ID
<CAPkN8xK7JnhatkdurEb16bC0wb+=Khd=xJ51YQUXmf2H23YCGw@mail.gmail.com>
Hi.

I can't get the same commit hashes after fast-export and then fast-import of this repository without any edits https://github.com/simons-public/protonfixes I have no idea what causes this, and how to prevent it from happening. Are there any workarounds?

What did you do before the bug happened? (Steps to reproduce your issue)
  #!/bin/bash
  git clone https://github.com/simons-public/protonfixes.git
  git -C protonfixes log --format=oneline | tail -n 4
  git init protoimported
  git -C protonfixes fast-export --all --reencode=no | (cd
protoimported && git fast-import)
  git -C protoimported log --format=oneline | tail -n 4
What did you expect to happen? (Expected behavior)
  Expect imported repo to match exported.
What happened instead? (Actual behavior)
  All hashes are different, the exported repo diverged on the second commit.
What's different between what you expected and what actually happened?
  The log of hashes from initial repo:
    + git -C protonfixes log --format=oneline
    + tail -n 4
    1c0cf2c8e742e673dba9fd1a09afd12a25c25571 Update README.md
    367d61f9b2a799accbdaeed5d64f9be914ca0f7a Updated zip link
    d3d24b63446c7d06586eaa51764ff0c619113f09 Update README.md
    7a43ca89ff7a70127ac9ca0f10b6eaaa34f2f69c Initial commit
  The log from imported repo:
    + git -C protoimported log --format=oneline
    + tail -n 4
    a27ec5d2e4c562f40e693e0b4149959d2b69bf21 Update README.md
    e59cf92be79c47984e9f94bfad912e5a29dfa5e0 Updated zip link
    fb6498f62af783d2e943770f90bc642cf5c9ec9c Update README.md
    7a43ca89ff7a70127ac9ca0f10b6eaaa34f2f69c Initial commit

[System Info] git version: git version 2.31.0.rc0 cpu: x86_64 built from commit: 225365fb5195e804274ab569ac3cc4919451dc7f sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.8.0-43-generic #49-Ubuntu SMP Fri Feb 5 03:01:28 UTC 2021 x86_64 compiler info: gnuc: 10.2 libc info: glibc: 2.32 $SHELL (typically, interactive shell): /usr/bin/zsh

[Enabled Hooks] not run from a git repository - no hooks to show

-- 
anatoly t.
Next: Elijah Newren
Message 1 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.