1. 27 5月, 2007 3 次提交
    • S
      Lazily open pack index files on demand · d079837e
      Shawn O. Pearce 提交于
      In some repository configurations the user may have many packfiles,
      but all of the recent commits/trees/tags/blobs are likely to
      be in the most recent packfile (the one with the newest mtime).
      It is therefore common to be able to complete an entire operation
      by accessing only one packfile, even if there are 25 packfiles
      available to the repository.
      
      Rather than opening and mmaping the corresponding .idx file for
      every pack found, we now only open and map the .idx when we suspect
      there might be an object of interest in there.
      
      Of course we cannot known in advance which packfile contains an
      object, so we still need to scan the entire packed_git list to
      locate anything.  But odds are users want to access objects in the
      most recently created packfiles first, and that may be all they
      ever need for the current operation.
      
      Junio observed in b867092f that placing recent packfiles before
      older ones can slightly improve access times for recent objects,
      without degrading it for historical object access.
      
      This change improves upon Junio's observations by trying even harder
      to avoid the .idx files that we won't need.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d079837e
    • L
      Make the pack-refs interfaces usable from outside · 99b5a79e
      Linus Torvalds 提交于
      This just basically creates a "pack_refs()" function that could be used by
      anybody. You pass it in the flags you want as a bitmask (PACK_REFS_ALL and
      PACK_REFS_PRUNE), and it will do all the heavy lifting.
      
      Of course, it's still static, and it's all in the builtin-pack-refs.c
      file, so it's not actually visible to the outside, but the next step would
      be to just move it all to a library file (probably refs.c) and expose it.
      
      Then we could easily make "git gc" do this too.
      
      While I did it, I also made it check the return value of the fflush and
      fsync stage, to make sure that we don't overwrite the old packed-refs file
      with something that got truncated due to write errors!
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      99b5a79e
    • J
      Merge branch 'maint' · c56ed464
      Junio C Hamano 提交于
      * maint:
        Fix git-svn to handle svn not reporting the md5sum of a file, and test.
        Fix mishandling of $Id$ expanded in the repository copy in convert.c
        More echo "$user_message" fixes.
        Add tests for the last two fixes.
        git-commit: use printf '%s\n' instead of echo on user-supplied strings
        git-am: use printf instead of echo on user-supplied strings
        Documentation: Add definition of "evil merge" to GIT Glossary
        Replace the last 'dircache's by 'index'
        Documentation: Clean up links in GIT Glossary
      c56ed464
  2. 26 5月, 2007 11 次提交
  3. 25 5月, 2007 7 次提交
    • J
      Merge branch 'maint' · 18bece43
      Junio C Hamano 提交于
      * maint:
        fix memory leak in parse_object when check_sha1_signature fails
        name-rev: tolerate clock skew in committer dates
        Update bash completion for git-config options
        Teach bash completion about recent log long options
        Teach bash completion about 'git remote update'
        Update bash completion header documentation
        Remove a duplicate --not option in bash completion
        Teach bash completion about git-shortlog
        Hide the plumbing diff-{files,index,tree} from bash completion
        Update bash completion to ignore some more plumbing commands
      18bece43
    • J
      Merge branch 'master' of git://repo.or.cz/git/fastimport into maint · 6d9d26d8
      Junio C Hamano 提交于
      * 'master' of git://repo.or.cz/git/fastimport:
        Update bash completion for git-config options
        Teach bash completion about recent log long options
        Teach bash completion about 'git remote update'
        Update bash completion header documentation
        Remove a duplicate --not option in bash completion
        Teach bash completion about git-shortlog
        Hide the plumbing diff-{files,index,tree} from bash completion
        Update bash completion to ignore some more plumbing commands
      6d9d26d8
    • L
      Make "git gc" pack all refs by default · 56752391
      Linus Torvalds 提交于
      I've taught myself to use "git gc" instead of doing the repack explicitly,
      but it doesn't actually do what I think it should do.
      
      We've had packed refs for a long time now, and I think it just makes sense
      to pack normal branches too. So I end up having to do
      
      	git pack-refs --all --prune
      
      in order to get a nice git repo that doesn't have any unnecessary files.
      
      So why not just do that in "git gc"? It's not as if there really is any
      downside to packing branches, even if they end up changing later. Quite
      often they don't, and even if they do, so what?
      
      Also, make the default for refs packing just be an unambiguous "do it",
      rather than "do it by default only for non-bare repositories". If you want
      that behaviour, you can always just add a
      
      	[gc]
      		packrefs = notbare
      
      in your ~/.gitconfig file, but I don't actually see why bare would be any
      different (except for the broken reason that http-fetching used to be
      totally broken, and not doing it just meant that it didn't even get
      fixed in a timely manner!).
      
      So here's a trivial patch to make "git gc" do a better job. Hmm?
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      56752391
    • F
      Teach mailsplit about Maildir's · d63bd9a2
      Fernando J. Pereda 提交于
      Signed-off-by: NFernando J. Pereda <ferdy@gentoo.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d63bd9a2
    • J
      Merge branch 'maint-1.5.1' into maint · 76026200
      Junio C Hamano 提交于
      * maint-1.5.1:
        fix memory leak in parse_object when check_sha1_signature fails
        name-rev: tolerate clock skew in committer dates
      76026200
    • C
      fix memory leak in parse_object when check_sha1_signature fails · 0b1f1130
      Carlos Rica 提交于
      When check_sha1_signature fails, program is not terminated:
      it prints an error message and returns NULL, so the
      buffer returned by read_sha1_file should be freed before.
      Signed-off-by: NCarlos Rica <jasampler@gmail.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0b1f1130
    • J
      name-rev: tolerate clock skew in committer dates · c075aea5
      Junio C Hamano 提交于
      In git.git repository, "git-name-rev v1.3.0~158" cannot name the
      rev, while adjacent revs can be named.
      
      This was because it gives up traversal from the tips of existing
      refs as soon as it sees a commit that has older commit timestamp
      than what is being named.  This is usually a good heuristics,
      but v1.3.0~158 has a slightly older commit timestamp than
      v1.3.0~157 (i.e. it's child), as these two were made in a
      separate repostiory (in fact, in a different continent).
      
      This adds a hardcoded slop value (1 day) to the cut-off
      heuristics to work this kind of problem around.  The current
      algorithm essentially runs around from the available tips down
      to ancient commits and names every single rev available that are
      newer than cut-off date, so a single day slop would not add that
      much overhead in repositories with long enough history where the
      performance of name-rev matters.
      
      I think the algorithm could be made a bit smarter by deepening
      the graph on demand as a new commit is asked to be named (this
      would require rewriting of name_rev() function not to recurse
      itself but use a traversal list like revision.c traverser does),
      but that would be a separate issue.
      Acked-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c075aea5
  4. 24 5月, 2007 19 次提交