From 78ade9e6cf9a8d574961cb8617c3ea5f46f40193 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 9 Aug 2018 12:38:00 -0400 Subject: [PATCH] a plan --- ..._92b71940fe9d00bf58ee08b327f4a991._comment | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 doc/bugs/cannot_commit___34__annex_add__34__ed_modified_file_which_switched_its_largefile_status_to_be_committed_to_git_now/comment_3_92b71940fe9d00bf58ee08b327f4a991._comment diff --git a/doc/bugs/cannot_commit___34__annex_add__34__ed_modified_file_which_switched_its_largefile_status_to_be_committed_to_git_now/comment_3_92b71940fe9d00bf58ee08b327f4a991._comment b/doc/bugs/cannot_commit___34__annex_add__34__ed_modified_file_which_switched_its_largefile_status_to_be_committed_to_git_now/comment_3_92b71940fe9d00bf58ee08b327f4a991._comment new file mode 100644 index 0000000000..3c788db568 --- /dev/null +++ b/doc/bugs/cannot_commit___34__annex_add__34__ed_modified_file_which_switched_its_largefile_status_to_be_committed_to_git_now/comment_3_92b71940fe9d00bf58ee08b327f4a991._comment @@ -0,0 +1,30 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2018-08-09T16:17:33Z" + content=""" +So the root problem is that when we have a typechanged file and want to +convert that to be not typechanged, we have to git commit it. +As long as the previous commit is a symlink and the file in the index is +not, the file will be typechanged by definition. + +When git-annex add runs `git add file`, it's doing the only thing it can +do, but it leaves the file typechanged, and so git-annex later has no way +to tell that this file is not supposed to be treated as an unlocked file. +I don't think we want `git annex add` to commit the file. That would be +very surprising behavior! + +Instead, let's improve the pre-commit hook. It +currently looks for typechanged files and adds them as annexed files. +Why not make it check annex.largefiles? All it has to do is, if the file +doesn't match annex.largefiles, leave it typechanged. Git will then commit +its contents to git. + +With that, all the user has to do is unlock the file, modify it to make it +small, and commit, and it will automatically be converted to an in-git file. + +(Since the pre-commit hook has that partial commit blocking +when there are typechanged files, that will need to be changed to +not block partial commits when none of typechanged files match +annex.largefiles.) +"""]]