Commit graph

1027 commits

Author SHA1 Message Date
Joey Hess
66285ca3d1 copy --from, get --from: When --force is used, ignore the location log and always try to get the file from the remote. 2013-12-02 15:41:20 -04:00
Joey Hess
12bc989d2d better name for continuation 2013-12-01 15:52:30 -04:00
Joey Hess
03932212ec Avoid using git commit in direct mode, since in some situations it will read the full contents of files in the tree.
The assistant's commit code also always avoids git commit, for simplicity.
Indirect mode sync still does a git commit -a to catch unstaged changes.

Note that this means that direct mode sync no longer runs the pre-commit
hook or any other hooks git commit might call. The git annex pre-commit
hook action for direct mode is however explicitly run. (The assistant
already ran git commit with hooks disabled, so no change there.)
2013-12-01 13:59:45 -04:00
Joey Hess
fa3045aa8b make "git annex help options" work outside a git repo
Option parsing for commands that run outside git repos is still screwy,
as there is no Annex monad and so the flags cannot be passed in. But,
any remaining parameters can be, which is enough for this fix.
2013-11-30 15:18:40 -04:00
Joey Hess
0bea8a4c55 reinject: Allow to be used in direct mode. 2013-11-26 16:15:49 -04:00
Joey Hess
3e9db00d2d Bug fix: annex.version did not get set on automatic upgrade to v5 direct mode repo, so the upgrade was performed repeatedly, slowing commands down. 2013-11-26 12:54:50 -04:00
Joey Hess
94251de91e add readFileStrictAnyEncoding 2013-11-20 13:41:13 -04:00
Joey Hess
b1ed98636b merge with git-repair 2013-11-19 17:08:57 -04:00
Joey Hess
0d0e21ea57 dropunused, addunused: Allow "all" instead of a range to act on all unused data. 2013-11-18 17:24:18 -04:00
Joey Hess
9c20185f55 webapp: Check annex.version. 2013-11-17 14:58:35 -04:00
Joey Hess
d48b00ebed Direct mode .git/annex/objects directories are no longer left writable
Because that allowed writing to symlinks of files that are not present,
which followed the link and put bad content in an object location.

fsck: Fix up .git/annex/object directory permissions.

This commit was sponsored by an anonymous bitcoin donor.
2013-11-15 14:52:03 -04:00
Joey Hess
2a297dd6d1 on second thought, don't change sync to exit nonzero on successful conflicted merge resolution
For one thing, that breaks the test suite. May revisit later.
2013-11-14 14:36:48 -04:00
Joey Hess
2d0a05c0fe add a note after successful conflicted merge resolution 2013-11-14 14:18:15 -04:00
Joey Hess
3e9419b088 avoid using Utility.Touch without WITH_CLIBS 2013-11-12 21:05:04 -04:00
Joey Hess
958312885f webapp: Improve UI around remote that have no annex.uuid set, either because setup of them is incomplete, or because the remote git repository is not a git-annex repository.
Complicated by such repositories potentially being repos that should have
an annex.uuid, but it failed to be gotten, perhaps due to the past ssh repo
setup bugs. This is handled now by an Upgrade Repository button.
2013-11-07 18:02:00 -04:00
Joey Hess
9ff229a798 watcher: Avoid loop when adding a file owned by someone else fails in indirect mode because its permissions cannot be modified.
Adding the file moved it to the annex, and then tried to set the mode.
Error unwind then moved the file back, and so the watcher saw the file get
deleted and then added back, and so tried again..
2013-11-07 15:18:54 -04:00
Joey Hess
4f373503f2 sync: When there are merge conflicts that get automatically resolved, exit nonzero at the end. 2013-11-07 15:02:11 -04:00
Joey Hess
365ecb6c2d no status in bare repo 2013-11-07 14:44:44 -04:00
Joey Hess
59ecc804cd add new status command
This works for both direct and indirect mode.

It may need some performance tuning.

Note that unlike git status, it only shows the status of the work tree, not
the status of the index. So only one status letter, not two .. and since
files that have been added and not yet committed do not differ between the
work tree and the index, they are not shown. Might want to add display of
the index vs the last commit eventually.

This commit was sponsored by an unknown bitcoin contributor, whose
contribution as been going up lately! ;)
2013-11-07 14:07:25 -04:00
Joey Hess
eed2ed4fdb rename status to info, and update docs 2013-11-07 12:45:59 -04:00
Joey Hess
3802f2f270 work around lack of receive.denyCurrentBranch in direct mode
Now that direct mode sets core.bare=true, git's normal prohibition about
pushing into the currently checked out branch doesn't work.

A simple fix for this would be an update hook which blocks the pushes..
but git hooks must be executable, and git-annex needs to be usable on eg,
FAT, which lacks x bits.

Instead, enabling direct mode switches the branch (eg master) to a special
purpose branch (eg annex/direct/master). This branch is not pushed when
syncing; instead any changes that git annex sync commits get written to
master, and it's pushed (along with synced/master) to the remote.

Note that initialization has been changed to always call setDirect,
even if it's just setDirect False for indirect mode. This is needed because
if the user has just cloned a direct mode repo, that nothing has synced
with before, it may have no master branch, and only a annex/direct/master.
Resulting in that branch being checked out locally too. Calling setDirect False
for indirect mode moves back out of this branch, to a new master branch,
and ensures that a manual "git push" doesn't push changes directly to
the annex/direct/master of the remote. (It's possible that the user
makes a commit w/o using git-annex and pushes it, but nothing I can do
about that really.)

This commit was sponsored by Jonathan Harrington.
2013-11-05 21:08:31 -04:00
Joey Hess
4510819215 v5 for direct mode, with automatic upgrade
This includes storing the current state of the HEAD ref, which git annex
sync is going to need, but does not make sync use it.
2013-11-05 17:05:03 -04:00
Joey Hess
58db042033 map: Work when there are gcrypt remotes. 2013-11-04 14:14:44 -04:00
Joey Hess
dff303aa43 Fix enabling of gcrypt repository accessed over ssh; git-annex-shell gcryptsetup had a bug that caused it to fail with permission denied. 2013-11-02 20:15:40 -04:00
Joey Hess
bc18cde325 sync: Work even when the local git repository is new and empty, with no master branch. 2013-11-02 15:29:38 -04:00
Joey Hess
e7ac51c0fe prune unused import 2013-11-01 11:37:58 -04:00
Joey Hess
35676feef6 use a long note here 2013-11-01 11:04:19 -04:00
Joey Hess
0eff0dd910 unannex: New, much slower, but more safe behavior
Copies files out of the annex. This avoids an unannex of one file breaking
other files that link to the same content. Also, it means that the content
remains in the annex using up space until cleaned up with  "git annex
unused".

(The behavior of unannex --fast has not changed; it still hard
links to content in the annex. --fast was not made the default because it
is potentially unsafe; editing such a hard linked file can unexpectedly
change content stored in the annex.)
2013-10-28 16:56:01 -04:00
Joey Hess
b6f2f3e8c5 more clear labels 2013-10-28 15:04:38 -04:00
Joey Hess
93b2ba4c00 rename "known annex keys" to "known annex items" 2013-10-28 14:55:27 -04:00
Joey Hess
230bfa9688 add --want-get and --want-drop options
New --want-get and --want-drop options which can be used to test preferred
content settings. For example, "git annex find --in . --want-drop"
2013-10-28 14:50:17 -04:00
Joey Hess
afddbfd7e9 The "git annex content" command is renamed to "git annex wanted". 2013-10-28 14:08:38 -04:00
Joey Hess
2af652e1b8 sync: print a hint about receive.denyNonFastForwards when a push fails 2013-10-26 15:53:05 -04:00
Joey Hess
2233ddd5a2 assistant: When autostarted, wait 5 seconds before running the startup scan, to avoid contending with the user's desktop login process. 2013-10-26 12:42:58 -04:00
Joey Hess
66f0fb1a7f make repair command deal with non-git-annex repos 2013-10-23 15:07:55 -04:00
Joey Hess
0036139b33 wire git repair into webapp 2013-10-23 14:43:58 -04:00
Joey Hess
1ab2ad86c7 minor 2013-10-23 13:19:37 -04:00
Joey Hess
435ea52f3c repair command: add handling of git-annex branch and index 2013-10-23 13:00:45 -04:00
Joey Hess
d5eb85acf4 add repair command 2013-10-23 12:21:59 -04:00
Joey Hess
ad86926f09 Revert "avoid hsc files on Windows"
This reverts commit 158ba9d332.

My windows build environment was broken; reverted to backup.
2013-10-17 17:53:50 -04:00
Joey Hess
bf11eac772 typo 2013-10-17 17:02:24 -04:00
Joey Hess
158ba9d332 avoid hsc files on Windows
This used to work, but now hsc2hs is failing with a usage message.
Since I have not changed my windows build environment at all, it must be
some change due to a change in the cabal file. Perhaps too make flags are
causing it to hit a windows command line length limit?

Anyway, these hsc files did nothing on Windows, so can be omitted and not
built to work around yet another epic windows weirdness.
2013-10-17 16:35:14 -04:00
Joey Hess
c7b8c776a8 update for DiffTree type change
Experimentally, using the raw TopFilePath was right here.
2013-10-17 15:01:23 -04:00
Joey Hess
7206dcb376 update for DiffTree change
This actually fixes a bug; if pre-commit was run in a subdir, it would pass
relative files when updating the associated file maps, and so the maps
wouldn't update.

I don't think this bug happened in practice, due to the way pre-commit is
called by the hook. It happened to chdir to the top of the work tree.
2013-10-17 14:52:12 -04:00
Joey Hess
2ddcba7a15 sync: fix crash on first sync when no branch exists yet 2013-10-17 13:34:27 -04:00
Joey Hess
f6560ffcb7 fix indirect mode conflict merge when only one side is annexed file
git-merge's creation of file~HEAD type files did not make this especially
nice to do.
2013-10-16 15:37:06 -04:00
Joey Hess
e227e8f683 sync: Fix automatic resolution of merge conflicts where one side is an annexed file, and the other side is a non-annexed file, or a directory.
Note that this case is only fully automatically resolved in direct mode.
In indirect mode, git merge moves the file to file~HEAD, and replaces it
with the directory, and leaves the file in unmerged state, and sync doesn't
yet change that.
2013-10-16 14:56:40 -04:00
Joey Hess
296e21b381 add schedule command
Mostly because it gives me an excuse and a hook to document the schedule
expression format.
2013-10-13 15:40:38 -04:00
Joey Hess
a1040a38c5 Merge branch 'master' into incrementalfsck 2013-10-13 15:05:44 -04:00
Joey Hess
68518a9b3d status: Fix a crash if a temp file went away while its size was being checked for status. 2013-10-13 13:30:24 -04:00