git/list[1] front-page[2] threads[3] people[4] search[5] about
 

per-repository and per-worktree config variables

From
Max Kirillov <max@max630.net>
Date
Mar 18, 2015, 21:33 UTC
Message-ID
<20150318213342.GA25692@wheezy.local>
In-Reply-To
<54D79EAB.6060301@web.de>
On Sun, Feb 08, 2015 at 09:36:43AM -0800, Jens Lehmann wrote:
Show 6 quoted lines
> I wonder if it's worth all the hassle to invent new names. Wouldn't
> it be much better to just keep a list of per-worktree configuration
> value names and use that inside the config code to decide where to
> find them for multiple work trees. That would also work easily for
> stuff like EOL-config and would push the complexity in the config
> machinery and not onto the user.

I actually thought about the same, and now tend to think that most of config variables make sense to be per-worktree in some cases. Only few variable must always be per repository. I tried to summarize the variables which now (in current pu) should be common, also listed all the rest so somebody could scan through the list and spot anything I could miss.

PS: some variables are with older case, they were mostly
collected before I got aware of their rename.
-- 
Max

Strictly common only
~~~~~~~~~~~~~~~~~~~~

Distributiveness
^^^^^^^^^^^^^^^^

A repository should behave same way regartdless of
which worktree is being accessed.

core.gitProxy::
core.askpass::
credential.helper::
credential.useHttpPath::
credential.username::
credential.<url>.*::
fetch.fsckObjects::
fetch.prune::
gitcvs.*::
gitweb.*::
gui.pruneduringfetch::
http.*::
push.followTags::
receive.*::
remote.<name>.*::
remotes.<group>::
transfer.fsckObjects::
transfer.hiderefs::
uploadarchive.allowUnreachable::
uploadpack.*::
url.<base>.insteadOf::
url.<base>.pushInsteadOf::
imap.*::

Repository storage options
^^^^^^^^^^^^^^^^^^^^^^^^^^

There should be same options of purging, compression etc.

core.compression::
core.loosecompression::
core.packedGitWindowSize::
core.packedGitLimit::
core.deltaBaseCacheLimit::
core.bigFileThreshold::
core.fsyncobjectfiles::
core.createObject::
core.logAllRefUpdates::
core.protectHFS::
core.protectNTFS::
fetch.unpackLimit::
fsck.skipList::
fsck.error::
fsck.warn::
fsck.ignore::
gc.*
pack.*
repack.*

Branch tracking settings
^^^^^^^^^^^^^^^^^^^^^^^^

Since branch are shared, they should be tracked same way
regardless of where are they updated.

branch.<name>.remote::
branch.<name>.pushremote::
branch.<name>.merge::
branch.<name>.mergeoptions::
branch.<name>.rebase::

Notes handling
^^^^^^^^^^^^^^

I don't know much about notes, and not sure about these ones, but notes looks
like a part of common history, and the options affect all of them.

notes.rewrite.<command>::
notes.rewriteMode::
notes.rewriteRef::

Misc
^^^^

core.preferSymlinkRefs::
	As description says, useful mostly for older scripts, which definitely
	not going to understand the new format. Probably incompatible with
	multiple worktrees at all.
core.repositoryFormatVersion::
	Looks like this is not used.
init.templatedir::
	This makes sense only as a global option.

Prefer common
~~~~~~~~~~~~~

Technically can be used per-worktree, but does not seem to have much sense.

Many of them are are actualy expected to be global.

advice.*::
core.ignorecase::
core.precomposeunicode::
core.trustctime::
core.checkstat::
core.quotepath::
core.symlinks::
core.ignoreStat::
core.warnAmbiguousRefs::
core.attributesfile::
	This should be common if it names tracked file.
core.editor::
core.commentchar::
sequence.editor::
core.pager::
core.preloadindex::
alias.*::
browser.<tool>.path::
color.branch::
color.diff::
color.diff.<slot>::
color.decorate.<slot>::
color.grep::
color.grep.<slot>::
color.interactive::
color.interactive.<slot>::
color.pager::
color.showbranch::
color.status::
color.status.<slot>::
color.ui::
color.branch.<slot>::
column.*::
commit.cleanup::
commit.gpgsign::
commit.status::
commit.template::
difftool.*::
fetch.recurseSubmodules::
	Since submodules can differ, this also can.
gui.commitmsgwidth::
gui.diffcontext::
gui.encoding::
	While in theory possible to use per-workree value, probably this is intended
	to correspond to the actual data in repository. Not sure though.
gui.trustmtime::
gui.spellingdictionary::
help.*
i18n.commitEncoding::
i18n.logOutputEncoding::
index.version::
instaweb.*::
mailmap.*::
man.*::
mergetool.*::
pager.*::
sendemail.*::
tar.umask::
user.email::
user.name::
user.signingkey::
web.browser::
mailinfo.scissors::

Ok to be per-worktree
~~~~~~~~~~~~~~~~~~~~~

core.fileMode::
core.eol::
core.safecrlf::
core.autocrlf::
core.bare::
core.worktree::
core.excludesfile::
core.whitespace::
core.notesRef::
core.sparseCheckout::
core.abbrev::
add.ignore-errors::
add.ignoreErrors::
am.keepcr::
apply.ignorewhitespace::
apply.whitespace::
branch.autosetupmerge::
branch.autosetuprebase::
clean.requireForce::
format.*::
filter.*::
	For some worktrees it may be desired to have them unsmudged.
grep.*::
gpg.program::
gui.displayuntracked::
gui.matchtrackingbranch::
gui.newbranchtemplate::
gui.fastcopyblame::
gui.copyblamethreshold::
gui.blamehistoryctx::
guitool.*
interactive.singlekey::
log.*::
notes.displayRef::
pretty.<name>::
pull.ff::
pull.rebase::
pull.octopus::
pull.twohead::
push.default::
rebase.stat::
rebase.autosquash::
rebase.autostash::
remote.pushdefault::
rerere.*::
showbranch.*::
status.*::
submodule.*::
tag.sort::
diff.*::
	not sure about  "diff.<driver>" commands, but I could imagine cases when it is desirable
merge.*::
	not sure about  "merge.<driver>" commands, but I could imagine cases when it is desirable
versionsort.prereleaseSuffix::
Previous: Duy NguyenNext: Duy Nguyen
Message 8 of 22 in “worktree.* config keys and submodule and multiple worktrees”
  1. 0/3 worktree.* config keys and submodule and multiple worktreesNguyễn Thái Ngọc Duy, Feb 8, 2015
  2. 1/3 config.c: new config namespace worktree.* stored in $GIT_DIR/config.worktreeNguyễn Thái Ngọc Duy, Feb 8, 2015
  3. 2/3 setup: add worktree.path to shadow core.worktreeNguyễn Thái Ngọc Duy, Feb 8, 2015
  4. 3/3 submodule: use worktree.path instead of core.worktreeNguyễn Thái Ngọc Duy, Feb 8, 2015
  5. Jens LehmannFeb 8, 2015
  6. Jens LehmannFeb 8, 2015
  7. Duy NguyenFeb 9, 2015
  8. per-repository and per-worktree config variablesMax Kirillov, Mar 18, 2015
  9. Duy NguyenMar 24, 2015
  10. config.c: split some variables to $GIT_DIR/config.worktreeNguyễn Thái Ngọc Duy, Mar 26, 2015
  11. Max KirillovMar 26, 2015
  12. Duy NguyenMar 29, 2015
  13. Max KirillovMar 30, 2015
  14. config.c: split some variables to $GIT_DIR/config.worktreeNguyễn Thái Ngọc Duy, Mar 31, 2015
  15. Duy NguyenMar 31, 2015
  16. Max KirillovApr 1, 2015
  17. Duy NguyenApr 3, 2015
  18. Max KirillovApr 13, 2015
  19. Duy NguyenApr 18, 2015
  20. Max KirillovApr 20, 2015
  21. Duy NguyenApr 20, 2015
  22. Jens LehmannMar 25, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.