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

Commits gone AWOL, but not reported by git-fsck --unreachable

From
Robin H. Johnson <robbat2@gentoo.org>
Date
May 19, 2007, 10:30 UTC
Message-ID
<20070519103011.GU17511@curie-int.orbis-terrarum.net>

Background: ----------- Using git-svn to work with an external project (non-public), and the other day I happened to run 'git-svn dcommit' right as their SVN went down for a moment (under 5 seconds) for the snapshot-backup. I recall swearing profusely at the time, but thought nothing of it after that, until now, when I saw that parts of my tree weren't as they should be.

Problem: -------- A bunch of my commits are NOT present in git-log, git-rev-list, or any tool that provides the history of my branches.

If I hack around and recover the commitid, I can pass it to git-show, and the commit does still exist in the data.

git-fsck --unreachable does not list the commit in question either, but does list other blobs and trees.

Luckily, since the entire tree had ~900 commits, I was able to work some
magic and recovery my work:
1. Hack to get list of all commits
2. Exclude all commits that had git-svn-id in their description.
3. Exclude all merges.
4. Manually review all remaining commits (~70).

The following questions are mainly things that would have made my recovery far easier.

Questions:
----------
1. Is there a plumbing tool to list EVERY single object of a given type
   (blob, tree, commit, tag) that git is aware of, regardless of it
   being reachable? (Right now I have a hack to read the pack index, and
   use find to find the non-packed object ids, then git-cat-file -t for
   the type).
2. A sane way to view an ordered set of commits, so that it should be
   possible to spot when there's a path of commits that went off and
   isn't used anymore.
3. Given a set of commits, list which are actually unique (in my tree,
   git-svn uses rebase often, so I have a lot of commits that are
   identical bar the commitid).
4. Strongly related to #4, given everything a commit, tell me what other
   identical commits exist in the tree.
-- 
Robin Hugh Johnson
Gentoo Linux Developer & Council Member
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
Next: Jeff King
Message 1 of 17 in “Commits gone AWOL, but not reported by git-fsck --unreachable”
  1. Robin H. JohnsonMay 19, 2007
  2. Jeff KingMay 19, 2007
  3. Robin H. JohnsonMay 19, 2007
  4. Jeff KingMay 19, 2007
  5. Anand KumriaMay 19, 2007
  6. Matthieu MoyMay 19, 2007
  7. Brian GernhardtMay 19, 2007
  8. Matthieu MoyMay 19, 2007
  9. Brian GernhardtMay 19, 2007
  10. Junio C HamanoMay 19, 2007
  11. Cross-reference the manpages for git-name-rev and git-describe (was Re: Commits gone AWOL, but not reported by git-fsck --unreachable)Matthieu Moy, May 20, 2007
  12. Shawn O. PearceMay 21, 2007
  13. Junio C HamanoMay 21, 2007
  14. Shawn O. PearceMay 21, 2007
  15. Matthieu MoyMay 21, 2007
  16. Junio C HamanoMay 22, 2007
  17. Shawn O. PearceMay 22, 2007

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.