1. 28 11月, 2005 1 次提交
  2. 27 11月, 2005 1 次提交
    • J
      init-db: check template and repository format. · 4f629539
      Junio C Hamano 提交于
      This makes init-db repository version aware.
      
      It checks if an existing config file says the repository being
      reinitialized is of a wrong version and aborts before doing
      further harm.
      
      When copying the templates, it makes sure the they are of the
      right repository format version.  Otherwise the templates are
      ignored with an warning message.
      
      It copies the templates before creating the HEAD, and if the
      config file is copied from the template directory, reads it,
      primarily to pick up the value of core.symrefsonly.
      
      It changes the way the result of the filemode reliability test
      is written to the configuration file using git_config_set().
      The test is done even if the config file was copied from the
      templates.
      
      And finally, our own repository format version is written to the
      config file.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      4f629539
  3. 26 11月, 2005 1 次提交
  4. 22 11月, 2005 3 次提交
  5. 21 11月, 2005 1 次提交
  6. 20 11月, 2005 2 次提交
    • J
      git-config-set: add more options · 4ddba79d
      Johannes Schindelin 提交于
      ... namely
      
      --replace-all, to replace any amount of matching lines, not just 0 or 1,
      --get, to get the value of one key,
      --get-all, the multivar version of --get, and
      --unset-all, which deletes all matching lines from .git/config
      Signed-off-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      4ddba79d
    • J
      Add functions git_config_set() and git_config_set_multivar() · 10bea152
      Johannes Schindelin 提交于
      The function git_config_set() does exactly what you think it does.
      Given a key (in the form "core.filemode") and a value, it sets the
      key to the value. Example:
      
      	git_config_set("core.filemode", "true");
      
      The function git_config_set_multivar() is meant for setting variables which
      can have several values for the same key. Example:
      
      	[diff]
      		twohead = resolve
      		twohead = recarsive
      
      the typo in the second line can be replaced by
      
      	git_config_set_multivar("diff.twohead", "recursive", "^recar");
      
      The third argument of the function is a POSIX extended regex which has to
      match the value. If there is no key/value pair with a matching value, a new
      key/value pair is added.
      
      These commands are also capable of unsetting (deleting) entries:
      
      	git_config_set_multivar("diff.twohead", NULL, "sol");
      
      will delete the entry
      
      		twohead = resolve
      Signed-off-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      10bea152
  7. 16 11月, 2005 2 次提交
    • J
      diff: make default rename detection limit configurable. · 3299c6f6
      Junio C Hamano 提交于
      A while ago, a rename-detection limit logic was implemented as a
      response to this thread:
      
      	http://marc.theaimsgroup.com/?l=git&m=112413080630175
      
      where gitweb was found to be using a lot of time and memory to
      detect renames on huge commits.  git-diff family takes -l<num>
      flag, and if the number of paths that are rename destination
      candidates (i.e. new paths with -M, or modified paths with -C)
      are larger than that number, skips rename/copy detection even
      when -M or -C is specified on the command line.
      
      This commit makes the rename detection limit easier to use.  You
      can have:
      
      	[diff]
      		renamelimit = 30
      
      in your .git/config file to specify the default rename detection
      limit.  You can override this from the command line; giving 0
      means 'unlimited':
      
      	git diff -M -l0
      
      We might want to change the default behaviour, when you do not
      have the configuration, to limit it to say 20 paths or so.  This
      would also help the diffstat generation after a big 'git pull'.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3299c6f6
    • J
      Add config variable core.symrefsonly · f8348be3
      Johannes Schindelin 提交于
      This allows you to force git to avoid symlinks for refs. Just add
      something like
      
      	[core]
      		symrefsonly = true
      
      to .git/config.
      
      Don´t forget to "git checkout your_branch", or it does not do anything...
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f8348be3
  8. 03 11月, 2005 1 次提交
  9. 15 10月, 2005 1 次提交
  10. 12 10月, 2005 3 次提交
    • L
      Make git config variable names case-insensitive · 128af9d1
      Linus Torvalds 提交于
      They always were meant to be case-insensitive, but I had missed one
      "tolower()", making that not true.
      
      The actual _values_ aren't case-insensitive, of course, although some uses
      of them may be (ie boolean parsing uses "strcasecmp()" to match against
      the strings "true" and "false").
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      128af9d1
    • L
      Use git config file for committer name and email info · e1b10391
      Linus Torvalds 提交于
      This starts using the "user.name" and "user.email" config variables if
      they exist as the default name and email when committing.  This means
      that you don't have to use the GIT_COMMITTER_EMAIL environment variable
      to override your email - you can just edit the config file instead.
      
      The patch looks bigger than it is because it makes the default name and
      email information non-static and renames it appropriately.  And it moves
      the common git environment variables into a new library file, so that
      you can link against libgit.a and get the git environment without having
      to link in zlib and libcrypt.
      
      In short, most of it is renaming and moving, the real change core is
      just a few new lines in "git_default_config()" that copies the user
      config values to the new base.
      
      It also changes "git-var -l" to list the config variables.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e1b10391
    • L
      Improve config file escape sanity checking · 5cbb401d
      Linus Torvalds 提交于
      I had meant to disallow unknown escape characters in the config file
      parser, but instead an unknown escaped character would silently pass
      through as itself. That's correct for some cases (notably '\' itself), but
      wasn't correct in general.
      
      This fixes it, and makes the parser write a nice error message if the
      config file contains bogus escaped characters.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5cbb401d
  11. 11 10月, 2005 1 次提交
    • L
      Add ".git/config" file parser · 17712991
      Linus Torvalds 提交于
      This is a first cut at a very simple parser for a git config file.
      
      The format of the file is a simple ini-file like thing, with simple
      variable/value pairs. You can (and should) make the variables have a
      simple single-level scope, ie a valid file looks something like this:
      
      	#
      	# This is the config file, and
      	# a '#' or ';' character indicates
      	# a comment
      	#
      
      	; core variables
      	[core]
      		; Don't trust file modes
      		filemode = false
      
      	; Our diff algorithm
      	[diff]
      		external = "/usr/local/bin/gnu-diff -u"
      		renames = true
      
      which parses into three variables: "core.filemode" is associated with the
      string "false", and "diff.external" gets the appropriate quoted value.
      
      Right now we only react to one variable: "core.filemode" is a boolean that
      decides if we should care about the 0100 (user-execute) bit of the stat
      information. Even that is just a parsing demonstration - this doesn't
      actually implement that st_mode compare logic itself.
      
      Different programs can react to different config options, although they
      should always fall back to calling "git_default_config()" on any config
      option name that they don't recognize.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      17712991