lookupkey: Added --ref option

Sponsored-by: Joshua Antonishen on Patreon
This commit is contained in:
Joey Hess 2023-09-12 12:48:49 -04:00
parent 7be8950138
commit a18e40bdd7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 46 additions and 10 deletions

View file

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="joey"
subject="""Re: get file by branch and path in bare repository"""
date="2023-09-12T16:46:55Z"
content="""
--branch is limited to a treeish, so not a single file.
You can use `git-annex lookupkey --ref` to look up the key used by a ref to
a file, and then pass that to `git-annex get --key`
(That's a new feature I added due to you asking this question.)
"""]]

View file

@ -15,6 +15,13 @@ nothing is output, and it exits nonzero.
# OPTIONS
* `--ref`
Rather than looking for the specified files in the index, interpet them
as git refs. For example to find the key used for somefile in tag v1.0:
git-annex lookupkey v1.0:somefile
* `--batch`
Enable batch mode, in which a line containing the filename is read from