~jan0sch/darcs-book
Showing details for patch c29a6e3976e2e0bda18bb58001d64ce318e8e792.
diff -rN -u old-darcs-book/en/03-working-locally.md new-darcs-book/en/03-working-locally.md --- old-darcs-book/en/03-working-locally.md 2024-11-23 23:20:11.051422018 +0000 +++ new-darcs-book/en/03-working-locally.md 2024-11-23 23:20:11.051422018 +0000 @@ -296,7 +296,36 @@ +main = putStrLn "Hello World!" ``` -As you can see, we now have two patches in our repository. +`move` changes give `darcs` more context on what is actually happening. If we +were to simply move the file using the Unix command `mv` to `darcs` it would +look as if we had removed the file and added a new one. + +``` +$ ls +Main.hs _darcs +$ mv Main.hs Hello.hs +$ darcs status +R ./Main.hs +a ./Hello.hs +``` + +This is not what we want. But this pattern is so common that `darcs` is able to +detect it. The `--look-for-moves` flag which is supported by `status` and +`record` can figure this out. + +``` +$ darcs status --look-for-moves + ./Main.hs -> ./Hello.hs +$ darcs record --look-for-moves -m 'rename Main.hs' +move ./Main.hs ./Hello.hs +Shall I record this change? (1/1) [ynW...], or ? for more options: y +Do you want to Record these changes? [Yglqk...], or ? for more options: y +Finished recording patch 'rename Main.hs' +``` + +Great! `darcs` could figure this out even though we didn't specify the move +explicitly. This is quite useful if we forgot to use `move` or if some other +tool that is unaware of `darcs` has moved the file without informing us. What's new pussy cat? ---------------------