]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/reflog.c
git-reflog: add option --rewrite to update reflog entries while expiring
authorBrandon Casey <casey@nrlssc.navy.mil>
Fri, 22 Feb 2008 18:56:50 +0000 (12:56 -0600)
committerJunio C Hamano <gitster@pobox.com>
Sat, 23 Feb 2008 06:57:38 +0000 (22:57 -0800)
commit2b81fab2885256501d0bba6e16e516addb667bf3
treef156c514abbc71be58a3222b91472a548519d03b
parent3c386aa3380b698396d522f1132343ced482ff42
git-reflog: add option --rewrite to update reflog entries while expiring

Certain sanity checks on the reflog assume that each entry will contain
a reference to the previous entry. i.e. that the "old" sha1 field of a
reflog entry will be equal to the "new" sha1 field of the previous entry.

When reflog entries are deleted, this assumption may not hold. This patch
adds a new option to git-reflog which causes the subcommands "expire" and
"delete" to rewrite the "old" sha1 field of each reflog entry so that it
points to the previous reflog entry.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-reflog.c