summaryrefslogtreecommitdiff
path: root/fsck-cache.c
AgeCommit message (Collapse)AuthorFilesLines
2005-06-05git-fsck-cache: complain if no default references foundLibravatar Linus Torvalds1-9/+11
2005-05-25Make "parse_object()" also fill in commit message buffer data.Libravatar Linus Torvalds1-0/+2
And teach fsck to free it to save memory.
2005-05-20[PATCH] delta checkLibravatar Nicolas Pitre1-3/+52
This adds knowledge of delta objects to fsck-cache and various object parsing code. A new switch to git-fsck-cache is provided to display the maximum delta depth found in a repository. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-20fsck-cache: fix segfault on nonexistent referenced objectLibravatar Linus Torvalds1-4/+8
Noted by Frank Sorenson and Petr Baudis, patch rewritten by me.
2005-05-19[PATCH] cleanup of in-code namesLibravatar Alexey Nezhdanov1-2/+2
Fixes all in-code names that leaved during "big name change". Signed-off-by: Alexey Nezhdanov <snake@penza-gsm.ru> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-18fsck-cache: read the default reference information even whenLibravatar Linus Torvalds1-4/+4
not doing reachability analysis. This avoids the dangling head problem, and means that just a plain "git-fsck-cache" with no parameters will DTRT.
2005-05-18fsck-cache: walk the 'refs' directory if the user doesn't give anyLibravatar Linus Torvalds1-9/+74
explicit references for reachability analysis. We already had that as separate logic in git-prune-script, so this is not a new special case - it's an old special case moved into fsck, making normal usage be much simpler.
2005-05-07Notice tree objects with duplicate entries.Libravatar Junio C Hamano1-3/+21
This is a follow-up fix to the earlier "Notice index that has path and path/file and refuse to write such a tree" patch. With this fix, git-fsck-cache complains if a tree object stores more than one entries with the same name. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-05-07Introduce SHA1_FILE_DIRECTORIES to support multiple object databases.Libravatar Junio C Hamano1-1/+1
SHA1_FILE_DIRECTORIES environment variable is a colon separated paths used when looking for SHA1 files not found in the usual place for reading. Creating a new SHA1 file does not use this alternate object database location mechanism. This is useful to archive older, rarely used objects into separate directories. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-05-05Be more careful about tree entry modes.Libravatar Linus Torvalds1-0/+22
The tree object parsing used to get the executable bit wrong, and didn't know about symlinks. Also, fsck really wants the full mode value so that it can verify the other bits for sanity, so save it all in struct tree_entry.
2005-05-04Merge http://members.cox.net/junkio/git-jc.git/Libravatar Linus Torvalds1-4/+24
2005-05-04Teach fsck-cache to accept non-commits for reachability analysis.Libravatar Linus Torvalds1-5/+3
In particular, teach it about tags. Also, to make reachability actually work for tags, we need to add the ref to the tagged object.
2005-05-04Git-prune-script loses blobs referenced from an uncommitted cache.Libravatar Junio C Hamano1-4/+24
(updated from the version posted to GIT mailing list). When a new blob is registered with update-cache, and before the cache is written as a tree and committed, git-fsck-cache will find the blob unreachable. This patch adds a new flag, "--cache" to git-fsck-cache, with which it keeps such blobs from considered "unreachable". The git-prune-script is updated to use this new flag. At the same time it adds .git/refs/*/* to the set of default locations to look for heads, which should be consistent with expectations from Cogito users. Without this fix, "diff-cache -p --cached" after git-prune-script has pruned the blob object will fail mysteriously and git-write-tree would also fail. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-05-03fsck-cache: fix SIGSEGV on bad tag objectLibravatar Linus Torvalds1-5/+8
fsck_tag() failes to notice that the parsing of the tag may have failed in the parse_object() call on the object that it is tagging. Noticed by Junio. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-02fsck-cache: report broken links correctlyLibravatar Linus Torvalds1-1/+1
We reported the type of te missing object incorrectly: we reported it as the type of the referrer object, not the object that was referred to.
2005-05-02Make fsck-cache do better tree checking.Libravatar Linus Torvalds1-1/+57
We check the ordering of the entries, and we verify that none of the entries has a slash in it (this allows us to remove the hacky "has_full_path" member from the tree structure, since we now just test it by walking the tree entries instead).
2005-05-02fsck-cache: sort entries by inode numberLibravatar Linus Torvalds1-16/+73
This improves the cold-cache behaviour on most filesystems, since it makes the fsck access patterns more regular on the disk, rather than seeking back and forth. Note the "most". Not all filesystems have any relationship between inode number and location on disk.
2005-05-01Add "get_sha1()" helper function.Libravatar Linus Torvalds1-1/+1
This allows the programs to use various simplified versions of the SHA1 names, eg just say "HEAD" for the SHA1 pointed to by the .git/HEAD file etc. For example, this commit has been done with git-commit-tree $(git-write-tree) -p HEAD instead of the traditional "$(cat .git/HEAD)" syntax.
2005-04-30Make git-fsck-cache error printouts a bit more informative.Libravatar Linus Torvalds1-12/+18
Show the types of objects involved in broken links, and don't bother warning about unreachable tag files (if somebody cares about tags, they'll use the --tags flag to see them).
2005-04-30Fix up d_type handling - we need to include <dirent.h> beforeLibravatar Linus Torvalds1-2/+1
we play with the d_type compatibility macros.
2005-04-29[PATCH] git-fsck-cache: Gracefully handle non-commit IDsLibravatar Jonas Fonseca1-1/+8
Gracefully handle non-commit IDs instead of segfaulting. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] Rework fsck-cache to use parse_object()Libravatar Daniel Barkalow1-87/+34
With support for parse_object() and tags in the core, fsck_cache can just call them, and can be simplified a bit. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-25fsck-cache: show root objects only with "--root"Libravatar Linus Torvalds1-1/+6
This makes the default fsck behaviour be quiet for a repository that doesn't have any problems. Which is good.
2005-04-25fsck-cache: only show tags if asked to do so with "--tags"Libravatar Linus Torvalds1-5/+25
Normally we don't care, we just check them for being valid tag objects.
2005-04-25Make "fsck" also show what the name of the tag object is, not justLibravatar Linus Torvalds1-3/+6
the name of the object it tags. You need this if you actually want to build up a list of tags.
2005-04-25Add "tag" objects that can be used to sign other objects.Libravatar Linus Torvalds1-0/+39
You use "git-mktag" to create them, and fsck-cache knows how to parse them.
2005-04-24fsck-cache: warn about missing commit datesLibravatar Linus Torvalds1-0/+2
Now that we have hopefully converted all old archives, we can consider it an error.
2005-04-24fsck-cache: notice missing "blob" objects.Libravatar Linus Torvalds1-1/+9
We should _not_ mark a blob object "parsed" just because we looked it up: it gets marked that way only once we've actually seen it. Otherwise we can never notice a missing blob.
2005-04-20Do SHA1 hash _before_ compression.Libravatar Linus Torvalds1-5/+6
And add a "convert-cache" program to convert from old-style to new-style.
2005-04-18Make fsck-cache print the object type for unreachable objects.Libravatar Linus Torvalds1-1/+1
This got lost when I updated to Daniel's new object model.
2005-04-18Merge the new object model thing from Daniel BarkalowLibravatar Linus Torvalds1-70/+35
This was a real git merge with conflicts. I'll commit the scripts I used to do the merge next. Not pretty, but it's half-way functional.
2005-04-18[PATCH] Port fsck-cache to use parsing functionsLibravatar Daniel Barkalow1-70/+36
This ports fsck-cache to use parsing functions. Note that performance could be improved here by only reading each object once, but this requires somewhat more complicated flow control. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17Make the revision tracking track the object types too.Libravatar Linus Torvalds1-12/+12
This allows fsck to verify not just that an object exists, but also that it has the type it was expected to have.
2005-04-17Make "revision.h" slightly better to use.Libravatar Linus Torvalds1-1/+1
- mark_reachable() can be more generic, marking the reachable revisions with an arbitrary mask. - date parsing will parse to a date of 0 rather than ULONG_MAX for the bad old case, sorting the dates correctly.
2005-04-13Use common "revision.h" header for both fsck and rev-tree.Libravatar Linus Torvalds1-110/+1
It's really a very generic thing: the notion of one sha1 revision referring to another one. "fsck" uses it for all nodes, and "rev-tree" only tracks commit-node relationships, but the code was already the same - now we just make that explicit by moving it to a common header file.
2005-04-13Make 'fsck' able to take an arbitrary number of parents on theLibravatar Linus Torvalds1-14/+19
command line. "arbitrary" is a bit wrong, since it is limited by the argument size limit (128kB or so), but let's see if anybody ever cares. Arguably you should prune your tree before you have a few thousand dangling heads in your archive. We can fix it by passing in a file listing if we ever care.
2005-04-13Make fsck reachability avoid doing unnecessary work forLibravatar Linus Torvalds1-0/+3
parents that we reach multiple ways. This doesn't matter right now. It _will_ matter once we have complex revision graphs.
2005-04-13Make "fsck-cache" use the same revision tracking structure as "rev-tree".Libravatar Linus Torvalds1-76/+133
This makes things a lot more efficient, and makes it trivial to do things like reachability analysis. Add command line flags to tell what the head is, and whether to warn about unreachable objects.
2005-04-13[PATCH] Consolidate the error handlingLibravatar Petr Baudis1-2/+1
Now there is error() for "library" errors and die() for fatal "application" errors. usage() is now used strictly only for usage errors. Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-04-10Oops. Fix bad initialization of the "seen" array, causing us to notLibravatar Linus Torvalds1-1/+1
properly clear the reference count at init time. It happened to work for me by pure luck. Until it broke, and my unreferenced commit suddenly looked referenced again. Fixed.
2005-04-10Oops, the actual 'printf' for missing objects was missing.Libravatar Linus Torvalds1-0/+1
Which made fsck very quiet about objects it hadn't found. So add it. We'll need to make things like these optional, because it's perfectly ok to have partial history if you don't want it, and don't want to go backwards. But for development, it's best to always complain about missing sha1 object files that are referenced from somewhere else.
2005-04-10Add connectivity tracking to fsck.Libravatar Linus Torvalds1-4/+100
This shows that I've lost track of one commit already. Most likely because I forgot to update the .dircache/HEAD file when doing a commit, so that the next commit referenced not the top-of-tree, but the one older commit. Having dangling commits is fine (in fact, you should always have at least _one_ dangling commit in the top-of-tree). But it's good to know about them.
2005-04-09Make fsck-cache warn about old-style tree objects that have fullLibravatar Linus Torvalds1-0/+9
pathnames in them. We're migrating away from that. This will cause tons of warnings for the current "sparse" archive, but hell, better now than later.
2005-04-09Teach "fsck" and "read-tree" about recursive tree-nodes.Libravatar Linus Torvalds1-2/+3
This is totally untested, since we can't actually _write_ things that way yet, but I'll get to that next, I hope. That should fix the huge wasted space for kernel-sized tree objects.
2005-04-09Make "fsck-cache" print out all the root commits it finds.Libravatar Linus Torvalds1-0/+5
Once I do the reference tracking, I'll also make it print out all the HEAD commits it finds, which is even more interesting.
2005-04-09Fix missing return values and some error tests for empty index filesLibravatar Linus Torvalds1-0/+2
Patches from Dave Jones and Ingo Molnar, but since I don't have any infrastructure in place to use the old patch applicator scripts I am trying to build up, I ended up fixing the thing by hand instead. Credit where credit is due, though. Nice to see that people are taking a look at the project even in this early stage.
2005-04-08Make fsck-cache start parsing the object types, and checking theirLibravatar Linus Torvalds1-11/+42
internal format. This doesn't yet check the reachability information, but we're getting there.. Slowly.
2005-04-08Add first cut at "fsck-cache" that validates the SHA1 object store.Libravatar Linus Torvalds1-0/+106
It doesn't complain about mine. But it also doesn't yet check for inter-object reachability etc.