git-annex/Annex
Joey Hess 4588668a12
fromkey unlocked files support
fromkey: Create an unlocked file when used in an adjusted branch where the
file should be unlocked, or when configured by annex.addunlocked.

There is some overlap with code in Annex.Ingest, however it's not quite the
same because ingesting has a temp file with the content, where here the
content, if any, is in the annex object file. So it eg, makes sense for
Annex.Ingest to copy the execute mode of the content file, but it does not make
sense for fromkey to do that.

Also changed in passing to stage the file in git directly, rather than
using git add. One consequence of that is that if the file is gitignored,
it will still get added, rather than the old behavior:

The following paths are ignored by one of your .gitignore files:
ignored
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"
git-annex: user error (xargs ["-0","git","--git-dir=.git","--work-tree=.","--literal-pathspecs","add","--"] exited 123)

That old behavior was a surprise to me, and so I consider it a bug, and doubt
anyone would have relied on it.

Note that, when on an --hide-missing branch, it is possible to fromkey a key
that is not present (needs --force). The annex link or pointer file still gets
written in this case. It doesn't seem to make any sense not to write it,
because then fromkey would not do anything useful in this case, and this way
the file can be committed and synced to master, and the branch re-adjusted to
hide the new missing file.

This commit was sponsored by Noam Kremen on Patreon.
2021-05-03 11:26:18 -04:00
..
AdjustedBranch annex.adjustedbranchrefresh 2020-11-16 14:27:28 -04:00
Branch forget: Preserve currently exported trees 2021-04-13 15:00:23 -04:00
Concurrent differentiate between concurrency enabled at command line and by git config 2020-09-16 11:47:12 -04:00
Content incremental checksum on download from ssh or p2p 2021-02-09 17:03:27 -04:00
Debug implement fastDebug 2021-04-06 15:24:28 -04:00
LockPool Display a message when git-annex has to wait for a pid lock file held by another process 2020-08-26 13:05:34 -04:00
MetaData update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
SpecialRemote remove redundant imports 2020-06-22 11:05:34 -04:00
VectorClock generate more compact git-annex branch for imports 2020-12-23 15:25:16 -04:00
View fix test failure on windows 2020-11-26 11:48:52 -04:00
Action.hs start splitting out readonly values from AnnexState 2021-04-02 15:51:44 -04:00
AdjustedBranch.hs fix hardcoded origin name in checkAdjustedClone 2021-04-14 18:53:27 -04:00
AutoMerge.hs Git.Queue: allow providing git common options like -c 2021-01-04 12:51:55 -04:00
BloomFilter.hs Revert "data type that starts off using a set but converts to a bloom filter when large" 2020-07-01 20:12:19 -04:00
Branch.hs implement annex.privateremote and remote.name.private configs 2021-04-23 14:21:57 -04:00
BranchState.hs Avoid excess commits to the git-annex branch when stall detection is enabled 2021-04-02 11:57:18 -04:00
CatFile.hs better interface for catKey' 2021-03-16 14:52:23 -04:00
ChangedRefs.hs more RawFilePath conversion 2020-10-29 14:20:57 -04:00
CheckAttr.hs mincopies 2021-01-06 14:15:19 -04:00
CheckIgnore.hs more RawFilePath conversion 2020-11-03 10:11:04 -04:00
Common.hs use fastDebug everywhere it can be used 2021-04-06 15:41:24 -04:00
Concurrent.hs start splitting out readonly values from AnnexState 2021-04-02 15:51:44 -04:00
Content.hs make getViaTmpFrom no longer update location log 2020-12-11 11:50:13 -04:00
CopyFile.hs directory CoW on import 2021-04-14 16:10:09 -04:00
CurrentBranch.hs refactor getCurrentBranch 2018-10-19 17:29:18 -04:00
Debug.hs fix fastDebug to check if debugging is actually enabled 2021-04-06 16:28:37 -04:00
Difference.hs include git-annex-shell back in 2019-12-02 11:51:52 -04:00
DirHashes.hs Added http special remote, which is useful for accessing other remotes that publish content stored in them via http/https. 2020-09-01 15:16:35 -04:00
Drop.hs check mincopies is satisfied even when numcopies is known to be satisfied 2021-04-27 13:37:18 -04:00
Environment.hs include git-annex-shell back in 2019-12-02 11:51:52 -04:00
Export.hs simplify 2021-03-05 14:22:04 -04:00
ExternalAddonProcess.hs use fastDebug everywhere it can be used 2021-04-06 15:41:24 -04:00
FileMatcher.hs prep for fixing find --branch --unlocked 2021-03-02 13:39:31 -04:00
Fixup.hs fix a bug that prevented git-annex init from working in a submodule 2021-01-21 15:33:15 -04:00
GitOverlay.hs add: Significantly speed up adding lots of non-large files to git 2021-01-04 13:12:28 -04:00
HashObject.hs more RawFilePath conversion 2020-10-28 17:25:59 -04:00
Hook.hs don't try to remove pre-commit-annex and post-update-annex-hooks 2020-10-19 13:13:49 -04:00
Import.hs simplify 2021-03-05 14:22:04 -04:00
Ingest.hs fromkey unlocked files support 2021-05-03 11:26:18 -04:00
Init.hs New annex.supportunlocked config 2021-03-23 14:04:34 -04:00
InodeSentinal.hs finished this stage of the RawFilePath conversion 2020-11-06 14:10:58 -04:00
Journal.hs implement annex.privateremote and remote.name.private configs 2021-04-23 14:21:57 -04:00
Link.hs start splitting out readonly values from AnnexState 2021-04-02 15:51:44 -04:00
Locations.hs start implementing hidden git-annex repositories 2021-04-20 15:04:53 -04:00
LockFile.hs more RawFilePath conversion 2020-10-29 10:50:29 -04:00
LockPool.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Magic.hs Serialize use of C magic library, which is not thread safe. 2020-09-17 17:27:42 -04:00
MetaData.hs Windows: include= and exclude= containing '/' will also match filenames that are written using '\' 2020-12-15 12:39:34 -04:00
Multicast.hs use programPath consistently, not readProgramFile 2020-03-30 16:06:27 -04:00
Notification.hs wip RawFilePath 2x git-annex find speedup 2019-11-26 16:01:58 -04:00
NumCopies.hs improve message 2021-04-27 13:44:08 -04:00
Path.hs Make --debug also enable debugging in child git-annex processes 2021-03-22 14:25:28 -04:00
Perms.hs more RawFilePath conversion 2020-11-05 18:45:37 -04:00
PidLock.hs propagate git-annex -c on to transferrer child process 2020-12-15 11:36:25 -04:00
Queue.hs Git.Queue: allow providing git common options like -c 2021-01-04 12:51:55 -04:00
RemoteTrackingBranch.hs refactor 2019-11-11 19:10:52 -04:00
ReplaceFile.hs more RawFilePath conversion 2020-10-29 12:03:50 -04:00
SpecialRemote.hs avoid getting creds from environment during autoenable 2021-03-17 09:41:12 -04:00
Ssh.hs start splitting out readonly values from AnnexState 2021-04-02 15:51:44 -04:00
StallDetection.hs suggest when user may want annex.stalldetection 2021-02-03 15:57:19 -04:00
TaggedPush.hs Ref ByteString conversion done 2020-04-07 17:41:09 -04:00
Tmp.hs propagate signals to the transferrer process group 2020-12-11 15:32:00 -04:00
Transfer.hs start splitting out readonly values from AnnexState 2021-04-02 15:51:44 -04:00
TransferrerPool.hs use fastDebug everywhere it can be used 2021-04-06 15:41:24 -04:00
UntrustedFilePath.hs importfeed: Fix reversion that caused some '.' in filenames to be replaced with '_' 2020-08-05 11:35:00 -04:00
UpdateInstead.hs v7 for all repositories 2019-08-30 14:09:14 -04:00
Url.hs Improved display of errors when accessing a git http remote fails. 2021-03-24 14:19:32 -04:00
UUID.hs Fix a potential failure to parse git config 2020-04-13 13:05:41 -04:00
VariantFile.hs more RawFilePath 2019-12-18 17:10:28 -04:00
VectorClock.hs generate more compact git-annex branch for imports 2020-12-23 15:25:16 -04:00
Verify.hs incremental checksum on download from ssh or p2p 2021-02-09 17:03:27 -04:00
Version.hs jump right to v8, don't stop part way 2020-02-24 13:21:00 -04:00
View.hs Fix a bug in view filename generation when a metadata value ended with "/" 2021-01-22 14:05:14 -04:00
Wanted.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
WorkerPool.hs start splitting out readonly values from AnnexState 2021-04-02 15:51:44 -04:00
WorkTree.hs add git ls-tree --long parser 2021-03-23 12:47:00 -04:00
YoutubeDl.hs add searchPathContents 2021-02-02 19:06:15 -04:00