diff options
author | 2015-02-25 13:59:23 -0400 | |
---|---|---|
committer | 2015-02-25 13:59:23 -0400 | |
commit | c3c08a8dde43060ed1ab0078009835f89726d5bd (patch) | |
tree | 85c037cde4a6833d80d2dccaaa3fe81da5b2bc96 /doc/bugs/unannex_requires_commit_for_new_directories | |
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/unannex_requires_commit_for_new_directories')
-rw-r--r-- | doc/bugs/unannex_requires_commit_for_new_directories/comment_1_75814d6b4a59a4b7b950f9f2a27f0789._comment | 32 |
1 files changed, 32 insertions, 0 deletions
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. +"""]] |