1. 31 7月, 2007 1 次提交
  2. 05 7月, 2007 1 次提交
  3. 02 7月, 2007 1 次提交
  4. 01 7月, 2007 1 次提交
    • L
      git: Try a bit harder not to lose errno in stdio · 0227f988
      Linus Torvalds 提交于
      This switches the checks around upon the exit codepath of the
      git wrapper, so that we may recover at least non-transient errors.
      
      It's still not perfect. As I've been harping on, stdio simply isn't very
      good for error reporting. For example, if an IO error happened, you'd want
      to see EIO, wouldn't you? And yes, that's what the kernel would return.
      However, with buffered stdio (and flushing outside of our control), what
      would likely happen is that some intermediate error return _does_ return
      EIO, but then the kernel might decide to re-mount the filesystem read-only
      due to the error, and the actual *report* for us might be
      
      	"write failure on standard output: read-only filesystem"
      
      which lost the EIO.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0227f988
  5. 25 6月, 2007 2 次提交
  6. 13 6月, 2007 1 次提交
    • M
      make git barf when an alias changes environment variables · 4394efec
      Matthias Lederhofer 提交于
      Aliases changing environment variables (GIT_DIR or
      GIT_WORK_TREE) can cause problems:
      git has to use GIT_DIR to read the aliases from the config.
      After running handle_options for the alias the options of the
      alias may have changed environment variables.  Depending on
      the implementation of setenv the memory location obtained
      through getenv earlier may contain the old value or the new
      value (or even be used for something else?).  To avoid these
      problems git errors out if an alias uses any option which
      changes environment variables.
      Signed-off-by: NMatthias Lederhofer <matled@gmx.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4394efec
  7. 07 6月, 2007 2 次提交
    • M
      Use new semantics of is_bare/inside_git_dir/inside_work_tree · 7ae3df8c
      Matthias Lederhofer 提交于
      Up to now to check for a working tree this was used:
      	!is_bare && !inside_git_dir
      (the check for bare is redundant because is_inside_git_dir
      returned already 1 for bare repositories).
      Now the check is:
      	inside_work_tree && !inside_git_dir
      Signed-off-by: NMatthias Lederhofer <matled@gmx.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7ae3df8c
    • M
      introduce GIT_WORK_TREE to specify the work tree · 892c41b9
      Matthias Lederhofer 提交于
      setup_gdg is used as abbreviation for setup_git_directory_gently.
      
      The work tree can be specified using the environment variable
      GIT_WORK_TREE and the config option core.worktree (the environment
      variable has precendence over the config option).  Additionally
      there is a command line option --work-tree which sets the
      environment variable.
      
      setup_gdg does the following now:
      
      GIT_DIR unspecified
      repository in .git directory
          parent directory of the .git directory is used as work tree,
          GIT_WORK_TREE is ignored
      
      GIT_DIR unspecified
      repository in cwd
          GIT_DIR is set to cwd
          see the cases with GIT_DIR specified what happens next and
          also see the note below
      
      GIT_DIR specified
      GIT_WORK_TREE/core.worktree unspecified
          cwd is used as work tree
      
      GIT_DIR specified
      GIT_WORK_TREE/core.worktree specified
          the specified work tree is used
      
      Note on the case where GIT_DIR is unspecified and repository is in cwd:
          GIT_WORK_TREE is used but is_inside_git_dir is always true.
          I did it this way because setup_gdg might be called multiple
          times (e.g. when doing alias expansion) and in successive calls
          setup_gdg should do the same thing every time.
      
      Meaning of is_bare/is_inside_work_tree/is_inside_git_dir:
      
      (1) is_bare_repository
          A repository is bare if core.bare is true or core.bare is
          unspecified and the name suggests it is bare (directory not
          named .git).  The bare option disables a few protective
          checks which are useful with a working tree.  Currently
          this changes if a repository is bare:
              updates of HEAD are allowed
              git gc packs the refs
              the reflog is disabled by default
      
      (2) is_inside_work_tree
          True if the cwd is inside the associated working tree (if there
          is one), false otherwise.
      
      (3) is_inside_git_dir
          True if the cwd is inside the git directory, false otherwise.
          Before this patch is_inside_git_dir was always true for bare
          repositories.
      
      When setup_gdg finds a repository git_config(git_default_config) is
      always called.  This ensure that is_bare_repository makes use of
      core.bare and does not guess even though core.bare is specified.
      
      inside_work_tree and inside_git_dir are set if setup_gdg finds a
      repository.  The is_inside_work_tree and is_inside_git_dir functions
      will die if they are called before a successful call to setup_gdg.
      Signed-off-by: NMatthias Lederhofer <matled@gmx.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      892c41b9
  8. 21 5月, 2007 1 次提交
  9. 14 4月, 2007 1 次提交
    • J
      Add basic infrastructure to assign attributes to paths · d0bfd026
      Junio C Hamano 提交于
      This adds the basic infrastructure to assign attributes to
      paths, in a way similar to what the exclusion mechanism does
      based on $GIT_DIR/info/exclude and .gitignore files.
      
      An attribute is just a simple string that does not contain any
      whitespace.  They can be specified in $GIT_DIR/info/attributes
      file, and .gitattributes file in each directory.
      
      Each line in these files defines a pattern matching rule.
      Similar to the exclusion mechanism, a later match overrides an
      earlier match in the same file, and entries from .gitattributes
      file in the same directory takes precedence over the ones from
      parent directories.  Lines in $GIT_DIR/info/attributes file are
      used as the lowest precedence default rules.
      
      A line is either a comment (an empty line, or a line that begins
      with a '#'), or a rule, which is a whitespace separated list of
      tokens.  The first token on the line is a shell glob pattern.
      The rest are names of attributes, each of which can optionally
      be prefixed with '!'.  Such a line means "if a path matches this
      glob, this attribute is set (or unset -- if the attribute name
      is prefixed with '!').  For glob matching, the same "if the
      pattern does not have a slash in it, the basename of the path is
      matched with fnmatch(3) against the pattern, otherwise, the path
      is matched with the pattern with FNM_PATHNAME" rule as the
      exclusion mechanism is used.
      
      This does not define what an attribute means.  Tying an
      attribute to various effects it has on git operation for paths
      that have it will be specified separately.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d0bfd026
  10. 13 4月, 2007 1 次提交
  11. 06 4月, 2007 1 次提交
  12. 26 3月, 2007 1 次提交
  13. 17 3月, 2007 1 次提交
  14. 04 3月, 2007 2 次提交
  15. 23 2月, 2007 2 次提交
    • J
      Add git-bundle: move objects and references by archive · 2e0afafe
      Johannes Schindelin 提交于
      Some workflows require use of repositories on machines that cannot be
      connected, preventing use of git-fetch / git-push to transport objects and
      references between the repositories.
      
      git-bundle provides an alternate transport mechanism, effectively allowing
      git-fetch and git-pull to operate using sneakernet transport. `git-bundle
      create` allows the user to create a bundle containing one or more branches
      or tags, but with specified basis assumed to exist on the target
      repository. At the receiving end, git-bundle acts like git-fetch-pack,
      allowing the user to invoke git-fetch or git-pull using the bundle file as
      the URL. git-fetch and git-ls-remote determine they have a bundle URL by
      checking that the URL points to a file, but are otherwise unchanged in
      operation with bundles.
      
      The original patch was done by Mark Levedahl <mdl123@verizon.net>.
      
      It was updated to make git-bundle a builtin, and get rid of the tar
      format: now, the first line is supposed to say "# v2 git bundle", the next
      lines either contain a prerequisite ("-" followed by the hash of the
      needed commit), or a ref (the hash of a commit, followed by the name of
      the ref), and finally the pack. As a result, the bundle argument can be
      "-" now.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2e0afafe
    • J
      Teach git-diff-files the new option `--no-index` · d516c2d1
      Johannes Schindelin 提交于
      With this flag and given two paths, git-diff-files behaves as a GNU diff
      lookalike (plus the git goodies like --check, colour, etc.).  This flag
      is also available in git-diff.  It also works outside of a git repository.
      
      In addition, if git-diff{,-files} is called without revision or stage
      parameter, and with exactly two paths at least one of which is not tracked,
      the default is --no-index.
      
      So, you can now say
      
      	git diff /etc/inittab /etc/fstab
      
      and it actually works!
      
      This also unifies the duplicated argument parsing between cmd_diff_files()
      and builtin_diff_files().
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d516c2d1
  16. 21 2月, 2007 2 次提交
    • J
      git grep: use pager · 34c6a82b
      Johannes Schindelin 提交于
      Signed-off-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      34c6a82b
    • J
      Mechanical conversion to use prefixcmp() · cc44c765
      Junio C Hamano 提交于
      This mechanically converts strncmp() to use prefixcmp(), but only when
      the parameters match specific patterns, so that they can be verified
      easily.  Leftover from this will be fixed in a separate step, including
      idiotic conversions like
      
          if (!strncmp("foo", arg, 3))
      
        =>
      
          if (!(-prefixcmp(arg, "foo")))
      
      This was done by using this script in px.perl
      
         #!/usr/bin/perl -i.bak -p
         if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
                 s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
         }
         if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
                 s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
         }
      
      and running:
      
         $ git grep -l strncmp -- '*.c' | xargs perl px.perl
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cc44c765
  17. 14 2月, 2007 1 次提交
  18. 13 2月, 2007 1 次提交
  19. 11 2月, 2007 2 次提交
  20. 06 2月, 2007 1 次提交
  21. 30 1月, 2007 1 次提交
  22. 29 1月, 2007 2 次提交
  23. 25 1月, 2007 1 次提交
  24. 11 1月, 2007 2 次提交
  25. 10 1月, 2007 1 次提交
  26. 08 1月, 2007 1 次提交
  27. 31 12月, 2006 2 次提交
  28. 23 12月, 2006 1 次提交
  29. 22 12月, 2006 1 次提交
  30. 21 12月, 2006 2 次提交
    • J
      git reflog expire · 4264dc15
      Junio C Hamano 提交于
      This prepares a place to collect reflog management subcommands,
      and implements "expire" action.
      
      	$ git reflog expire --dry-run \
      		--expire=4.weeks \
      		--expire-unreachable=1.week \
      		refs/heads/master
      
      The expiration uses two timestamps: --expire and --expire-unreachable.
      Entries older than expire time (defaults to 90 days), and entries older
      than expire-unreachable time (defaults to 30 days) and records a commit
      that has been rewound and made unreachable from the current tip of the
      ref are removed from the reflog.
      
      The parameter handling is still rough, but I think the
      core logic for expiration is already sound.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      4264dc15
    • J
      simplify inclusion of system header files. · 85023577
      Junio C Hamano 提交于
      This is a mechanical clean-up of the way *.c files include
      system header files.
      
       (1) sources under compat/, platform sha-1 implementations, and
           xdelta code are exempt from the following rules;
      
       (2) the first #include must be "git-compat-util.h" or one of
           our own header file that includes it first (e.g. config.h,
           builtin.h, pkt-line.h);
      
       (3) system headers that are included in "git-compat-util.h"
           need not be included in individual C source files.
      
       (4) "git-compat-util.h" does not have to include subsystem
           specific header files (e.g. expat.h).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      85023577