1. 10 Oct, 2005 1 commit
    • Linus Torvalds's avatar
      Add ".git/config" file parser · 17712991
      Linus Torvalds authored
      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: default avatarLinus Torvalds <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      17712991
  2. 02 Oct, 2005 1 commit
    • Linus Torvalds's avatar
      [PATCH] Better error reporting for "git status" · 5d1a5c02
      Linus Torvalds authored
      Instead of "git status" ignoring (and hiding) potential errors from the
      "git-update-index" call, make it exit if it fails, and show the error.
      
      In order to do this, use the "-q" flag (to ignore not-up-to-date files)
      and add a new "--unmerged" flag that allows unmerged entries in the index
      without any errors.
      
      This also avoids marking the index "changed" if an entry isn't actually
      modified, and makes sure that we exit with an understandable error message
      if the index is corrupt or unreadable. "read_cache()" no longer returns an
      error for the caller to check.
      
      Finally, make die() and usage() exit with recognizable error codes, if we
      ever want to check the failure reason in scripts.
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      5d1a5c02
  3. 25 Sep, 2005 1 commit
  4. 20 Sep, 2005 1 commit
    • Junio C Hamano's avatar
      Show modified files in git-ls-files · b0391890
      Junio C Hamano authored
      Add -m/--modified to show files that have been modified wrt. the index.
      
      [jc: The original came from Brian Gerst on Sep 1st but it only checked
      if the paths were cache dirty without actually checking the files were
      modified.  I also added the usage string and a new test.]
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      b0391890
  5. 11 Sep, 2005 1 commit
  6. 17 Aug, 2005 1 commit
  7. 30 Jul, 2005 1 commit
    • Pavel Roskin's avatar
      [PATCH] mmap error handling · e35f9824
      Pavel Roskin authored
      I have reviewed all occurrences of mmap() in git and fixed three types
      of errors/defects:
      
      1) The result is not checked.
      2) The file descriptor is closed if mmap() succeeds, but not when it
      fails.
      3) Various casts applied to -1 are used instead of MAP_FAILED, which is
      specifically defined to check mmap() return value.
      
      [jc: This is a second round of Pavel's patch.  He fixed up the problem
      that close() potentially clobbering the errno from mmap, which
      the first round had.]
      Signed-off-by: Pavel Roskin's avatarPavel Roskin <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      e35f9824
  8. 14 Jul, 2005 1 commit
  9. 25 Jun, 2005 1 commit
    • Junio C Hamano's avatar
      [PATCH] Fix oversimplified optimization for add_cache_entry(). · b155725d
      Junio C Hamano authored
      An earlier change to optimize directory-file conflict check
      broke what "read-tree --emu23" expects.  This is fixed by this
      commit.
      
      (1) Introduces an explicit flag to tell add_cache_entry() not to
          check for conflicts and use it when reading an existing tree
          into an empty stage --- by definition this case can never
          introduce such conflicts.
      
      (2) Makes read-cache.c:has_file_name() and read-cache.c:has_dir_name()
          aware of the cache stages, and flag conflict only with paths
          in the same stage.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      b155725d
  10. 19 Jun, 2005 2 commits
    • Linus Torvalds's avatar
      read-cache.c: remove stray debugging printf · 2160a025
      Linus Torvalds authored
      Pointed out by Junio, part of my debugging of the rewrite of the
      file/dir conflict handling.
      2160a025
    • Linus Torvalds's avatar
      Re-implement "check_file_directory_conflict()" · 12676608
      Linus Torvalds authored
      This is (imho) more readable, and is also a lot faster.  The expense of
      looking up sub-directory beginnings was killing us on things like
      "git-diff-cache", even though that one didn't even care at all about the
      file vs directory conflicts.
      
      We really only care when somebody tries to add a conflicting name to
      stage 0.
      
      We should go through the conflict rules more carefully some day.
      12676608
  11. 10 Jun, 2005 1 commit
  12. 09 Jun, 2005 1 commit
  13. 07 Jun, 2005 1 commit
  14. 27 May, 2005 1 commit
    • David Meybohm's avatar
      [PATCH] check_file_directory_conflict path fix · 8310c2c0
      David Meybohm authored
      check_file_directory_conflict can give the wrong answers. This is
      because the wrong length is passed to cache_name_pos. The length
      passed should be the length of the whole path from the root, not
      the length of each path subcomponent.
      
      	$ git-init-db
      	defaulting to local storage area
      	$ mkdir path && touch path/file
      	$ git-update-cache --add path/file
      	$ rm path/file
      	$ mkdir path/file && touch path/file/f
      	$ git-update-cache --add path/file/f  <-- Conflict ignored
      	$
      Signed-off-by: default avatarDavid Meybohm <[email protected]>
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      8310c2c0
  15. 22 May, 2005 2 commits
    • Linus Torvalds's avatar
      Don't care about st_dev in the index file · 2cb45e95
      Linus Torvalds authored
      Thomas Glanzmann points out that it doesn't work well with different
      clients accessing the repository over NFS - they have different views
      on what the "device" for the filesystem is.
      
      Of course, other filesystems may not even have stable inode numbers.
      But we don't care. At least for now.
      2cb45e95
    • Linus Torvalds's avatar
      Include file cleanups.. · 6b0c3121
      Linus Torvalds authored
      Add <limits.h> to the include files handled by "cache.h", and remove
      extraneous #include directives from various .c files. The rule is that
      "cache.h" gets all the basic stuff, so that we'll have as few system
      dependencies as possible.
      6b0c3121
  16. 20 May, 2005 1 commit
  17. 19 May, 2005 1 commit
  18. 18 May, 2005 1 commit
  19. 15 May, 2005 2 commits
  20. 08 May, 2005 3 commits
  21. 07 May, 2005 1 commit
  22. 06 May, 2005 2 commits
  23. 05 May, 2005 1 commit
  24. 27 Apr, 2005 1 commit
  25. 26 Apr, 2005 1 commit
  26. 23 Apr, 2005 1 commit
    • Linus Torvalds's avatar
      New "diff-cache" implementation. · b5af9107
      Linus Torvalds authored
      This one is about a million times simpler, and much more likely to be
      correct too.
      
      Instead of trying to match up a tree object against the index, we just
      read in the tree object side-by-side into the index, and just walk the
      resulting index file. This was what all the read-tree cleanups were
      all getting to.
      b5af9107
  27. 21 Apr, 2005 2 commits
  28. 20 Apr, 2005 2 commits
  29. 18 Apr, 2005 2 commits
  30. 17 Apr, 2005 2 commits