aboutsummaryrefslogtreecommitdiff
path: root/builtin-reflog.c
Commit message (Collapse)AuthorAge
* reflog gc: a tag that does not point at a commit is not a crime.Junio C Hamano2007-01-22
| | | | | | | | Although unusual, tags can point at any object. Warning only once is fine, but warning every time about the same tag gets annoying. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git reflog expire: document --stale-fix option.Junio C Hamano2007-01-15
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* reflog-expire: brown paper bag fix.Junio C Hamano2007-01-11
| | | | | | | When --stale-fix is not passed, the code did not initialize the two commit objects properly. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Sanitize for_each_reflog_ent()Johannes Schindelin2007-01-09
| | | | | | | | | | | | | | It used to ignore the return value of the helper function; now, it expects it to return 0, and stops iteration upon non-zero return values; this value is then passed on as the return value of for_each_reflog_ent(). Further, it makes no sense to force the parsing upon the helper functions; for_each_reflog_ent() now calls the helper function with old and new sha1, the email, the timestamp & timezone, and the message. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* reflog --fix-stale: do not check the same trees and commits repeatedly.Junio C Hamano2007-01-06
| | | | | | | | Since we use the reachability tracking machinery now, we should keep the already checked trees and commits whose completeness is known, to avoid checking the same thing over and over again. Signed-off-by: Junio C Hamano <junkio@cox.net>
* reflog expire --fix-staleJunio C Hamano2007-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic in an earlier round to detect reflog entries that point at a broken commit was not sufficient. Just like we do not trust presense of a commit during pack transfer (we trust only our refs), we should not trust a commit's presense, even if the tree of that commit is complete. A repository that had reflog enabled on some of the refs that was rewound and then run git-repack or git-prune from older versions of git can have reflog entries that point at a commit that still exist but lack commits (or trees and blobs needed for that commit) between it and some commit that is reachable from one of the refs. This revamps the logic -- the definition of "broken commit" becomes: a commit that is not reachable from any of the refs and there is a missing object among the commit, tree, or blob objects reachable from it that is not reachable from any of the refs. Entries in the reflog that refer to such a commit are expired. Since this computation involves traversing all the reachable objects, i.e. it has the same cost as 'git prune', it is enabled only when a new option --fix-stale. Fortunately, once this is run, we should not have to ever worry about missing objects, because the current prune and pack-objects know about reflogs and protect objects referred by them. Unfortunately, this will be absolutely necessary to help people migrate to the newer prune and repack. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-reflog: gc.* configuration and documentation.Junio C Hamano2006-12-27
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* reflog expire: do not punt on tags that point at non commits.Junio C Hamano2006-12-22
| | | | | | | | It is unusual for a tag to point at a non-commit, and it is also unusual for a tag to have reflog, but that is not an error and we should still prune its reflog entries just as other refs. Signed-off-by: Junio C Hamano <junkio@cox.net>
* reflog expire: prune commits that are not incompleteJunio C Hamano2006-12-22
| | | | | | | | | | Older fsck-objects and prune did not protect commits in reflog entries, and it is quite possible that a commit still exists in the repository (because it was in a pack, or something) while some of its trees and blobs are long gone. Make sure the commit and its associated tree is complete and expire incomplete ones. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git reflog expireJunio C Hamano2006-12-20
This prepares a place to collect reflog management subcommands, and implements "expire" action. $ git reflog expire --dry-run \ --expire=4.weeks \ --expire-unreachable=1.week \ refs/heads/master The expiration uses two timestamps: --expire and --expire-unreachable. Entries older than expire time (defaults to 90 days), and entries older than expire-unreachable time (defaults to 30 days) and records a commit that has been rewound and made unreachable from the current tip of the ref are removed from the reflog. The parameter handling is still rough, but I think the core logic for expiration is already sound. Signed-off-by: Junio C Hamano <junkio@cox.net>