1. 18 12月, 2005 1 次提交
    • J
      fetch-pack: -k option to keep downloaded pack. · ad897215
      Junio C Hamano 提交于
      Split out the functions that deal with the socketpair after
      finishing git protocol handshake to receive the packed data into
      a separate file, and use it in fetch-pack to keep/explode the
      received pack data.  We earlier had something like that on
      clone-pack side once, but the list discussion resulted in the
      decision that it makes sense to always keep the pack for
      clone-pack, so unpacking option is not enabled on the clone-pack
      side, but we later still could do so easily if we wanted to with
      this change.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ad897215
  2. 11 12月, 2005 1 次提交
  3. 06 12月, 2005 1 次提交
    • J
      Clean up compatibility definitions. · 4050c0df
      Junio C Hamano 提交于
      This attempts to clean up the way various compatibility
      functions are defined and used.
      
       - A new header file, git-compat-util.h, is introduced.  This
         looks at various NO_XXX and does necessary function name
         replacements, equivalent of -Dstrcasestr=gitstrcasestr in the
         Makefile.
      
       - Those function name replacements are removed from the Makefile.
      
       - Common features such as usage(), die(), xmalloc() are moved
         from cache.h to git-compat-util.h; cache.h includes
         git-compat-util.h itself.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      4050c0df
  4. 29 11月, 2005 1 次提交
    • J
      working from subdirectory: preparation · 4ca06608
      Junio C Hamano 提交于
       - prefix_filename() is like prefix_path() but can be used to
         name any file on the filesystem, not the files that might go
         into the index file.
      
       - setup_git_directory_gently() tries to find the GIT_DIR, but does
         not die() if called outside a git repository.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      4ca06608
  5. 28 11月, 2005 1 次提交
  6. 27 11月, 2005 2 次提交
    • 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
    • J
      Repository format version check. · ab9cb76f
      Junio C Hamano 提交于
      This adds the repository format version code, first done by
      Martin Atukunda.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ab9cb76f
  7. 22 11月, 2005 1 次提交
  8. 21 11月, 2005 1 次提交
  9. 20 11月, 2005 3 次提交
  10. 17 11月, 2005 2 次提交
    • L
      git's rev-parse.c function show_datestring presumes gnu date · 3c07b1d1
      Linus Torvalds 提交于
      Ok. This is the insane patch to do this.
      
      It really isn't very careful, and the reason I call it "approxidate()"
      will become obvious when you look at the code. It is very liberal in what
      it accepts, to the point where sometimes the results may not make a whole
      lot of sense.
      
      It accepts "last week" as a date string, by virtue of "last" parsing as
      the number 1, and it totally ignoring superfluous fluff like "ago", so
      "last week" ends up being exactly the same thing as "1 week ago". Fine so
      far.
      
      It has strange side effects: "last december" will actually parse as "Dec
      1", which actually _does_ turn out right, because it will then notice that
      it's not December yet, so it will decide that you must be talking about a
      date last year. So it actually gets it right, but it's kind of for the
      "wrong" reasons.
      
      It also accepts the numbers 1..10 in string format ("one" .. "ten"), so
      you can do "ten weeks ago" or "ten hours ago" and it will do the right
      thing.
      
      But it will do some really strange thigns too: the string "this will last
      forever", will not recognize anyting but "last", which is recognized as
      "1", which since it doesn't understand anything else it will think is the
      day of the month. So if you do
      
      	gitk --since="this will last forever"
      
      the date will actually parse as the first day of the current month.
      
      And it will parse the string "now" as "now", but only because it doesn't
      understand it at all, and it makes everything relative to "now".
      
      Similarly, it doesn't actually parse the "ago" or "from now", so "2 weeks
      ago" is exactly the same as "2 weeks from now". It's the current date
      minus 14 days.
      
      But hey, it's probably better (and certainly faster) than depending on GNU
      date. So now you can portably do things like
      
      	gitk --since="two weeks and three days ago"
      	git log --since="July 5"
      	git-whatchanged --since="10 hours ago"
      	git log --since="last october"
      
      and it will actually do exactly what you thought it would do (I think). It
      will count 17 days backwards, and it will do so even if you don't have GNU
      date installed.
      
      (I don't do "last monday" or similar yet, but I can extend it to that too
      if people want).
      
      It was kind of fun trying to write code that uses such totally relaxed
      "understanding" of dates yet tries to get it right for the trivial cases.
      The result should be mixed with a few strange preprocessor tricks, and be
      submitted for the IOCCC ;)
      
      Feel free to try it out, and see how many strange dates it gets right. Or
      wrong.
      
      And if you find some interesting (and valid - not "interesting" as in
      "strange", but "interesting" as in "I'd be interested in actually doing
      this) thing it gets wrong - usually by not understanding it and silently
      just doing some strange things - please holler.
      
      Now, as usual this certainly hasn't been getting a lot of testing. But my
      code always works, no?
      
      		Linus
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3c07b1d1
    • J
      GIT 0.99.9j aka 1.0rc3 · 27dedf0c
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      27dedf0c
  11. 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
  12. 29 10月, 2005 1 次提交
    • J
      Support receiving server capabilities · 211b5f9e
      Johannes Schindelin 提交于
      This patch implements the client side of backward compatible upload-pack
      protocol extension, <20051027141619.0e8029f2.vsu@altlinux.ru> by Sergey.
      
      The updated server can append "server_capabilities" which is supposed
      to be a string containing space separated features of the server, after
      one of elements in the initial list of SHA1-refname line, hidden with
      an embedded NUL.
      
      After get_remote_heads(), check if the server supports the feature like
      
      	if (server_supports("multi_ack"))
      		do_something();
      Signed-off-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      211b5f9e
  13. 27 10月, 2005 1 次提交
    • J
      pack-objects: Allow use of pre-generated pack. · f3123c4a
      Junio C Hamano 提交于
      git-pack-objects can reuse pack files stored in $GIT_DIR/pack-cache
      directory, when a necessary pack is found.  This is hopefully useful
      when upload-pack (called from git-daemon) is expected to receive
      requests for the same set of objects many times (e.g full cloning
      request of any project, or updates from the set of heads previous day
      to the latest for a slow moving project).
      
      Currently git-pack-objects does *not* keep pack files it creates for
      reusing.  It might be useful to add --update-cache option to it,
      which would allow it store pack files it created in the pack-cache
      directory, and prune rarely used ones from it.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f3123c4a
  14. 16 10月, 2005 2 次提交
  15. 15 10月, 2005 1 次提交
  16. 14 10月, 2005 1 次提交
  17. 12 10月, 2005 2 次提交
    • 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
    • J
      show-branch: optionally use unique prefix as name. · 013f276e
      Junio C Hamano 提交于
      git-show-branch acquires two new options. --sha1-name to name
      commits using the unique prefix of their object names, and
      --no-name to not to show names at all.
      
      This was outlined in <7vk6gpyuyr.fsf@assigned-by-dhcp.cox.net>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      013f276e
  18. 11 10月, 2005 2 次提交
    • J
      Use the same move_temp_to_file in git-http-fetch. · b721e01f
      Junio C Hamano 提交于
      The http commit walker cannot use the same temporary file
      creation code because it needs to use predictable temporary
      filename for partial fetch continuation purposes, but the code
      to move the temporary file to the final location should be
      usable from the ordinary object creation codepath.
      
      Export move_temp_to_file from sha1_file.c and use it, while
      losing the custom relink_or_rename function from http-fetch.c.
      
      Also the temporary object file creation part needs to make sure
      the leading path exists, in preparation of the really lazy
      fan-out directory creation.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b721e01f
    • 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
  19. 09 10月, 2005 1 次提交
  20. 07 10月, 2005 1 次提交
    • J
      Show original and resulting blob object info in diff output. · ec1fcc16
      Junio C Hamano 提交于
      This adds more cruft to diff --git header to record the blob SHA1 and
      the mode the patch/diff is intended to be applied against, to help the
      receiving end fall back on a three-way merge.  The new header looks
      like this:
      
          diff --git a/apply.c b/apply.c
          index 7be5041..8366082 100644
          --- a/apply.c
          +++ b/apply.c
          @@ -14,6 +14,7 @@
           //    files that are being modified, but doesn't apply the patch
           //  --stat does just a diffstat, and doesn't actually apply
          +//  --show-index-info shows the old and new index info for...
          ...
      
      Upon receiving such a patch, if the patch did not apply cleanly to the
      target tree, the recipient can try to find the matching old objects in
      her object database and create a temporary tree, apply the patch to
      that temporary tree, and attempt a 3-way merge between the patched
      temporary tree and the target tree using the original temporary tree
      as the common ancestor.
      
      The patch lifts the code to compute the hash for an on-filesystem
      object from update-index.c and makes it available to the diff output
      routine.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ec1fcc16
  21. 02 10月, 2005 3 次提交
    • J
      Add git-symbolic-ref · 8098a178
      Junio C Hamano 提交于
      This adds the counterpart of git-update-ref that lets you read
      and create "symbolic refs".  By default it uses a symbolic link
      to represent ".git/HEAD -> refs/heads/master", but it can be compiled
      to use the textfile symbolic ref.
      
      The places that did 'readlink .git/HEAD' and 'ln -s refs/heads/blah
      .git/HEAD' have been converted to use new git-symbolic-ref command, so
      that they can deal with either implementation.
      Signed-off-by: NJunio C Hamano <junio@twinsun.com>
      8098a178
    • J
      Use resolve_ref() to implement read_ref(). · a876ed83
      Junio C Hamano 提交于
      Symbolic refs are understood by resolve_ref(), so existing read_ref()
      users will automatically understand them as well.
      Signed-off-by: NJunio C Hamano <junio@twinsun.com>
      a876ed83
    • L
      [PATCH] Allow reading "symbolic refs" that point to other refs · ca8db142
      Linus Torvalds 提交于
      This extends the ref reading to understand a "symbolic ref": a ref file
      that starts with "ref: " and points to another ref file, and thus
      introduces the notion of ref aliases.
      
      This is in preparation of allowing HEAD to eventually not be a symlink,
      but one of these symbolic refs instead.
      
      [jc: Linus originally required the prefix to be "ref: " five bytes
       and nothing else, but I changed it to allow and strip any number of
       leading whitespaces to match what update-ref.c does.]
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ca8db142
  22. 01 10月, 2005 1 次提交
  23. 27 9月, 2005 1 次提交
  24. 25 9月, 2005 1 次提交
  25. 21 9月, 2005 2 次提交
    • L
      [PATCH] Return proper error valud from "parse_date()" · 2a39064c
      Linus Torvalds 提交于
      Right now we don't return any error value at all from parse_date(), and if
      we can't parse it, we just silently leave the result buffer unchanged.
      
      That's fine for the current user, which will always default to the current
      date, but it's a crappy interface, and we might well be better off with an
      error message rather than just the default date.
      
      So let's change the thing to return a negative value if an error occurs,
      and the length of the result otherwise (snprintf behaviour: if the buffer
      is too small, it returns how big it _would_ have been).
      
      [ I started looking at this in case we could support date-based revision
        names. Looks ugly. Would have to parse relative dates.. ]
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2a39064c
    • J
      Show modified files in git-ls-files · b0391890
      Junio C Hamano 提交于
      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: NJunio C Hamano <junkio@cox.net>
      b0391890
  26. 13 9月, 2005 1 次提交
  27. 10 9月, 2005 1 次提交
  28. 05 9月, 2005 1 次提交
  29. 30 8月, 2005 1 次提交
    • J
      Revert "Replace zero-length array decls with []." · 2c04662d
      Junio C Hamano 提交于
      This reverts 6c5f9baa commit, whose
      change breaks gcc-2.95.
      
      Not that I ignore portability to compilers that are properly C99, but
      keeping compilation with GCC working is more important, at least for
      now.  We would probably end up declaring with "name[1]" and teach the
      allocator to subtract one if we really aimed for portability, but that
      is left for later rounds.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2c04662d