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

Re: Git 1.1.6.g4d44 make test FAILURE report

From
Junio C Hamano <junkio@cox.net>
Date
Feb 11, 2006, 04:43 UTC
Message-ID
<7vwtg2pkt2.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7v1wyasfam.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> git-sh-setup one is easy to fix.  We could say something equally
> silly like this instead:

BTW, the reason I initially did this one and git-pull with git-var was there was no way to extract values from the config file easily from the command line back then. git-repo-config was initially called git-config-set and was about setting values.

IMHO the configuration mechanism, and git-var in particular, is quite broken, and nobody bothered to fix it.

 (1) git-var -l can show all defined variables in the config
     file, but you cannot ask about specific variable it does
     not know about.  You have to use git-repo-config for that:
	$ git var -l | head -n 4
        core.filemode=true
        core.gitproxy=none for kernel.org
        pull.twohead=resolve
        pull.octopus=octopus
	$ git var core.filemode ;# it does not know
        usage: git-var [-l | <variable>]
	$ git repo-config core.filemode
	true
 (2) git-repo-config does not have a way to list all the
     configuration items like "git-var -l".
 (3) neither of these commands know list of all the possible
     configuration items, nor types of them, so core.filename
     can be spelled as "1" or "true" to mean the same thing to
     our C code, but repo-config faithfully returns how the
     value is literally spelled in the configuration file.  The
     following two means the same thing to the C layer, so the
     calling script needs to further interpret the output from
     git-repo-config:
	$ git repo-config core.filemode ;# [core] filemode=1
	1
	$ git repo-config core.filemode ;# [core] filemode=true
	true
 (4) worse, boolean 'true' can be specified by just having the
     configuration item in the file, but repo-config dumps core
     on that:
	$ git repo-config core.filemode ;# [core] filemode
        segmentation fault

Above problems are not the only problems with git-var and git-repo-config, but these are not entirely these programs' faults. They come from the way the configuration file mechanism works. To allow different classes of configuration items to be defined by commands that know about them, there is no central registry of all the supported configuration items in the code. For example, "diff.*" configuration items can be interpreted only by C level programs that call git_config(git_diff_config).

With the current structure, it is very hard for these commands to sensibly list all the configuration values (e.g. lack of "[core] filemode" in the configuration file ought to mean that the executable bit is unreliable i.e. core.filemode=false, but they cannot report it), or report the values taking into account their types. I do not think they even attempt to do so.

Previous: Junio C HamanoNext: Johannes Schindelin
Message 7 of 10 in “Git 1.1.6.g4d44 make test FAILURE report”
  1. A Large Angry SCMFeb 10, 2006
  2. Junio C HamanoFeb 10, 2006
  3. A Large Angry SCMFeb 11, 2006
  4. Junio C HamanoFeb 11, 2006
  5. A Large Angry SCMFeb 11, 2006
  6. Junio C HamanoFeb 11, 2006
  7. Junio C HamanoFeb 11, 2006
  8. Teach repo-config the -l and --get-regexp optionsJohannes Schindelin, Feb 11, 2006
  9. Junio C HamanoFeb 12, 2006
  10. Add support for explicit type specifiers when calling git-repo-configPetr Baudis, Feb 12, 2006

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.