diff options
author | 2017-01-30 16:41:29 -0400 | |
---|---|---|
committer | 2017-01-30 16:46:38 -0400 | |
commit | 9b17947b394cc2720b15aaf44e6fb7703ba8513f (patch) | |
tree | d97e570df7bf859031713d3963baf4be7f65bfbf /doc | |
parent | dc2095666d7b8e39ec3e1f2f26dca7eceff34877 (diff) |
config: New command for storing configuration in the git-annex branch.
Any config names can be set using this; git-annex commands will only look
at specific ones that make sense and are worth the overhead of querying the
branch.
This might also be useful for storing whatever other config-type stuff the
user might want to shove into the git-annex branch.
This commit was sponsored by Jochen Bartl on Patreon.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/git-annex-config.mdwn | 56 | ||||
-rw-r--r-- | doc/git-annex-sync.mdwn | 4 | ||||
-rw-r--r-- | doc/git-annex.mdwn | 9 | ||||
-rw-r--r-- | doc/internals.mdwn | 10 | ||||
-rw-r--r-- | doc/todo/wishlist__58___per-repository_autocommit__61__false/comment_1_851483817d97de212932203c2e830293._comment | 38 |
5 files changed, 116 insertions, 1 deletions
diff --git a/doc/git-annex-config.mdwn b/doc/git-annex-config.mdwn new file mode 100644 index 000000000..1e1819bb7 --- /dev/null +++ b/doc/git-annex-config.mdwn @@ -0,0 +1,56 @@ +# NAME + +git-annex config - configuration stored in git-annex branch + +# SYNOPSIS + +git annex config --set name value + +git annex config --get name + +git annex config --unset name + +# DESCRIPTION + +Set or get configuration settings stored in the git-annex branch. + +Unlike `git config` settings, these settings can be seen +in all clones of the repository, once they have gotten their +git-annex branches in sync. + +# SUPPORTED SETTINGS + +git-annex does not check the git-annex branch for all settings. +Only a few make sense to be able to set such that all clones of a +repository see the setting, and so git-annex only looks for these: + +These settings can be overridden on a per-repository basis using +`git config`: + +None yet! + +# EXAMPLE + +Suppose you want to prevent git annex sync from committing changes +to files, so a manual git commit workflow is used in all clones of the +repository. Then run: + + git annex config --set annex.autocommit false + +If you change your mind, you can get back to the default behavior: + + git annex config --unset annex.autocommit + +# SEE ALSO + +[[git-annex]](1) + +git-config(1) + +[[git-annex-vicfg]](1) + +# AUTHOR + +Joey Hess <id@joeyh.name> + +Warning: Automatically converted into a man page by mdwn2man. Edit with care. diff --git a/doc/git-annex-sync.mdwn b/doc/git-annex-sync.mdwn index d60033de4..f0dce8114 100644 --- a/doc/git-annex-sync.mdwn +++ b/doc/git-annex-sync.mdwn @@ -42,7 +42,9 @@ by running "git annex sync" on the remote. * `--commit`, `--no-commit` - A commit is done by default. Use --no-commit to avoid committing local changes. + A commit is done by default (unless annex.autocommit is set to false). + + Use --no-commit to avoid committing local changes. * `--message=msg` diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index ca1ac3620..af6342164 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -280,6 +280,12 @@ subdirectories). See [[git-annex-schedule]](1) for details. +* `config` + + Get and set other configuration stored in git-annex branch. + + See [[git-annex-config]](1) for details. + * `vicfg` Opens EDITOR on a temp file containing most of the above configuration @@ -1000,6 +1006,9 @@ Here are all the supported configuration settings. Set to false to prevent the git-annex assistant and git-annex sync from automatically committing changes to files in the repository. + To configure the behavior in all repositories, this can be set in + [[git-annex-config]]. + * `annex.startupscan` Set to false to prevent the git-annex assistant from scanning the diff --git a/doc/internals.mdwn b/doc/internals.mdwn index 329961ccd..78d0c8d47 100644 --- a/doc/internals.mdwn +++ b/doc/internals.mdwn @@ -100,6 +100,16 @@ Records the global numcopies setting. The file format is simply a timestamp followed by a number. +## `config.log` + +Records global configuration settings, which can be overridden by values +in `.git/config`. + +The file format is a timestamp, followed by the name of the configuration, +followed by the value. For example: + + 1317929189.157237s annex.autocommit false + ## `remote.log` Holds persistent configuration settings for [[special_remotes]] such as diff --git a/doc/todo/wishlist__58___per-repository_autocommit__61__false/comment_1_851483817d97de212932203c2e830293._comment b/doc/todo/wishlist__58___per-repository_autocommit__61__false/comment_1_851483817d97de212932203c2e830293._comment new file mode 100644 index 000000000..7e5d85038 --- /dev/null +++ b/doc/todo/wishlist__58___per-repository_autocommit__61__false/comment_1_851483817d97de212932203c2e830293._comment @@ -0,0 +1,38 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2017-01-30T18:13:42Z" + content=""" +This could be put in the git-annex branch similarly to the `git annex +numcopies` configuration so all clones see it. + +As well as --no-commit, --content is the other option that I think +might make sense to have a clone-wide setting for. sync's --no-pull and +--no-push seem much less likely to need such a setting. + +I've been leaning toward eventually turning sync --content on by default, +and such a clone-wide configuration would be useful to let users get back +the current behavior. + +Hmm, this could be generalized all the way to having a file in the +git-annex branch that stores default settings for `annex.*` configs. +But then git-annex would have to pull that file out of the git-annex branch +every time it's run, which would slow down commands that get run a lot in +succession. So that's a generalization too far. + +Still, looking through the configs, I can see some other things +that it would similarly make sense to sometimes want to set clone-wide, +including: annex.genmetadata, annex.used-refspec, annex.diskreserve, +annex.addsmallfiles. + +So, we have some configs that are each only used by a few commands, +that make sense to be allowed to be set clone-wide. We can make the file +in the git-annex branch be only read by commands that look at those +configs, and can consider when implementing each whether it would slow +down any command too much to have it need to read the git-annex branch +file. + +I've added a `git annex config` command that can set such clone-wide +configurations. I have not yet made git annex sync look at it for +annex.autocommit. +"""]] |