From 2cd2969224090aafee63c9ca2a879476287fa1f6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 12 Nov 2014 13:57:20 -0400 Subject: more design work --- doc/todo/direct_mode_undo.mdwn | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/direct_mode_undo.mdwn b/doc/todo/direct_mode_undo.mdwn index 969678d23..505c753a3 100644 --- a/doc/todo/direct_mode_undo.mdwn +++ b/doc/todo/direct_mode_undo.mdwn @@ -61,16 +61,10 @@ it gets committed, and then that commit is reverted, resulting in another commit. Which a later run of undo can in turn revert. If it didn't commit, the history about the staged change that was reverted would be lost. -What about undoing changes to a whole directory? It first would -need to look through the git history to find every file under that -directory. And then it would behave as if it were passed all those -files. This would be useful for reverting `rm -rf`. But it could be very -expensive. And it could lead to surprising results, like undoing a lot -of unrelated changes when running on a bunch of files in a directory -that were changed at different times. - -Maybe instead of letting a directory be passed, make undo with no -parameters revert all changes made in the most recent commit. +What about undoing changes to a whole directory? Recursively undoing +the last change to each file would be expensive, and likely confusing. +Instead, when a directory is passed, it could find the most recent commit +that touched files in that directory, and undo the changes to those files. Also, --depth could make undo look for an older commit than the most recent one to affect the specified file. -- cgit v1.2.3