remove pre-commit hook
This was originally added so that unannex could prevent the hook from running while files were in a state that the hook would interpret as old-style unlocked and so would lock. Now that's gone, so the only thing the hook was preventing was two pre-commit processes running simulantaneously. But such concurrency is normal in git-annex and should not be a problem. Does mean that .git/hooks/pre-commit-annex might run more concurrently, that seems the only risk of it causing any problems.
This commit is contained in:
parent
1aabcd1038
commit
0e4d80d5c1
2 changed files with 1 additions and 10 deletions
|
@ -66,7 +66,6 @@ module Annex.Locations (
|
||||||
gitAnnexJournalDir',
|
gitAnnexJournalDir',
|
||||||
gitAnnexJournalLock,
|
gitAnnexJournalLock,
|
||||||
gitAnnexGitQueueLock,
|
gitAnnexGitQueueLock,
|
||||||
gitAnnexPreCommitLock,
|
|
||||||
gitAnnexMergeLock,
|
gitAnnexMergeLock,
|
||||||
gitAnnexIndex,
|
gitAnnexIndex,
|
||||||
gitAnnexIndexStatus,
|
gitAnnexIndexStatus,
|
||||||
|
@ -469,10 +468,6 @@ gitAnnexJournalLock r = fromRawFilePath $ gitAnnexDir r P.</> "journal.lck"
|
||||||
gitAnnexGitQueueLock :: Git.Repo -> FilePath
|
gitAnnexGitQueueLock :: Git.Repo -> FilePath
|
||||||
gitAnnexGitQueueLock r = fromRawFilePath $ gitAnnexDir r P.</> "gitqueue.lck"
|
gitAnnexGitQueueLock r = fromRawFilePath $ gitAnnexDir r P.</> "gitqueue.lck"
|
||||||
|
|
||||||
{- Lock file for the pre-commit hook. -}
|
|
||||||
gitAnnexPreCommitLock :: Git.Repo -> FilePath
|
|
||||||
gitAnnexPreCommitLock r = fromRawFilePath $ gitAnnexDir r P.</> "precommit.lck"
|
|
||||||
|
|
||||||
{- Lock file for direct mode merge. -}
|
{- Lock file for direct mode merge. -}
|
||||||
gitAnnexMergeLock :: Git.Repo -> FilePath
|
gitAnnexMergeLock :: Git.Repo -> FilePath
|
||||||
gitAnnexMergeLock r = fromRawFilePath $ gitAnnexDir r P.</> "merge.lck"
|
gitAnnexMergeLock r = fromRawFilePath $ gitAnnexDir r P.</> "merge.lck"
|
||||||
|
|
|
@ -32,7 +32,7 @@ cmd = command "pre-commit" SectionPlumbing
|
||||||
(withParams seek)
|
(withParams seek)
|
||||||
|
|
||||||
seek :: CmdParams -> CommandSeek
|
seek :: CmdParams -> CommandSeek
|
||||||
seek ps = lockPreCommitHook $ do
|
seek ps = do
|
||||||
l <- workTreeItems ps
|
l <- workTreeItems ps
|
||||||
-- fix symlinks to files being committed
|
-- fix symlinks to files being committed
|
||||||
flip withFilesToBeCommitted l $ \f -> commandAction $
|
flip withFilesToBeCommitted l $ \f -> commandAction $
|
||||||
|
@ -74,7 +74,3 @@ showMetaDataChange = showLongNote . unlines . concatMap showmeta . fromMetaData
|
||||||
showset v
|
showset v
|
||||||
| isSet v = "+"
|
| isSet v = "+"
|
||||||
| otherwise = "-"
|
| otherwise = "-"
|
||||||
|
|
||||||
{- Takes exclusive lock; blocks until available. -}
|
|
||||||
lockPreCommitHook :: Annex a -> Annex a
|
|
||||||
lockPreCommitHook = withExclusiveLock gitAnnexPreCommitLock
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue