aboutsummaryrefslogtreecommitdiff
path: root/fsck-cache.c
Commit message (Collapse)AuthorAge
* [PATCH] alternate object store and fsckv0.99Junio C Hamano2005-07-10
| | | | | | | | | | | | The location alt_odb[j].name[0..] is filled with ??/?{38} to form a sha1 filename to try, but I was too lazy to allocate a copy, so while fsck_object_dir() is running for the directory, the filenames ??/?{38} are filled after NUL (usually and always the location should have '/'), making them "not found". This should fix it. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* git-fsck-cache: don't complain about lacking references when they are all in ↵Linus Torvalds2005-07-07
| | | | | | | packs. We used to not count them at all, which then made us complain that there were no refs.
* Make git-fsck-cache check HEAD integrityLinus Torvalds2005-07-03
| | | | | | | In particular, check that it's a symlink, and points to refs/heads/. We depend on that these days not only for "git checkout", but also because fsck and others only check for references in the .git/refs/ subdirectory, not things like HEAD itself.
* Fix up "for_each_ref()" to be more usable, and use it in git-fsck-cacheLinus Torvalds2005-07-03
| | | | | It needed to take the GIT_DIR information into account, something that the original receive-pack usage just never cared about.
* [PATCH] verify-pack updates.Junio C Hamano2005-06-30
| | | | | | | | | | | | | | | | | | | | Nico pointed out that having verify_pack.c and verify-pack.c was confusing. Rename verify_pack.c to pack-check.c as suggested, and enhances the verification done quite a bit. - Built-in sha1_file unpacking knows that a base object of a deltified object _must_ be in the same pack, and takes advantage of that fact. - Earlier verify-pack command only checked the SHA1 sum for the entire pack file and did not look into its contents. It now checks everything idx file claims to have unpacks correctly. - It now has a hook to give more detailed information for objects contained in the pack under -v flag. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] Add git-verify-pack command.Junio C Hamano2005-06-29
| | | | | | | | | | | | | | | | | | | | | Given a list of <pack>.idx files, this command validates the index file and the corresponding .pack file for consistency. This patch also uses the same validation mechanism in fsck-cache when the --full flag is used. During normal operation, sha1_file.c verifies that a given .idx file matches the .pack file by comparing the SHA1 checksum stored in .idx file and .pack file as a minimum sanity check. We may further want to check the pack signature and version when we map the pack, but that would be a separate patch. Earlier, errors to map a pack file was not flagged fatal but led to a random fatal error later. This version explicitly die()s when such an error is detected. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] Update fsck-cache (take 2)Junio C Hamano2005-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | The fsck-cache complains if objects referred to by files in .git/refs/ or objects stored in files under .git/objects/??/ are not found as stand-alone SHA1 files (i.e. found in alternate object pools GIT_ALTERNATE_OBJECT_DIRECTORIES or packed archives stored under .git/objects/pack). Although this is a good semantics to maintain consistency of a single .git/objects directory as a self contained set of objects, it sometimes is useful to consider it is OK as long as these "outside" objects are available. This commit introduces a new flag, --standalone, to git-fsck-cache. When it is not specified, connectivity checks and .git/refs pointer checks are taught that it is OK when expected objects do not exist under .git/objects/?? hierarchy but are available from an packed archive or in an alternate object pool. Another new flag, --full, makes git-fsck-cache to check not only the current GIT_OBJECT_DIRECTORY but also objects found in alternate object pools and packed GIT archives.a Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] Remove "delta" object representation.Junio C Hamano2005-06-27
| | | | | | | | | | | Packed delta files created by git-pack-objects seems to be the way to go, and existing "delta" object handling code has exposed the object representation details to too many places. Remove it while we refactor code to come up with a proper interface in sha1_file.c. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Don't ignore reachability of tag objects in fsckLinus Torvalds2005-06-22
| | | | | | | | We used to ignore unreachable tags, which just causes problems: it makes "git prune" leave them around, but since we'll have prune everything that tag points to, the tag object really should be removed too. So remove the code that made us think tags were always reachable.
* git-fsck-cache: complain if no default references foundLinus Torvalds2005-06-05
|
* Make "parse_object()" also fill in commit message buffer data.Linus Torvalds2005-05-25
| | | | And teach fsck to free it to save memory.
* [PATCH] delta checkNicolas Pitre2005-05-20
| | | | | | | | | 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>
* fsck-cache: fix segfault on nonexistent referenced objectLinus Torvalds2005-05-20
| | | | Noted by Frank Sorenson and Petr Baudis, patch rewritten by me.
* [PATCH] cleanup of in-code namesAlexey Nezhdanov2005-05-19
| | | | | | | 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>
* fsck-cache: read the default reference information even whenLinus Torvalds2005-05-18
| | | | | | | not doing reachability analysis. This avoids the dangling head problem, and means that just a plain "git-fsck-cache" with no parameters will DTRT.
* fsck-cache: walk the 'refs' directory if the user doesn't give anyLinus Torvalds2005-05-18
| | | | | | | | 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.
* Notice tree objects with duplicate entries.Junio C Hamano2005-05-07
| | | | | | | | | 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>
* Introduce SHA1_FILE_DIRECTORIES to support multiple object databases.Junio C Hamano2005-05-07
| | | | | | | | | | 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>
* Be more careful about tree entry modes.Linus Torvalds2005-05-05
| | | | | | | 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.
* Merge http://members.cox.net/junkio/git-jc.git/Linus Torvalds2005-05-04
|\
| * Git-prune-script loses blobs referenced from an uncommitted cache.Junio C Hamano2005-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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>
* | Teach fsck-cache to accept non-commits for reachability analysis.Linus Torvalds2005-05-04
|/ | | | | In particular, teach it about tags. Also, to make reachability actually work for tags, we need to add the ref to the tagged object.
* fsck-cache: fix SIGSEGV on bad tag objectLinus Torvalds2005-05-03
| | | | | | | | | | | 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>
* fsck-cache: report broken links correctlyLinus Torvalds2005-05-02
| | | | | 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.
* Make fsck-cache do better tree checking.Linus Torvalds2005-05-02
| | | | | | | 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).
* fsck-cache: sort entries by inode numberLinus Torvalds2005-05-02
| | | | | | | | | 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.
* Add "get_sha1()" helper function.Linus Torvalds2005-05-01
| | | | | | | | | | | | 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.
* Make git-fsck-cache error printouts a bit more informative.Linus Torvalds2005-04-30
| | | | | | 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).
* Fix up d_type handling - we need to include <dirent.h> beforeLinus Torvalds2005-04-30
| | | | we play with the d_type compatibility macros.
* [PATCH] git-fsck-cache: Gracefully handle non-commit IDsJonas Fonseca2005-04-29
| | | | | | | Gracefully handle non-commit IDs instead of segfaulting. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] Rework fsck-cache to use parse_object()Daniel Barkalow2005-04-28
| | | | | | | | 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>
* fsck-cache: show root objects only with "--root"Linus Torvalds2005-04-25
| | | | | This makes the default fsck behaviour be quiet for a repository that doesn't have any problems. Which is good.
* fsck-cache: only show tags if asked to do so with "--tags"Linus Torvalds2005-04-25
| | | | | Normally we don't care, we just check them for being valid tag objects.
* Make "fsck" also show what the name of the tag object is, not justLinus Torvalds2005-04-25
| | | | | | the name of the object it tags. You need this if you actually want to build up a list of tags.
* Add "tag" objects that can be used to sign other objects.Linus Torvalds2005-04-25
| | | | You use "git-mktag" to create them, and fsck-cache knows how to parse them.
* fsck-cache: warn about missing commit datesLinus Torvalds2005-04-24
| | | | | Now that we have hopefully converted all old archives, we can consider it an error.
* fsck-cache: notice missing "blob" objects.Linus Torvalds2005-04-24
| | | | | | 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.
* Do SHA1 hash _before_ compression.Linus Torvalds2005-04-20
| | | | | And add a "convert-cache" program to convert from old-style to new-style.
* Make fsck-cache print the object type for unreachable objects.Linus Torvalds2005-04-18
| | | | This got lost when I updated to Daniel's new object model.
* Merge the new object model thing from Daniel BarkalowLinus Torvalds2005-04-18
|\ | | | | | | | | | | | | 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.
| * [PATCH] Port fsck-cache to use parsing functionsDaniel Barkalow2005-04-18
| | | | | | | | | | | | | | | | | | 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>
* | Make the revision tracking track the object types too.Linus Torvalds2005-04-17
|/ | | | | This allows fsck to verify not just that an object exists, but also that it has the type it was expected to have.
* Make "revision.h" slightly better to use.Linus Torvalds2005-04-17
| | | | | | | - 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.
* Use common "revision.h" header for both fsck and rev-tree.Linus Torvalds2005-04-13
| | | | | | | | 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.
* Make 'fsck' able to take an arbitrary number of parents on theLinus Torvalds2005-04-13
| | | | | | | | | | | 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.
* Make fsck reachability avoid doing unnecessary work forLinus Torvalds2005-04-13
| | | | | | | parents that we reach multiple ways. This doesn't matter right now. It _will_ matter once we have complex revision graphs.
* Make "fsck-cache" use the same revision tracking structure as "rev-tree".Linus Torvalds2005-04-13
| | | | | | | | 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.
* [PATCH] Consolidate the error handlingPetr Baudis2005-04-13
| | | | | | | 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>
* Oops. Fix bad initialization of the "seen" array, causing us to notLinus Torvalds2005-04-10
| | | | | | | | 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.
* Oops, the actual 'printf' for missing objects was missing.Linus Torvalds2005-04-10
| | | | | | | | | | | 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.