1. 16 2月, 2008 1 次提交
  2. 11 12月, 2007 1 次提交
    • J
      Support GIT_PAGER_IN_USE environment variable · 6e9af863
      Jeff King 提交于
      When deciding whether or not to turn on automatic color
      support, git_config_colorbool checks whether stdout is a
      tty. However, because we run a pager, if stdout is not a
      tty, we must check whether it is because we started the
      pager. This used to be done by checking the pager_in_use
      variable.
      
      This variable was set only when the git program being run
      started the pager; there was no way for an external program
      running git indicate that it had already started a pager.
      This patch allows a program to set GIT_PAGER_IN_USE to a
      true value to indicate that even though stdout is not a tty,
      it is because a pager is being used.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6e9af863
  3. 06 12月, 2007 1 次提交
    • J
      Use gitattributes to define per-path whitespace rule · cf1b7869
      Junio C Hamano 提交于
      The `core.whitespace` configuration variable allows you to define what
      `diff` and `apply` should consider whitespace errors for all paths in
      the project (See gitlink:git-config[1]).  This attribute gives you finer
      control per path.
      
      For example, if you have these in the .gitattributes:
      
          frotz   whitespace
          nitfol  -whitespace
          xyzzy   whitespace=-trailing
      
      all types of whitespace problems known to git are noticed in path 'frotz'
      (i.e. diff shows them in diff.whitespace color, and apply warns about
      them), no whitespace problem is noticed in path 'nitfol', and the
      default types of whitespace problems except "trailing whitespace" are
      noticed for path 'xyzzy'.  A project with mixed Python and C might want
      to have:
      
          *.c    whitespace
          *.py   whitespace=-indent-with-non-tab
      
      in its toplevel .gitattributes file.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cf1b7869
  4. 17 11月, 2007 1 次提交
    • J
      core.excludesfile clean-up · dcf0c16e
      Junio C Hamano 提交于
      There are inconsistencies in the way commands currently handle
      the core.excludesfile configuration variable.  The problem is
      the variable is too new to be noticed by anything other than
      git-add and git-status.
      
       * git-ls-files does not notice any of the "ignore" files by
         default, as it predates the standardized set of ignore files.
         The calling scripts established the convention to use
         .git/info/exclude, .gitignore, and later core.excludesfile.
      
       * git-add and git-status know about it because they call
         add_excludes_from_file() directly with their own notion of
         which standard set of ignore files to use.  This is just a
         stupid duplication of code that need to be updated every time
         the definition of the standard set of ignore files is
         changed.
      
       * git-read-tree takes --exclude-per-directory=<gitignore>,
         not because the flexibility was needed.  Again, this was
         because the option predates the standardization of the ignore
         files.
      
       * git-merge-recursive uses hardcoded per-directory .gitignore
         and nothing else.  git-clean (scripted version) does not
         honor core.* because its call to underlying ls-files does not
         know about it.  git-clean in C (parked in 'pu') doesn't either.
      
      We probably could change git-ls-files to use the standard set
      when no excludes are specified on the command line and ignore
      processing was asked, or something like that, but that will be a
      change in semantics and might break people's scripts in a subtle
      way.  I am somewhat reluctant to make such a change.
      
      On the other hand, I think it makes perfect sense to fix
      git-read-tree, git-merge-recursive and git-clean to follow the
      same rule as other commands.  I do not think of a valid use case
      to give an exclude-per-directory that is nonstandard to
      read-tree command, outside a "negative" test in the t1004 test
      script.
      
      This patch is the first step to untangle this mess.
      
      The next step would be to teach read-tree, merge-recursive and
      clean (in C) to use setup_standard_excludes().
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dcf0c16e
  5. 15 11月, 2007 1 次提交
    • J
      core.excludesfile clean-up · 039bc64e
      Junio C Hamano 提交于
      There are inconsistencies in the way commands currently handle
      the core.excludesfile configuration variable.  The problem is
      the variable is too new to be noticed by anything other than
      git-add and git-status.
      
       * git-ls-files does not notice any of the "ignore" files by
         default, as it predates the standardized set of ignore files.
         The calling scripts established the convention to use
         .git/info/exclude, .gitignore, and later core.excludesfile.
      
       * git-add and git-status know about it because they call
         add_excludes_from_file() directly with their own notion of
         which standard set of ignore files to use.  This is just a
         stupid duplication of code that need to be updated every time
         the definition of the standard set of ignore files is
         changed.
      
       * git-read-tree takes --exclude-per-directory=<gitignore>,
         not because the flexibility was needed.  Again, this was
         because the option predates the standardization of the ignore
         files.
      
       * git-merge-recursive uses hardcoded per-directory .gitignore
         and nothing else.  git-clean (scripted version) does not
         honor core.* because its call to underlying ls-files does not
         know about it.  git-clean in C (parked in 'pu') doesn't either.
      
      We probably could change git-ls-files to use the standard set
      when no excludes are specified on the command line and ignore
      processing was asked, or something like that, but that will be a
      change in semantics and might break people's scripts in a subtle
      way.  I am somewhat reluctant to make such a change.
      
      On the other hand, I think it makes perfect sense to fix
      git-read-tree, git-merge-recursive and git-clean to follow the
      same rule as other commands.  I do not think of a valid use case
      to give an exclude-per-directory that is nonstandard to
      read-tree command, outside a "negative" test in the t1004 test
      script.
      
      This patch is the first step to untangle this mess.
      
      The next step would be to teach read-tree, merge-recursive and
      clean (in C) to use setup_standard_excludes().
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      039bc64e
  6. 03 11月, 2007 1 次提交
    • J
      War on whitespace: first, a bit of retreat. · a9cc857a
      Junio C Hamano 提交于
      This introduces core.whitespace configuration variable that lets
      you specify the definition of "whitespace error".
      
      Currently there are two kinds of whitespace errors defined:
      
       * trailing-space: trailing whitespaces at the end of the line.
      
       * space-before-tab: a SP appears immediately before HT in the
         indent part of the line.
      
      You can specify the desired types of errors to be detected by
      listing their names (unique abbreviations are accepted)
      separated by comma.  By default, these two errors are always
      detected, as that is the traditional behaviour.  You can disable
      detection of a particular type of error by prefixing a '-' in
      front of the name of the error, like this:
      
      	[core]
      		whitespace = -trailing-space
      
      This patch teaches the code to output colored diff with
      DIFF_WHITESPACE color to highlight the detected whitespace
      errors to honor the new configuration.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a9cc857a
  7. 01 8月, 2007 2 次提交
    • J
      Clean up work-tree handling · e90fdc39
      Johannes Schindelin 提交于
      The old version of work-tree support was an unholy mess, barely readable,
      and not to the point.
      
      For example, why do you have to provide a worktree, when it is not used?
      As in "git status".  Now it works.
      
      Another riddle was: if you can have work trees inside the git dir, why
      are some programs complaining that they need a work tree?
      
      IOW it is allowed to call
      
      	$ git --git-dir=../ --work-tree=. bla
      
      when you really want to.  In this case, you are both in the git directory
      and in the working tree.  So, programs have to actually test for the right
      thing, namely if they are inside a working tree, and not if they are
      inside a git directory.
      
      Also, GIT_DIR=../.git should behave the same as if no GIT_DIR was
      specified, unless there is a repository in the current working directory.
      It does now.
      
      The logic to determine if a repository is bare, or has a work tree
      (tertium non datur), is this:
      
      --work-tree=bla overrides GIT_WORK_TREE, which overrides core.bare = true,
      which overrides core.worktree, which overrides GIT_DIR/.. when GIT_DIR
      ends in /.git, which overrides the directory in which .git/ was found.
      
      In related news, a long standing bug was fixed: when in .git/bla/x.git/,
      which is a bare repository, git formerly assumed ../.. to be the
      appropriate git dir.  This problem was reported by Shawn Pearce to have
      caused much pain, where a colleague mistakenly ran "git init" in "/" a
      long time ago, and bare repositories just would not work.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e90fdc39
    • J
      Add set_git_dir() function · d7ac12b2
      Johannes Schindelin 提交于
      With the function set_git_dir() you can reset the path that will
      be used for git_path(), git_dir() and friends.
      
      The responsibility to close files and throw away information from the
      old git_dir lies with the caller.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d7ac12b2
  8. 22 7月, 2007 1 次提交
  9. 05 7月, 2007 1 次提交
  10. 25 6月, 2007 1 次提交
    • J
      Add core.quotepath configuration variable. · 9378c161
      Junio C Hamano 提交于
      We always quote "unusual" byte values in a pathname using
      C-string style, to make it safer for parsing scripts that do not
      handle NUL separated records well (or just too lazy to bother).
      The absolute minimum bytes that need to be quoted for this
      purpose are TAB, LF (and other control characters), double quote
      and backslash.
      
      However, we have also always quoted the bytes in high 8-bit
      range; this was partly because we were lazy and partly because
      we were being cautious.
      
      This introduces an internal "quote_path_fully" variable, and
      core.quotepath configuration variable to control it.  When set
      to false, it does not quote bytes in high 8-bit range anymore
      but passes them intact.
      
      The variable defaults to "true" to retain the traditional
      behaviour for now.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9378c161
  11. 07 6月, 2007 1 次提交
    • J
      War on whitespace · a6080a0a
      Junio C Hamano 提交于
      This uses "git-apply --whitespace=strip" to fix whitespace errors that have
      crept in to our source files over time.  There are a few files that need
      to have trailing whitespaces (most notably, test vectors).  The results
      still passes the test, and build result in Documentation/ area is unchanged.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a6080a0a
  12. 11 5月, 2007 2 次提交
    • D
      Custom compression levels for objects and packs · 960ccca6
      Dana How 提交于
      Add config variables pack.compression and core.loosecompression ,
      and switch --compression=level to pack-objects.
      
      Loose objects will be compressed using core.loosecompression if set,
      else core.compression if set, else Z_BEST_SPEED.
      Packed objects will be compressed using --compression=level if seen,
      else pack.compression if set, else core.compression if set,
      else Z_DEFAULT_COMPRESSION.  This is the "pack compression level".
      
      Loose objects added to a pack undeltified will be recompressed
      to the pack compression level if it is unequal to the current
      loose compression level by the preceding rules,  or if the loose
      object was written while core.legacyheaders = true.  Newly
      deltified loose objects are always compressed to the current
      pack compression level.
      
      Previously packed objects added to a pack are recompressed
      to the current pack compression level exactly when their
      deltification status changes,  since the previous pack data
      cannot be reused.
      
      In either case,  the --no-reuse-object switch from the first
      patch below will always force recompression to the current pack
      compression level,  instead of assuming the pack compression level
      hasn't changed and pack data can be reused when possible.
      
      This applies on top of the following patches from Nicolas Pitre:
      [PATCH] allow for undeltified objects not to be reused
      [PATCH] make "repack -f" imply "pack-objects --no-reuse-object"
      Signed-off-by: NDana L. How <danahow@gmail.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      960ccca6
    • N
      deprecate the new loose object header format · 726f852b
      Nicolas Pitre 提交于
      Now that we encourage and actively preserve objects in a packed form
      more agressively than we did at the time the new loose object format and
      core.legacyheaders were introduced, that extra loose object format
      doesn't appear to be worth it anymore.
      
      Because the packing of loose objects has to go through the delta match
      loop anyway, and since most of them should end up being deltified in
      most cases, there is really little advantage to have this parallel loose
      object format as the CPU savings it might provide is rather lost in the
      noise in the end.
      
      This patch gets rid of core.legacyheaders, preserve the legacy format as
      the only writable loose object format and deprecate the other one to
      keep things simpler.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      726f852b
  13. 19 3月, 2007 1 次提交
    • S
      Limit the size of the new delta_base_cache · 18bdec11
      Shawn O. Pearce 提交于
      The new configuration variable core.deltaBaseCacheLimit allows the
      user to control how much memory they are willing to give to Git for
      caching base objects of deltas.  This is not normally meant to be
      a user tweakable knob; the "out of the box" settings are meant to
      be suitable for almost all workloads.
      
      We default to 16 MiB under the assumption that the cache is not
      meant to consume all of the user's available memory, and that the
      cache's main purpose was to cache trees, for faster path limiters
      during revision traversal.  Since trees tend to be relatively small
      objects, this relatively small limit should still allow a large
      number of objects.
      
      On the other hand we don't want the cache to start storing 200
      different versions of a 200 MiB blob, as this could easily blow
      the entire address space of a 32 bit process.
      
      We evict OBJ_BLOB from the cache first (credit goes to Junio) as
      we want to favor OBJ_TREE within the cache.  These are the objects
      that have the highest inflate() startup penalty, as they tend to
      be small and thus don't have that much of a chance to ammortize
      that penalty over the entire data.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      18bdec11
  14. 13 3月, 2007 1 次提交
  15. 08 3月, 2007 1 次提交
    • S
      General const correctness fixes · 3a55602e
      Shawn O. Pearce 提交于
      We shouldn't attempt to assign constant strings into char*, as the
      string is not writable at runtime.  Likewise we should always be
      treating unsigned values as unsigned values, not as signed values.
      
      Most of these are very straightforward.  The only exception is the
      (unnecessary) xstrdup/free in builtin-branch.c for the detached
      head case.  Since this is a user-level interactive type program
      and that particular code path is executed no more than once, I feel
      that the extra xstrdup call is well worth the easy elimination of
      this warning.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3a55602e
  16. 03 3月, 2007 1 次提交
    • J
      Add core.symlinks to mark filesystems that do not support symbolic links. · 78a8d641
      Johannes Sixt 提交于
      Some file systems that can host git repositories and their working copies
      do not support symbolic links. But then if the repository contains a symbolic
      link, it is impossible to check out the working copy.
      
      This patch enables partial support of symbolic links so that it is possible
      to check out a working copy on such a file system.  A new flag
      core.symlinks (which is true by default) can be set to false to indicate
      that the filesystem does not support symbolic links. In this case, symbolic
      links that exist in the trees are checked out as small plain files, and
      checking in modifications of these files preserve the symlink property in
      the database (as long as an entry exists in the index).
      
      Of course, this does not magically make symbolic links work on such defective
      file systems; hence, this solution does not help if the working copy relies
      on that an entry is a real symbolic link.
      Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      78a8d641
  17. 15 2月, 2007 2 次提交
    • L
      Make AutoCRLF ternary variable. · d7f46334
      Linus Torvalds 提交于
      This allows you to do:
      
      	[core]
      		AutoCRLF = input
      
      and it should do only the CRLF->LF translation (ie it simplifies CRLF only
      when reading working tree files, but when checking out files, it leaves
      the LF alone, and doesn't turn it into a CRLF).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d7f46334
    • L
      Lazy man's auto-CRLF · 6c510bee
      Linus Torvalds 提交于
      It currently does NOT know about file attributes, so it does its
      conversion purely based on content. Maybe that is more in the "git
      philosophy" anyway, since content is king, but I think we should try to do
      the file attributes to turn it off on demand.
      
      Anyway, BY DEFAULT it is off regardless, because it requires a
      
      	[core]
      		AutoCRLF = true
      
      in your config file to be enabled. We could make that the default for
      Windows, of course, the same way we do some other things (filemode etc).
      
      But you can actually enable it on UNIX, and it will cause:
      
       - "git update-index" will write blobs without CRLF
       - "git diff" will diff working tree files without CRLF
       - "git checkout" will write files to the working tree _with_ CRLF
      
      and things work fine.
      
      Funnily, it actually shows an odd file in git itself:
      
      	git clone -n git test-crlf
      	cd test-crlf
      	git config core.autocrlf true
      	git checkout
      	git diff
      
      shows a diff for "Documentation/docbook-xsl.css". Why? Because we have
      actually checked in that file *with* CRLF! So when "core.autocrlf" is
      true, we'll always generate a *different* hash for it in the index,
      because the index hash will be for the content _without_ CRLF.
      
      Is this complete? I dunno. It seems to work for me. It doesn't use the
      filename at all right now, and that's probably a deficiency (we could
      certainly make the "is_binary()" heuristics also take standard filename
      heuristics into account).
      
      I don't pass in the filename at all for the "index_fd()" case
      (git-update-index), so that would need to be passed around, but this
      actually works fine.
      
      NOTE NOTE NOTE! The "is_binary()" heuristics are totally made-up by yours
      truly. I will not guarantee that they work at all reasonable. Caveat
      emptor. But it _is_ simple, and it _is_ safe, since it's all off by
      default.
      
      The patch is pretty simple - the biggest part is the new "convert.c" file,
      but even that is really just basic stuff that anybody can write in
      "Teaching C 101" as a final project for their first class in programming.
      Not to say that it's bug-free, of course - but at least we're not talking
      about rocket surgery here.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      6c510bee
  18. 08 1月, 2007 2 次提交
    • J
      Introduce is_bare_repository() and core.bare configuration variable · 7d1864ce
      Junio C Hamano 提交于
      This removes the old is_bare_git_dir(const char *) to ask if a
      directory, if it is a GIT_DIR, is a bare repository, and
      replaces it with is_bare_repository(void *).  The function looks
      at core.bare configuration variable if exists but uses the old
      heuristics: if it is ".git" or ends with "/.git", then it does
      not look like a bare repository, otherwise it does.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      7d1864ce
    • J
      Move initialization of log_all_ref_updates · 510c5a8e
      Junio C Hamano 提交于
      The patches to prevent Porcelainish that require working tree
      from doing any damage in a bare repository make a lot of sense,
      and I want to make the is_bare_git_dir() function more reliable.
      
      In order to allow the repository owner override the heuristic
      implemented in is_bare_git_dir() if/when it misidentifies a
      particular repository, it would make sense to introduce a new
      configuration variable "[core] bare = true/false", and make
      is_bare_git_dir() notice it.
      
      The scripts would do a 'repo-config --bool --get core.bare' and
      iff the command fails (i.e. there is no such variable in the
      configuration file), it would use the heuristic implemented at
      the script level [*1*].
      
      However, setup_git_env() which is called a lot earlier than we
      even read from the repository configuration currently makes a
      call to is_bare_git_dir(), in order to change the default
      setting for log_all_ref_updates.  It somehow feels that this is
      a hack.
      
      By the way, [*1*] is another thing I hate about the current
      config mechanism.  "git-repo-config --get" does not know what
      the possible configuration variables are, let alone what the
      default values for them are.  It allows us not to maintain a
      centralized configuration table, which makes it easy to
      introduce ad-hoc variables and gives a warm fuzzy feeling of
      being modular, but my feeling is that it is turning out to be a
      rather high price to pay for scripts.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      510c5a8e
  19. 30 12月, 2006 3 次提交
    • S
      Default core.packdGitWindowSize to 1 MiB if NO_MMAP. · 8c82534d
      Shawn O. Pearce 提交于
      If the compiler has asked us to disable use of mmap() on their
      platform then we are forced to use git_mmap and its emulation via
      pread.  In this case large (e.g. 32 MiB) windows for pack access
      are simply too big as a command will wind up reading a lot more
      data than it will ever need, significantly reducing response time.
      
      To prevent a high latency when NO_MMAP has been selected we now
      use a default of 1 MiB for core.packedGitWindowSize.  Credit goes
      to Linus and Junio for recommending this more reasonable setting.
      
      [jc: upcased the name of the symbolic constant, and made another
       hardcoded constant into a symbolic constant while at it. ]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8c82534d
    • S
      Fully activate the sliding window pack access. · 60bb8b14
      Shawn O. Pearce 提交于
      This finally turns on the sliding window behavior for packfile data
      access by mapping limited size windows and chaining them under the
      packed_git->windows list.
      
      We consider a given byte offset to be within the window only if there
      would be at least 20 bytes (one hash worth of data) accessible after
      the requested offset.  This range selection relates to the contract
      that use_pack() makes with its callers, allowing them to access
      one hash or one object header without needing to call use_pack()
      for every byte of data obtained.
      
      In the worst case scenario we will map the same page of data twice
      into memory: once at the end of one window and once again at the
      start of the next window.  This duplicate page mapping will happen
      only when an object header or a delta base reference is spanned
      over the end of a window and is always limited to just one page of
      duplication, as no sane operating system will ever have a page size
      smaller than a hash.
      
      I am assuming that the possible wasted page of virtual address
      space is going to perform faster than the alternatives, which
      would be to copy the object header or ref delta into a temporary
      buffer prior to parsing, or to check the window range on every byte
      during header parsing.  We may decide to revisit this decision in
      the future since this is just a gut instinct decision and has not
      actually been proven out by experimental testing.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      60bb8b14
    • S
      Introduce new config option for mmap limit. · 77ccc5bb
      Shawn O. Pearce 提交于
      Rather than hardcoding the maximum number of bytes which can be
      mmapped from pack files we should make this value configurable,
      allowing the end user to increase or decrease this limit on a
      per-repository basis depending on the size of the repository
      and the capabilities of their operating system.
      
      In general users should not need to manually tune such a low-level
      setting within the core code, but being able to artifically limit
      the number of bytes which we can mmap at once from pack files will
      make it easier to craft test cases for the new mmap sliding window
      implementation.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      77ccc5bb
  20. 28 12月, 2006 1 次提交
    • J
      UTF-8: introduce i18n.logoutputencoding. · d2c11a38
      Junio C Hamano 提交于
      It is plausible for somebody to want to view the commit log in a
      different encoding from i18n.commitencoding -- the project's
      policy may be UTF-8 and the user may be using a commit message
      hook to run iconv to conform to that policy (and either not have
      i18n.commitencoding to default to UTF-8 or have it explicitly
      set to UTF-8).  Even then, Latin-1 may be more convenient for
      the usual pager and the terminal the user uses.
      
      The new variable i18n.logoutputencoding is used in preference to
      i18n.commitencoding to decide what encoding to recode the log
      output in when git-log and friends formats the commit log message.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d2c11a38
  21. 16 12月, 2006 1 次提交
    • S
      Enable reflogs by default in any repository with a working directory. · 0bee5918
      Shawn O. Pearce 提交于
      New and experienced Git users alike are finding out too late that
      they forgot to enable reflogs in the current repository, and cannot
      use the information stored within it to recover from an incorrectly
      entered command such as `git reset --hard HEAD^^^` when they really
      meant HEAD^^ (aka HEAD~2).
      
      So enable reflogs by default in all future versions of Git, unless
      the user specifically disables it with:
      
        [core]
          logAllRefUpdates = false
      
      in their .git/config or ~/.gitconfig.
      
      We only enable reflogs in repositories that have a working directory
      associated with them, as shared/bare repositories do not have
      an easy means to prune away old log entries, or may fail logging
      entirely if the user's gecos information is not valid during a push.
      This heuristic was suggested on the mailing list by Junio.
      
      Documentation was also updated to indicate the new default behavior.
      We probably should start to teach usuing the reflog to recover
      from mistakes in some of the tutorial material, as new users are
      likely to make a few along the way and will feel better knowing
      they can recover from them quickly and easily, without fsck-objects'
      lost+found features.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0bee5918
  22. 31 10月, 2006 1 次提交
  23. 21 9月, 2006 1 次提交
  24. 03 9月, 2006 1 次提交
  25. 02 9月, 2006 1 次提交
    • S
      Replace uses of strdup with xstrdup. · 9befac47
      Shawn Pearce 提交于
      Like xmalloc and xrealloc xstrdup dies with a useful message if
      the native strdup() implementation returns NULL rather than a
      valid pointer.
      
      I just tried to use xstrdup in new code and found it to be missing.
      However I expected it to be present as xmalloc and xrealloc are
      already commonly used throughout the code.
      
      [jc: removed the part that deals with last_XXX, which I am
       finding more and more dubious these days.]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9befac47
  26. 24 8月, 2006 1 次提交
  27. 16 8月, 2006 1 次提交
  28. 01 8月, 2006 1 次提交
  29. 14 7月, 2006 1 次提交
    • L
      sha1_file: add the ability to parse objects in "pack file format" · 93821bd9
      Linus Torvalds 提交于
      The pack-file format is slightly different from the traditional git
      object format, in that it has a much denser binary header encoding.
      The traditional format uses an ASCII string with type and length
      information, which is somewhat wasteful.
      
      A new object format starts with uncompressed binary header
      followed by compressed payload -- this will allow us later to
      copy the payload straight to packfiles.
      
      Obviously they cannot be read by older versions of git, so for
      now new object files are created with the traditional format.
      core.legacyheaders configuration item, when set to false makes
      the code write in new format for people to experiment with.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      93821bd9
  30. 11 7月, 2006 1 次提交
  31. 09 7月, 2006 1 次提交
    • P
      Make it possible to set up libgit directly (instead of from the environment) · 0270083d
      Petr Baudis 提交于
      This introduces a setup_git() function which is essentialy a (public)
      backend for setup_git_env() which lets anyone specify custom sources
      for the various paths instead of environment variables. Since the repositories
      may get switched on the fly, this also updates code that caches paths to
      invalidate them properly; I hope neither of those is a sweet spot.
      
      It is used by Git.xs' xs__call_gate() to set up per-repository data
      for libgit's consumption. No code actually takes advantage of it yet
      but get_object() will in the next patches.
      Signed-off-by: NPetr Baudis <pasky@suse.cz>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0270083d
  32. 04 7月, 2006 1 次提交
    • J
      Make zlib compression level configurable, and change default. · 12f6c308
      Joachim B Haga 提交于
      With the change in default, "git add ." on kernel dir is about
      twice as fast as before, with only minimal (0.5%) change in
      object size. The speed difference is even more noticeable
      when committing large files, which is now up to 8 times faster.
      
      The configurability is through setting core.compression = [-1..9]
      which maps to the zlib constants; -1 is the default, 0 is no
      compression, and 1..9 are various speed/size tradeoffs, 9
      being slowest.
      
      Signed-off-by: Joachim B Haga (cjhaga@fys.uio.no)
      Acked-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      12f6c308
  33. 10 6月, 2006 1 次提交
    • J
      shared repository: optionally allow reading to "others". · 94df2506
      Junio C Hamano 提交于
      This enhances core.sharedrepository to have additionally
      specify that read and exec permissions to be given to others as
      well.  It is useful when serving a repository via gitweb and
      git-daemon that runs as a user outside the project group.
      
      The configuration item can take the following values:
      
          [core]
      	sharedrepository 	 ; the same as "group"
      	sharedrepository = true  ; ditto
      	sharedrepository = 1	 ; ditto
      	sharedrepository = group ; allow rwx to group
      	sharedrepository = all   ; allow rwx to group, allow rx to other
      	sharedrepository = umask ; not shared - use umask
      
      It also extends "git init-db" to take "--shared=all" and friends
      from the command line.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      94df2506
  34. 18 5月, 2006 1 次提交
    • S
      Log ref updates to logs/refs/<ref> · 6de08ae6
      Shawn Pearce 提交于
      If config parameter core.logAllRefUpdates is true or the log
      file already exists then append a line to ".git/logs/refs/<ref>"
      whenever git-update-ref <ref> is executed.  Each log line contains
      the following information:
      
        oldsha1 <SP> newsha1 <SP> committer <LF>
      
      where committer is the current user, date, time and timezone in
      the standard GIT ident format.  If the caller is unable to append
      to the log file then git-update-ref will fail without updating <ref>.
      
      An optional message may be included in the log line with the -m flag.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      6de08ae6