lookupkey absolute path support
lookupkey: Support being given an absolute filename to a file within the current git repository. This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
parent
8990afaef0
commit
cfdfe4df6c
4 changed files with 47 additions and 4 deletions
|
@ -50,3 +50,7 @@ Apparently, git-annex-lookupkey can't handle absolute paths to files to look for
|
|||
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
||||
|
||||
I do! I wouldn't even have my job, if it wasn't for git-annex. ;-)
|
||||
|
||||
> Which warms the cockles of my heart, Ben! :)
|
||||
>
|
||||
> [[fixed|done]] --[[Joey]]
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 1"""
|
||||
date="2017-12-08T18:58:18Z"
|
||||
content="""
|
||||
This is due to lookupkey not passing the filename through git ls-files like
|
||||
most (all?) other commands do.
|
||||
|
||||
Using git ls-files would lead to other behavior changes though. It recurses into
|
||||
directories. I don't think it makes sense for lookupkey to recurse into
|
||||
directories, because its output format does not include the filename, so
|
||||
listing a bunch of keys for annexed files is not clear. git annex find
|
||||
can already recurse and can use a format with the key and the filename
|
||||
that's suited for directory recursion. git annex lookupkey, as plumbing,
|
||||
is supposed to be simpler than that.
|
||||
|
||||
I suppose lookupkey could normalize absolute file paths, checking if they
|
||||
point into the git repository. I don't think that git-annex contains
|
||||
such normalization code, and it might be a lot more complicated than it at
|
||||
first seems -- git has a lot of wrinkles with submodules, symlinks, etc etc.
|
||||
git does not seem to have a suitable command to do it.
|
||||
|
||||
So seems the best way is to use git ls-files and detect when it's recursing,
|
||||
and exit nonzero then.
|
||||
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue