Title: scalar: feature request: document config options for register · Issue #751 · microsoft/git · GitHub
Open Graph Title: scalar: feature request: document config options for register · Issue #751 · microsoft/git
X Title: scalar: feature request: document config options for register · Issue #751 · microsoft/git
Description: I would like to know which git config options are set a result of running scalar register. Motivation, I recently encountered my first usage of scalar, which looked something like: $ scalar register $ git pull fetch normally indicates wh...
Open Graph Description: I would like to know which git config options are set a result of running scalar register. Motivation, I recently encountered my first usage of scalar, which looked something like: $ scalar registe...
X Description: I would like to know which git config options are set a result of running scalar register. Motivation, I recently encountered my first usage of scalar, which looked something like: $ scalar registe...
Opengraph URL: https://github.com/microsoft/git/issues/751
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"scalar: feature request: document config options for register","articleBody":"I would like to know which `git` config options are set a result of running `scalar register`.\n\n**Motivation**, I recently encountered my first usage of `scalar`, which looked something like:\n\n```console\n$ scalar register\n$ git pull\nfetch normally indicates which branches had a forced update,\nbut that check has been disabled; to re-enable, use '--show-forced-updates'\nflag or run 'git config fetch.showForcedUpdates true'\n\u003c--- SNIP: rest of the fetch output ---\u003e\n```\n\nI was confused by this warning: I didn't remember having set that option, and was wondering why it might've been set. Without further context, my instinct would be to follow the provided instruction and run `git config fetch.showForcedUpdates true'`\n\n**Proposal**\n\nAdd comments when `register` sets config values to at least help identify the source of the change, something like:\n\n```\n[fetch]\n\tshowForcedUpdates = true # set by scalar\n```\n\nOtherwise, in the absence of any further content users (or at least me) may be tempted to unset this variable (and possibly others) to:\n\n* Silence warnings like the above\n* As a matter of house cleaning: I'll sometimes look over configurations and remove options I think might be superfluous (especially if I can't remember why it was added)\n\nAdditionally: it would be nice to document _why_ a config value is set: how is setting this config variable expected to improve performance?\n\n```\n[fetch]\n\tshowForcedUpdates = true # set by scalar: checking for forced updates requires walking additional commits and calculations that may slow fetches significantly\n```\n\nHere's a patch for a proof-of-concept:\n\n```diff\ndiff --git i/scalar.c w/scalar.c\nindex bb3edceddb..af07945fe0 100644\n--- i/scalar.c\n+++ w/scalar.c\n@@ -137,18 +137,21 @@ struct scalar_config {\n static int set_scalar_config(const struct scalar_config *config, int reconfigure)\n {\n \tchar *value = NULL;\n+\tchar *file = NULL;\n \tint res;\n \n \tif ((reconfigure \u0026\u0026 config-\u003eoverwrite_on_reconfigure) ||\n \t git_config_get_string(config-\u003ekey, \u0026value)) {\n \t\ttrace2_data_string(\"scalar\", the_repository, config-\u003ekey, \"created\");\n-\t\tres = git_config_set_gently(config-\u003ekey, config-\u003evalue);\n+\t\tfile = repo_git_path(the_repository, \"config\");\n+\t\tres = git_config_set_in_file_gently(file, config-\u003ekey, \" # set by scalar\", config-\u003evalue);\n \t} else {\n \t\ttrace2_data_string(\"scalar\", the_repository, config-\u003ekey, \"exists\");\n \t\tres = 0;\n \t}\n \n \tfree(value);\n+\tfree(file);\n \treturn res;\n }\n```","author":{"url":"https://github.com/matthewhughes934","@type":"Person","name":"matthewhughes934"},"datePublished":"2025-05-12T19:04:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/751/git/issues/751"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b9c3af48-73f3-9c66-b2d2-f40064a2cbaa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C46A:4652C:6F32A:96D0F:698F1B4F |
| html-safe-nonce | 46fba2af624ca0b94de1099aae3997b4e56afd16e9bbbac02a7134a5bb6241f6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDZBOjQ2NTJDOjZGMzJBOjk2RDBGOjY5OEYxQjRGIiwidmlzaXRvcl9pZCI6Ijg3NjI1ODU5OTEyMzgwNjQ5NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1528d6d69b1998ee692e7b4345a85664885db0717d0fb675e081a3e70c5d083c |
| hovercard-subject-tag | issue:3057875150 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/git/751/issue_layout |
| twitter:image | https://opengraph.githubassets.com/410b4cd0dbfd788692c30932ee46e528188f04435c73a041061fa8ef837fbdc2/microsoft/git/issues/751 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/410b4cd0dbfd788692c30932ee46e528188f04435c73a041061fa8ef837fbdc2/microsoft/git/issues/751 |
| og:image:alt | I would like to know which git config options are set a result of running scalar register. Motivation, I recently encountered my first usage of scalar, which looked something like: $ scalar registe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | matthewhughes934 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2da1a0d1318592c9965539b12269c4641177dfabfc86c3807992efb13e1d96ff |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/git git https://github.com/microsoft/git.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 79856983 |
| octolytics-dimension-repository_nwo | microsoft/git |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 23216272 |
| octolytics-dimension-repository_parent_nwo | git-for-windows/git |
| octolytics-dimension-repository_network_root_id | 36502 |
| octolytics-dimension-repository_network_root_nwo | git/git |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c9646ffd6f86b00952c2b39e3c62e15904eff1e5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width