]> Kevux Git Server - rit/commit
reflog: implement subcommand to drop reflogs
authorKarthik Nayak <karthik.188@gmail.com>
Fri, 14 Mar 2025 08:40:35 +0000 (09:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Mar 2025 23:58:11 +0000 (16:58 -0700)
commitd1270689a11e1e0dcf19d0257ce773a1d63d02d8
treecc22afdf14a8894ca3b89240b44e3ac713ea7b36
parent52f2dfb08413d8be6ecbe86271dfe92e33cb67a2
reflog: implement subcommand to drop reflogs

While 'git-reflog(1)' currently allows users to expire reflogs and
delete individual entries, it lacks functionality to completely remove
reflogs for specific references. This becomes problematic in
repositories where reflogs are not needed but continue to accumulate
entries despite setting 'core.logAllRefUpdates=false'.

Add a new 'drop' subcommand to git-reflog that allows users to delete
the entire reflog for a specified reference. Include an '--all' flag to
enable dropping all reflogs from all worktrees and an addon flag
'--single-worktree', to only drop all reflogs from the current worktree.

While here, remove an extraneous newline in the file.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-reflog.adoc
builtin/reflog.c
t/t1410-reflog.sh