aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-17 14:11:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-01-17 14:11:01 -0400
commitea5f083bfeee7cd106763bff1c37b7fb79996046 (patch)
treed15a8ecb8349e0cfec2b5c5992f11e5e4e92435d
parentc42a2d99591e1df909f8649b71241fec48b2db78 (diff)
avoid running pre-commit hook in direct mode
The code that handles committing unlocked files in indirect mode did something unexpected and data lossy.
-rw-r--r--Command/PreCommit.hs2
-rw-r--r--doc/bugs/Possible_data_loss_-_git_status___39__typechange__39___and_direct_mode.mdwn7
2 files changed, 7 insertions, 2 deletions
diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs
index e675483c4..7ecf496a9 100644
--- a/Command/PreCommit.hs
+++ b/Command/PreCommit.hs
@@ -20,7 +20,7 @@ def = [command "pre-commit" paramPaths seek "run by git pre-commit hook"]
seek :: [CommandSeek]
seek =
[ whenNotDirect $ withFilesToBeCommitted $ whenAnnexed $ Command.Fix.start
- , withFilesUnlockedToBeCommitted start]
+ , whenNotDirect $ withFilesUnlockedToBeCommitted start]
start :: FilePath -> CommandStart
start file = next $ perform file
diff --git a/doc/bugs/Possible_data_loss_-_git_status___39__typechange__39___and_direct_mode.mdwn b/doc/bugs/Possible_data_loss_-_git_status___39__typechange__39___and_direct_mode.mdwn
index 18fd1c291..4a3329326 100644
--- a/doc/bugs/Possible_data_loss_-_git_status___39__typechange__39___and_direct_mode.mdwn
+++ b/doc/bugs/Possible_data_loss_-_git_status___39__typechange__39___and_direct_mode.mdwn
@@ -24,4 +24,9 @@ OS: OSX 10.6.8
#### Please provide any additional information below.
-
+> This was the pre-commit hook, made it not run in direct mode. [[done]]
+>
+> However, it's normal to see typechanged files in direct mode, and many
+> git commands that manipulate files in the working tree *can* result in
+> data loss. This is documented on [[direct_mode]].
+> --[[Joey]]