diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-02-25 13:59:23 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-02-25 13:59:23 -0400 |
commit | c3c08a8dde43060ed1ab0078009835f89726d5bd (patch) | |
tree | 85c037cde4a6833d80d2dccaaa3fe81da5b2bc96 /doc/bugs | |
parent | 05ba1ecbf5064a3e55590ae00a11cd71350a99f3 (diff) |
unannex: Refuse to unannex when repo is too new to have a HEAD
In this case there must be staged changes in the index (if there is
anything to unannex), and the unannex code path needs to run with a clean
index.
Diffstat (limited to 'doc/bugs')
-rw-r--r-- | doc/bugs/unannex_requires_commit_for_new_directories.mdwn | 1 | ||||
-rw-r--r-- | doc/bugs/unannex_requires_commit_for_new_directories/comment_1_75814d6b4a59a4b7b950f9f2a27f0789._comment | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/doc/bugs/unannex_requires_commit_for_new_directories.mdwn b/doc/bugs/unannex_requires_commit_for_new_directories.mdwn index 0f56d59e8..98078d967 100644 --- a/doc/bugs/unannex_requires_commit_for_new_directories.mdwn +++ b/doc/bugs/unannex_requires_commit_for_new_directories.mdwn @@ -28,3 +28,4 @@ git-annex: Cannot proceed with uncommitted changes staged in the index. Recommen ### What version of git-annex are you using? On what operating system? The issue occurs with last version of git-annex, available at the time of this post (2015-02-19 16:20). I could reproduce the issue in all other versions of git-annex I tried (not many though). I am using Linux, Ubuntu 12.04 amd64. +> [[done]]; added check for repository too new to have a HEAD. --[[Joey]] diff --git a/doc/bugs/unannex_requires_commit_for_new_directories/comment_1_75814d6b4a59a4b7b950f9f2a27f0789._comment b/doc/bugs/unannex_requires_commit_for_new_directories/comment_1_75814d6b4a59a4b7b950f9f2a27f0789._comment new file mode 100644 index 000000000..4c0a702d1 --- /dev/null +++ b/doc/bugs/unannex_requires_commit_for_new_directories/comment_1_75814d6b4a59a4b7b950f9f2a27f0789._comment @@ -0,0 +1,32 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-02-25T17:45:50Z" + content=""" +Git provides ample facilities to remove any commits that you don't like +from your repository's history. Eg, `git reset HEAD^^` + +This check for a clean index was added in [[!commit 7dc680415480fbbadc5dfd37f1ce72084fb1887d]] +which made unannex not make 1 commit per file it unannexed. That was a +massive improvement in speed and number of commits. + +In order for unannex to make just 1 commit at the end, instead of 1 per +file, it has to stage its changes in the index. Since it then needs to +commit the index at the end, we have one reason for it to require the index +not have staged changes, since those stages changes would get included in +the unannex commit. + +I suspect I had a second reason in mind when making that change. +The unannex commit has to be run with the pre-commit hook disabled +for complicated reasons. Involving other changes that are not unannex +changes in that commit would thus defeat the fixups that the pre-commit +hook normally does to such changes. This would at least prevent annexed +symlink path fixups from happening, and it might result in whole unlocked +files getting their full contents unexpectedly committed to git. + +There is no inconsistency between new and existing directories. +The difference is between repositories with a HEAD and repositories too +new to have one. Maybe it's a bug that unannex doesn't refuse to run +in a repostory too new to have a HEAD, since it cannot tell if there are +other staged changes with no HEAD to diff against. +"""]] |