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
This commit is contained in:
Joey Hess 2023-05-17 12:33:57 -04:00
parent 5df89d58c7
commit 40731ff9fd
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 11 additions and 6 deletions

View file

@ -57,6 +57,7 @@ git-annex (10.20230408) UNRELEASED; urgency=medium
--content. With --no-pull, avoid downloading content, and with
--no-push avoid uploading content. This was done before, but
inconsistently.
* sync: Added -g as a short option for --no-content.
* uninit: Avoid buffering the names of all annexed files in memory.
-- Joey Hess <id@joeyh.name> Sat, 08 Apr 2023 13:57:18 -0400

View file

@ -181,6 +181,7 @@ optParser mode desc = SyncOptions
)
<*> switch
( long "no-content"
<> short 'g'
<> help "do not transfer annexed file contents"
)
<*> many (strOption

View file

@ -67,9 +67,9 @@ See [[git-annex-preferred-content]](1).
When this is combined with --no-content, only the git-annex branch
will be pulled.
* `--no-content`, `--content`
* `--no-content, `-g`, `--content`
Use `--no-content` to avoid downloading (and dropping)
Use `--no-content` or `-g` to avoid downloading (and dropping)
the content of annexed files.
If you often use `--no-content`, you can set the `annex.synccontent`

View file

@ -76,10 +76,10 @@ See [[git-annex-preferred-content]](1).
When this is combined with --no-content, only the git-annex branch
will be pulled.
* `--no-content`, `--content`
* `--no-content`, `-g`, `--content`
Use `--no-content` to avoid uploading (and dropping) the content of annexed
files.
Use `--no-content` or `-g` to avoid uploading (and dropping) the content
of annexed files.
If you often use `--no-content`, you can set the `annex.synccontent`
configuration to false to prevent uploading content by default.

View file

@ -19,11 +19,14 @@ content by default. This may change in a future version of git-annex.
# OPTIONS
* `--content`, `--no-content`
* `--content`, `--no-content`, `-g`
The --content option causes the content of annexed files
to also be pulled and pushed.
The --no-content and -g options cause the content of annexed files to
not be pulled and pushed.
The `annex.synccontent` configuration can be set to true to make
`--content` be enabled by default.