1. 16 11月, 2007 1 次提交
  2. 30 9月, 2007 1 次提交
  3. 19 9月, 2007 1 次提交
  4. 06 9月, 2007 1 次提交
  5. 11 8月, 2007 1 次提交
  6. 30 7月, 2007 1 次提交
  7. 14 7月, 2007 1 次提交
  8. 27 6月, 2007 1 次提交
  9. 13 6月, 2007 1 次提交
  10. 26 5月, 2007 1 次提交
  11. 11 5月, 2007 1 次提交
  12. 19 4月, 2007 1 次提交
  13. 18 4月, 2007 1 次提交
  14. 11 4月, 2007 1 次提交
  15. 07 4月, 2007 2 次提交
  16. 22 3月, 2007 1 次提交
  17. 10 3月, 2007 1 次提交
  18. 08 3月, 2007 1 次提交
    • S
      Cast 64 bit off_t to 32 bit size_t · dc49cd76
      Shawn O. Pearce 提交于
      Some systems have sizeof(off_t) == 8 while sizeof(size_t) == 4.
      This implies that we are able to access and work on files whose
      maximum length is around 2^63-1 bytes, but we can only malloc or
      mmap somewhat less than 2^32-1 bytes of memory.
      
      On such a system an implicit conversion of off_t to size_t can cause
      the size_t to wrap, resulting in unexpected and exciting behavior.
      Right now we are working around all gcc warnings generated by the
      -Wshorten-64-to-32 option by passing the off_t through xsize_t().
      
      In the future we should make xsize_t on such problematic platforms
      detect the wrapping and die if such a file is accessed.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      dc49cd76
  19. 04 3月, 2007 1 次提交
  20. 21 2月, 2007 1 次提交
    • 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
  21. 13 2月, 2007 1 次提交
  22. 09 2月, 2007 1 次提交
  23. 08 2月, 2007 2 次提交
  24. 04 2月, 2007 1 次提交
  25. 29 1月, 2007 1 次提交
    • J
      lock_any_ref_for_update(): do not accept malformatted refs. · a2f9fe92
      Junio C Hamano 提交于
      We used to use lock_any_ref_for_update() because the command
      needs to also update HEAD (which is not under refs/, so
      lock_ref_sha1() cannot be used).  The function however did not
      check for refs with illegal characters in them.
      
      Use check_ref_format() to catch malformed refs.  For this check,
      we specifically do not want to say having less than two levels
      in the name is illegal to allow HEAD (and perhaps other special
      refs in the future).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a2f9fe92
  26. 28 1月, 2007 6 次提交
  27. 27 1月, 2007 1 次提交
  28. 26 1月, 2007 2 次提交
    • J
      Make sure we do not write bogus reflog entries. · 8ac65937
      Junio C Hamano 提交于
      The file format dictates that entries are LF terminated so
      the message cannot have one in it.  Chomp the message to make
      sure it only has a single line if necessary, while removing the
      leading whitespace.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8ac65937
    • J
      Allow non-developer to clone, checkout and fetch more easily. · cb280e10
      Junio C Hamano 提交于
      The code that uses committer_info() in reflog can barf and die
      whenever it is asked to update a ref.  And I do not think
      calling ignore_missing_committer_name() upfront like recent
      receive-pack did in the aplication is a reasonable workaround.
      
      What the patch does.
      
       - git_committer_info() takes one parameter.  It used to be "if
         this is true, then die() if the name is not available due to
         bad GECOS, otherwise issue a warning once but leave the name
         empty".  The reason was because we wanted to prevent bad
         commits from being made by git-commit-tree (and its
         callers).  The value 0 is only used by "git var -l".
      
         Now it takes -1, 0 or 1.  When set to -1, it does not
         complain but uses the pw->pw_name when name is not
         available.  Existing 0 and 1 values mean the same thing as
         they used to mean before.  0 means issue warnings and leave
         it empty, 1 means barf and die.
      
       - ignore_missing_committer_name() and its existing caller
         (receive-pack, to set the reflog) have been removed.
      
       - git-format-patch, to come up with the phoney message ID when
         asked to thread, now passes -1 to git_committer_info().  This
         codepath uses only the e-mail part, ignoring the name.  It
         used to barf and die.  The other call in the same program
         when asked to add signed-off-by line based on committer
         identity still passes 1 to make sure it barfs instead of
         adding a bogus s-o-b line.
      
       - log_ref_write in refs.c, to come up with the name to record
         who initiated the ref update in the reflog, passes -1.  It
         used to barf and die.
      
      The last change means that git-update-ref, git-branch, and
      commit walker backends can now be used in a repository with
      reflog by somebody who does not have the user identity required
      to make a commit.  They all used to barf and die.
      
      I've run tests and all of them seem to pass, and also tried "git
      clone" as a user whose GECOS is empty -- git clone works again
      now (it was broken when reflog was enabled by default).
      
      But this definitely needs extra sets of eyeballs.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cb280e10
  29. 20 1月, 2007 2 次提交
    • J
      show-branch --reflog: show the reflog message at the top. · 76a44c5c
      Junio C Hamano 提交于
      This changes the output so the list at the top shows the reflog
      message, along with their relative timestamps.
      
      You can use --reflog=<n> to show <n> most recent log entries, or
      use --reflog=<n>,<b> to show <n> entries going back from the
      entry <b>.  <b> can be either a number (so --reflog=4,20 shows 4
      records starting from @{20}) or a timestamp (e.g. --reflog='4,1 day').
      
      Here is a sample output (with --list option):
      
        $ git show-branch --reflog=10 --list jc/show-reflog
          [jc/show-reflog@{0}] (3 minutes ago) commit (amend): show-branch --ref
          [jc/show-reflog@{1}] (5 minutes ago) reset HEAD^
          [jc/show-reflog@{2}] (14 minutes ago) commit: show-branch --reflog: sho
          [jc/show-reflog@{3}] (14 minutes ago) commit: show-branch --reflog: sho
          [jc/show-reflog@{4}] (18 minutes ago) commit (amend): Extend read_ref_a
          [jc/show-reflog@{5}] (18 minutes ago) commit (amend): Extend read_ref_a
          [jc/show-reflog@{6}] (18 minutes ago) commit (amend): Extend read_ref_a
          [jc/show-reflog@{7}] (18 minutes ago) am: read_ref_at(): allow retrievi
          [jc/show-reflog@{8}] (18 minutes ago) reset --hard HEAD~4
          [jc/show-reflog@{9}] (61 minutes ago) commit: show-branch --reflog: use
      
      This shows what I did more cleanly:
      
        $ git show-branch --reflog=10 jc/show-reflog
        ! [jc/show-reflog@{0}] (3 minutes ago) commit (amend): show-branch --ref
         ! [jc/show-reflog@{1}] (5 minutes ago) reset HEAD^
          ! [jc/show-reflog@{2}] (14 minutes ago) commit: show-branch --reflog:
           ! [jc/show-reflog@{3}] (14 minutes ago) commit: show-branch --reflog:
            ! [jc/show-reflog@{4}] (18 minutes ago) commit (amend): Extend read_
             ! [jc/show-reflog@{5}] (18 minutes ago) commit (amend): Extend read
              ! [jc/show-reflog@{6}] (18 minutes ago) commit (amend): Extend rea
               ! [jc/show-reflog@{7}] (18 minutes ago) am: read_ref_at(): allow
                ! [jc/show-reflog@{8}] (18 minutes ago) reset --hard HEAD~4
                 ! [jc/show-reflog@{9}] (61 minutes ago) commit: show-branch --r
        ----------
        +          [jc/show-reflog@{0}] show-branch --reflog: show the reflog
          +        [jc/show-reflog@{2}] show-branch --reflog: show the reflog
         +++       [jc/show-reflog@{1}] show-branch --reflog: show the reflog
        +++++      [jc/show-reflog@{4}] Extend read_ref_at() to be usable fro
             +     [jc/show-reflog@{5}] Extend read_ref_at() to be usable fro
              +    [jc/show-reflog@{6}] Extend read_ref_at() to be usable fro
               +   [jc/show-reflog@{7}] read_ref_at(): allow retrieving the r
                 + [jc/show-reflog@{9}] show-branch --reflog: use updated rea
                 + [jc/show-reflog@{9}^] read_ref_at(): allow reporting the c
                 + [jc/show-reflog@{9}~2] show-branch --reflog: show the refl
                 + [jc/show-reflog@{9}~3] read_ref_at(): allow retrieving the
        ++++++++++ [jc/show-reflog@{8}] dwim_ref(): Separate name-to-ref DWIM
      
      At @{9}, I had a commit to complete 5 patch series, but I wanted
      to consolidate two commits that enhances read_ref_at() into one
      (they were @{9}^ and @{9}~3), and another two that touch show-branch
      into one (@{9} and @{9}~2).
      
      I first saved them with "format-patch -4", and then did a reset
      at @{8}.  At @{7}, I applied one of them with "am", and then
      used "git-apply" on the other one, and amended the commit at
      @{6} (so @{6} and @{7} has the same parent).  I did not like the
      log message, so I amended again at @{5}.
      
      Then I cherry-picked @{9}~2 to create @{3} (the log message
      shows that it needs to learn to set GIT_REFLOG_ACTION -- it uses
      "git-commit" and the log entry is attributed for it).  Another
      cherry-pick built @{2} out of @{9}, but what I wanted to do was
      to squash these two into one, so I did a "reset HEAD^" at @{1}
      and then made the final commit by amending what was at the top.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      76a44c5c
    • J
      Extend read_ref_at() to be usable from places other than sha1_name. · 16d7cc90
      Junio C Hamano 提交于
      You can pass an extra argument to the function to receive the
      reflog message information.  Also when the log does not go back
      beyond the point the user asked, the cut-off time and count are
      given back to the caller for emitting the error messages as
      appropriately.
      
      We could later add configuration for get_sha1_basic() to make it
      an error instead of it being just a warning.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      16d7cc90
  30. 19 1月, 2007 2 次提交