summaryrefslogtreecommitdiff
path: root/doc/forum
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-05-19 16:45:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-05-19 16:45:08 -0400
commitcfcfeae2adceb09adba6ea9d9bd7dfcc1e7bd479 (patch)
treec1f55143b4f7a319e68513c5988ed8852c534f4f /doc/forum
parent4677ce88887df2c4806e735b456b6fef10c45ecc (diff)
move todo item that wasn't to the forum, with a better title
Diffstat (limited to 'doc/forum')
-rw-r--r--doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents.mdwn7
-rw-r--r--doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents/comment_1_cba76311e146dabb8ffc789bf4c8b714._comment14
-rw-r--r--doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents/comment_2_8d99c50fc1347367ccc0714e8d1af385._comment40
3 files changed, 61 insertions, 0 deletions
diff --git a/doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents.mdwn b/doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents.mdwn
new file mode 100644
index 000000000..4f24117f6
--- /dev/null
+++ b/doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents.mdwn
@@ -0,0 +1,7 @@
+It would be nice to have a way to drop files without leaving broken symlinks around, at least while in direct mode.
+
+Here is my user case. I have a collection of music CDs ripped in FLAC formats. At the same time I convert all these files to MP3 files to that I can use them in various other devices and to save space.
+
+The problem is that if I `git annex drop` the FLAC files once they are converted and copied, they leave broken symlinks around; this result in various annoying error messages in almost all the music playback I tried. At the same time, if I `rm` or `git rm` these symlinks, the content of these files will be removed also from the remotes as they are signalled as no longer wanted.
+
+Couldn't git-annex keep a separate index of files that have been removed but are meant to be kept?
diff --git a/doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents/comment_1_cba76311e146dabb8ffc789bf4c8b714._comment b/doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents/comment_1_cba76311e146dabb8ffc789bf4c8b714._comment
new file mode 100644
index 000000000..c490c826a
--- /dev/null
+++ b/doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents/comment_1_cba76311e146dabb8ffc789bf4c8b714._comment
@@ -0,0 +1,14 @@
+[[!comment format=mdwn
+ username="http://svario.it/gioele"
+ ip="2001:1418:100:262::2"
+ subject="Maybe using branches?"
+ date="2013-05-16T10:22:48Z"
+ content="""
+A suggestion from #git-annex:
+
+> &lt;mhameed&gt; i think others are already doing this, using branches, but not sure if we have a writeup/tutorial of it
+>
+> &lt;mhameed&gt; gioele: instead of working on master branch, switch to laptop branch, git rm the files that are not wanted and commit
+>
+> &lt;gioele&gt; mhameed: I'm lazy, I'd like git-annex to do that for me :)
+"""]]
diff --git a/doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents/comment_2_8d99c50fc1347367ccc0714e8d1af385._comment b/doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents/comment_2_8d99c50fc1347367ccc0714e8d1af385._comment
new file mode 100644
index 000000000..f0b20f1a4
--- /dev/null
+++ b/doc/forum/how_to_remove_files_and_symlinks_but_keep_historical_file_contents/comment_2_8d99c50fc1347367ccc0714e8d1af385._comment
@@ -0,0 +1,40 @@
+[[!comment format=mdwn
+ username="http://joeyh.name/"
+ nickname="joey"
+ subject="comment 2"
+ date="2013-05-19T20:43:43Z"
+ content="""
+The original poster seems to have a misunderstanding of what git-annex does with the content of files. Deleting a file does not remove the content of the file. You can always use git to check out a previous version of a file, and the content from the annex will still be there (or you can `git annex get` it to get it from whereever git-annex stored the content).
+
+The only exception to this rule is is you, manually, chose to run `git annex unused` and then `git annex dropunused`. That can delete the contents of files, when no branch or tag refers to them. As long as some branch refers to the content of the files, even if it's not the currently checked out branch, the file content is retained.
+
+So a branch *is* the \"index of files that have been removed but are wanted to be kept\".
+
+For example, you could do:
+
+[[!format sh \"\"\"
+git checkout -b keepflacs
+
+cdrom-rip-command
+git annex add *.flac
+git commit -m \"ripped a cd\"
+flac-convert-command
+git annex add *.mp3
+git commit -m \"converted to mp3\"
+
+git checkout master
+git merge keepflacs
+git rm *.flac
+git commit -m \"removed flac files from this branch. They are still available in the keepflacs branch\"
+\"\"\"]]
+
+As long as you always switch to the keepflacs branch to add flac files, and never merge the master branch into keepflacs,
+but only merge keepflacs into master, keepflacs will have every flac file you have ripped. And so git-annex will retain those files
+even when you `git annex unused; git-annex dropunused`.
+
+Or, just make a promise to yourself that you'll never run `git-annex unused`, similarly to how you'd probably never run `rm -rf .git/objects/$rand`, and you don't need the branches; like git, git-annex will retain all data that has ever been checked into it.
+
+(The branches are still a good idea. For one thing, they let you run `git annex fsck` and other repository maintenance commands with the keepflacs branch checked out.)
+
+I am going to move this thread to the [[forum]], because it's not really a TODO item, but is something others may want to read.
+"""]]