1

My conditions are:

  1. I have a source codes tar ball file, e.g. binutils-gdb.tar.gz
  2. I know that it's from git://sourceware.org/git/binutils-gdb.git
  3. But I've no ".git" directory in binutils-gdb.tar.gz, it means I don't know which version or commit the binutils-gdb.tar.gz is from

My question: How can I know which version or commit in git://sourceware.org/git/binutils-gdb.git generating my current binutils-gdb.tar.gz?

I know that if I check the files in binutils-gdb.tar.gz one by one, e.g. the version file, it's possible I could get the correct version or commits for the binutils.tar.gz in git://sourceware.org/git/binutils-gdb.git But this kind of manual checking work is too tedious, do we have some tools/scripts to do this work?

Thanks in advance!!!

Clock ZHONG
  • 875
  • 9
  • 23

1 Answers1

1

You can:

  1. extract the all the files in tar.gz
  2. clone git repo
  3. compare both trees
  4. if all files are equal HEAD is the commit in the tar.gz
  5. else checkout HEAD~1
  6. go to compare
Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134