summaryrefslogtreecommitdiff
path: root/doc/bugs/Specifying_a_filename_starting_with___34__-c__34___instead_applies_it_to_all_files.mdwn
blob: 52db9e0ae779c1734d321e3477180cf35ac31a49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
### Please describe the problem.
Trying to apply certain commands - such as 'drop' - to a filename which starts with "-c" instead applies it to all files.  In the instance where I found this, I was using "drop --force" and it caused it to indiscriminately get rid of everything in the directory instead of a single file.

### What steps will reproduce the problem?
1. Make a repository.
2. Create several files and add them.
3. Create a file whose name begins with "-c" and add it as well.
4. Run "git annex drop <fname>" where 'fname' is the file from that last step. 

### What version of git-annex are you using? On what operating system?
4.20130516-gedc4ccd on Arch Linux

### Please provide any additional information below.

[[!format sh """
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log

[user@host ~]$ mkdir annex_test
[user@host ~]$ cd annex_test/
[user@host annex_test]$ ls
[user@host annex_test]$ git init
Initialized empty Git repository in /home/user/annex_test/.git/
[user@host annex_test]$ git annex init "test"
init test ok
(Recording state in git...)
[user@host annex_test]$ 
[user@host annex_test]$ echo foo > foo
[user@host annex_test]$ echo bar > bar
[user@host annex_test]$ echo baz > baz
[user@host annex_test]$ echo test > "-c-test"
[user@host annex_test]$ git annex add *
add bar (checksum...) ok
add baz (checksum...) ok
add foo (checksum...) ok
(Recording state in git...)
[user@host annex_test]$ git annex add -c-test 
add -c-test (checksum...) ok
(Recording state in git...)
[user@host annex_test]$ git annex drop -c-test 
drop -c-test (unsafe) 
  Could only verify the existence of 0 out of 1 necessary copies

  Rather than dropping this file, try using: git annex move

  (Use --force to override this check, or adjust annex.numcopies.)
failed
drop bar (unsafe) 
  Could only verify the existence of 0 out of 1 necessary copies

  Rather than dropping this file, try using: git annex move

  (Use --force to override this check, or adjust annex.numcopies.)
failed
drop baz (unsafe) 
  Could only verify the existence of 0 out of 1 necessary copies

  Rather than dropping this file, try using: git annex move

  (Use --force to override this check, or adjust annex.numcopies.)
failed
drop foo (unsafe) 
  Could only verify the existence of 0 out of 1 necessary copies

  Rather than dropping this file, try using: git annex move

  (Use --force to override this check, or adjust annex.numcopies.)
failed
git-annex: drop: 4 failed


# End of transcript or log.
"""]]

> Closing, as this is basically user error. [[done]] --[[Joey]]