[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Have git SHA1 ID's changed in the last 5 years?
From: |
Mark Polesky |
Subject: |
Re: Have git SHA1 ID's changed in the last 5 years? |
Date: |
Sat, 26 Jul 2014 21:00:32 -0700 |
Okay, so I'm not crazy. I happened to keep an old repo from
four years ago, and as you can see from the attached image,
the two histories are not the same, and neither are the
commit SHA1 IDs... How did this happen, and could it happen
again?
I would've thought that referring to commit IDs was pretty
safe, and since we refer to a bunch of them in the source
code (at least 165 unique IDs by my count), it would be a
shame if this happens again. Here's a little bash command
sequence that turns up 16 references to commit IDs in the
source code that `git show' cannot find:
git grep -hwI '[0-9a-f]\{40\}' |
sed 's/.*\([0-9a-f]\{40\}\).*/\1/' |
sort -u > SHA1-refs.tmp &&
for i in `cat SHA1-refs.tmp`; do
git show $i &> /dev/null || git grep -n $i | cat;
done &&
rm SHA1-refs.tmp
- Mark
git-histories.png
Description: PNG image