Commit graph

43591 commits

Author SHA1 Message Date
yarikoptic
b8a03643e5 Added a comment 2023-05-19 18:47:49 +00:00
Joey Hess
9ed59dab5b
assist: operate on all files in working tree by default
Consistency with sync and internal consistency is more important than
consistency with the assistant, which is not itself consistent about
what it does when run in a subdirectory.

Note that with -C, it will still commit staged changes to files outside
the directory. Like sync does. Presumably if the user is manually
staging things, then running this command, they intend to build up a
commit.

Sponsored-by: unqueued on Patreon
2023-05-19 14:47:05 -04:00
Joey Hess
c4ad9b1446
Fix bug in -z handling of trailing NUL in input
The obvious way to fix this would be to adapt lines to split on null.

However, it's actually nontrivial to rewrite lines. In particular it has a
weird implementation to avoid a space leak. See:
https://gitlab.haskell.org/ghc/ghc/-/issues/4334

Also, while that is a small amount of code, it's covered by a rather
complex copyright and I'd have to include that copyright in git-annex.

So, I opted to filter out the trailing empty string instead.

Sponsored-by: Dartmouth College's Datalad project
2023-05-19 14:34:02 -04:00
Joey Hess
0184421a4d
comment 2023-05-19 13:53:21 -04:00
yarikoptic
ea7a904c0d question about annotating availability in the snapshot 2023-05-19 14:36:46 +00:00
yarikoptic
d73467ebf7 dropkey -z not working 2023-05-19 13:53:46 +00:00
nobodyinperson
f8df46537d Added a comment: 👍 git annex assist 2023-05-19 05:54:44 +00:00
Joey Hess
908b9687cc
assist: fix bug committing just added file when -J is used
Need to wait for worker threads adding files before flushing the queue.
2023-05-18 15:02:10 -04:00
Joey Hess
fc3df2da9e
assist: fix bug commiting just added file 2023-05-18 14:56:13 -04:00
Joey Hess
9619f562f4
fix assist to commit 2023-05-18 14:50:05 -04:00
Joey Hess
9ec5d7fb05
improve --cleanup desc 2023-05-18 14:41:20 -04:00
Joey Hess
e955912ad0
git-annex assist
assist: New command, which is the same as git-annex sync but with
new files added and content transferred by default.

(Also this fixes another reversion in git-annex sync,
--commit --no-commit, and --message were not enabled, oops.)

See added comment for why git-annex assist does commit staged
changes elsewhere in the work tree, but only adds files under
the cwd.

Note that it does not support --no-commit, --no-push, --no-pull
like sync does. My thinking is, why should it? If you want that
level of control, use git commit, git annex push, git annex pull.
Sync only got those options because pull and push were not split
out.

Sponsored-by: k0ld on Patreon
2023-05-18 14:37:43 -04:00
Joey Hess
80e9a655f8
add man pages for pull and push to cabal file 2023-05-18 12:54:15 -04:00
Joey Hess
28c4051e3d
add test summary with number of parts and time
Sponsored-by: Brock Spratlen on Patreon
2023-05-18 11:20:27 -04:00
Joey Hess
287b070597
Merge branch 'master' of ssh://git-annex.branchable.com 2023-05-18 10:55:11 -04:00
Joey Hess
935330aaab
fix inverted logic (fixes test fail)
Sponsored-by: Jack Hill on Patreon
2023-05-18 10:48:08 -04:00
Joey Hess
6b236ca58b
update test suite to sync --no-content
A recently added warning and a plan to change behavior make it a good
idea to be explicit here.
2023-05-18 09:59:29 -04:00
nobodyinperson
84563b7da4 Added a comment 2023-05-18 08:40:37 +00:00
Joey Hess
8987cc214e
update 2023-05-17 13:41:33 -04:00
Joey Hess
502e7affb9
Merge branch 'master' of ssh://git-annex.branchable.com 2023-05-17 13:33:47 -04:00
Joey Hess
5cc89b7444
comment 2023-05-17 13:33:42 -04:00
Joey Hess
c52d7338a2
improve docs
The man pages for these were not really clear that they add new files.
2023-05-17 13:32:47 -04:00
Joey Hess
f93a7fce1d
sync: Started transition to --content being enabled by default
When used without --content or --no-content, warn about the upcoming
transition, and suggest using one of the options, or setting
annex.synccontent.

Sponsored-by: Brett Eisenberg on Patreon
2023-05-17 13:23:42 -04:00
Joey Hess
af6b73a7e6
push: Support --cleanup
This option is not specific to sync, so it seemed it should be in either
pull or push as well as sync. Since it does modify the remote, it seems
better to have it in push; the modification of the local repo pulls in
the direction of pull, but not hard enough.

Maybe it would be better to have it in both?

Sponsored-by: Luke Shumaker on Patreon
2023-05-17 12:51:49 -04:00
Joey Hess
31d21578c3
improve description of --debugfilter 2023-05-17 12:38:22 -04:00
Joey Hess
40731ff9fd
sync: Added -g as a short option for --no-content
I anticipate that if sync is transitioned to syncing content by default,
people will want a short option. And in repositories where
annex.synccontent = true, they already would. And pull and push sync
content by default, so a short option is useful with them too.

Mnemonic: -g makes only git data be synced
Also, -a makes only annex data be synced.

Would have preferred -c, which would complement -C, but it
was already taken to set git configs.

Sponsored-by: Noam Kremen on Patreon
2023-05-17 12:34:26 -04:00
nobodyinperson
62b2a88dac Added a comment 2023-05-17 10:41:18 +00:00
Joey Hess
5df89d58c7
git-annex pull and push
Split out two new commands, git-annex pull and git-annex push. Those plus a
git commit are equivilant to git-annex sync.

In a sense, git-annex sync conflates 3 things, and it would have been
better to have push and pull from the beginning and not sync. Although
note that git-annex sync --content is faster than a pull followed by a
push, because it only has to walk the tree once, look at preferred
content once, etc. So there is some value in git-annex sync in speed, as
well as user convenience.

And it would be hard to split out pull and push from sync, as far as the
implementaton goes. The implementation inside sync was easy, just adjust
SyncOptions so it does the right thing.

Note that the new commands default to syncing content, unless
annex.synccontent is explicitly set to false. I'd like sync to also do
that, but that's a hard transition to make. As a start to that
transition, I added a note to git-annex-sync.mdwn that it may start to
do so in a future version of git-annex. But a real transition would
necessarily involve displaying warnings when sync is used without
--content, and time.

Sponsored-by: Kevin Mueller on Patreon
2023-05-16 16:51:07 -04:00
Joey Hess
b1c396a695
remove unused imports 2023-05-16 16:33:02 -04:00
Joey Hess
2e984c51b6
sync --no-pull and --no-push affect download and upload of content
The man page is somewhat vague about this, but I do think it was a bug
that these options didn't alreay behave that way. The options are
documented to disable imports and exports, which is the same operations
just with a special remote that uses trees.

The real motivation for this is that I'm adding git-annex pull and
git-annex push, and I want these options to turn off the equivilant of
those commands. And git-annex pull will certianly download and push
upload.

Sponsored-by: Nicholas Golder-Manning on Patreon
2023-05-16 16:25:23 -04:00
Joey Hess
212442dd9b
pullOption should be pushOption in seekExportContent
sync: Fix bug that made --no-pull, rather than --no-push prevent exporting
trees to special remotes.

Sponsored-by: Joshua Antonishen on Patreon
2023-05-16 15:55:24 -04:00
Joey Hess
705b7e2d36
comment 2023-05-16 13:08:43 -04:00
nobodyinperson
5c6b299ef6 Added a comment 2023-05-15 21:13:34 +00:00
Joey Hess
ca76d1beb1
remove spam 2023-05-15 16:22:11 -04:00
Joey Hess
7d6a161e35
comment 2023-05-15 16:19:53 -04:00
Joey Hess
96c372ac85
document how to include= a path with a space in it
POSIX character classes allowed in globs was a surprise, but just
happened to fall out of the implementation in a way that seems
to behave correctly.

mdwn2man has to be tweaked to render the example properly.
The line I modified is the one that strips ikiwiki wikilinks out of the
man page.

Sponsored-by: Graham Spencer on Patreon
2023-05-15 16:02:06 -04:00
Joey Hess
0da0e2efcc
add git config debugging
(and process cwd debugging)

Sponsored-by: Dartmouth College's Datalad project
2023-05-15 15:35:29 -04:00
nobodyinperson
ee23c540ea Added a comment: Git Alias for a 'full sync' 2023-05-15 07:31:41 +00:00
aurtzy
4581f11243 Added a comment 2023-05-14 02:52:38 +00:00
yarikoptic
7cffb65de6 original issue -- need more logging 2023-05-12 19:06:50 +00:00
yarikoptic
69aea7a0a3 Added a comment 2023-05-12 13:22:19 +00:00
yarikoptic
38a9a9400b Added a comment 2023-05-12 13:22:01 +00:00
Joey Hess
3990cce78a
finished this 2023-05-11 13:57:59 -04:00
Joey Hess
07e0d2a35b
clean up uninit output
Don't think including the location of .git/annex/objects in the json is
really useful.
2023-05-11 13:52:22 -04:00
Joey Hess
55dfa929d6
uninit: remove unncessary ExistSuccess
That was added in 2011 to prevent writing to the git-annex branch on
shutdown. But, the use of saveState causes pending git-annex branch
writes to be completed before the branch is deleted. So, an unusual exit
is not needed.
2023-05-11 13:50:20 -04:00
Joey Hess
271f3b1ab4
uninit: Support --json and --json-error-messages
Had to convert uninit to do everything that can error out inside a
CommandStart. This was harder than feels nice.

(Also, in passing, converted CommandCheck to use a data type, not a
weird number that it was not clear how it managed to be unique.)

Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
2023-05-11 13:43:02 -04:00
Joey Hess
1904cebbb3
fix typo 2023-05-11 13:26:55 -04:00
Joey Hess
02cfef1f91
uninit: Avoid buffering the names of all annexed files in memory
Oops, using the same list twice does prevent streaming in constant memory.

Sponsored-by: unqueued on Patreon
2023-05-11 13:25:55 -04:00
Joey Hess
b8d9c18e98
remove unused import 2023-05-11 13:24:34 -04:00
Joey Hess
cd5108bb47
uninit: remove undocumented suport for specifying files to act on
I think this was just copied from another command without paying
attention to what it did, because there does not seem to be any valid
reason to want to only unannex some files when running uninit.
2023-05-11 13:23:41 -04:00