sapling icon indicating copy to clipboard operation
sapling copied to clipboard

`remotenames` config options not documented

Open indygreg opened this issue 3 years ago • 1 comments

As part of trying to pull non-default branches/bookmarks from a remote Git repo (related to #209), I tried to figure out how to coerce the remotenames extension to do what I want.

sl config remotenames shows plenty of options. But neither sl help -e remotenames nor sl help config document these options.

Consider this issue a feature request to document all the remotenames config options.

indygreg avatar Nov 22 '22 04:11 indygreg

There are some areas that we might want to tweak before finalizing related documentation.

Exchange related:

  • clone should probably figure out the main branch directly (by ls-remote and check HEAD(does it work?)), without require setting remotenames.selectivepulldefault.
  • We might want to use different config names without mentioning "selective pull".
  • Might make sense to treat push --to remote/name as push remote --to name.

Phase related:

Use-cases:

  • For cinder, branches like remote/cinder/3.10 or remote/cinder/3.8 should be treated as public. Otherwise smartlog would contain too many uninteresting commits.
  • For personal GitHub projects, remote branches would be better draft.
  • For internal monorepo, remote branches are public except for some prefixes.

One of the ideas I have is to support a more flexible way to config phases:

[phases]
# a list of "glob_pattern=phase"; "phase" can be draft, public, and auto
# first match takes effect
patterns = remote/foo/*=public, remote/bar/*=draft, *=auto

auto means it's draft if the head is authored by the user, or public if not. Besides, we might want to track the remotename -> phase mapping in metalog and support using the phase command to tweak them.

Others

The remotenames have other random configs. Some of them are outdated. We might want to delete before documenting:

Keep and document:

remotenames.autopullhoistpattern=
remotenames.autopullpattern=
remotenames.hoist=remote
remotenames.rename.default=remote

Rename, split (?) (see above):

remotenames.selectivepulldefault=master, stable

Remove:

remotenames.cachedistance=False
remotenames.disallowedbookmarks=remote/master
remotenames.disallowedhint=please don't specify 'remote/' prefix in remote bookmark's name
remotenames.disallowedto=^remote/
remotenames.fastheaddiscovery=False
remotenames.precachecurrent=False
remotenames.precachedistance=False
remotenames.pushanonheads=False
remotenames.pushrev=.
remotenames.resolvenodes=False
remotenames.selectivepull=True
remotenames.transitionbookmarks=@, master, stable

quark-zju avatar Dec 06 '22 18:12 quark-zju