1. 31 8月, 2009 4 次提交
    • J
      fix approxidate parsing of relative months and years · 931e8e27
      Jeff King 提交于
      These were broken by b5373e9. The problem is that the code
      marks the month and year with "-1" for "we don't know it
      yet", but the month and year code paths were not adjusted to
      fill in the current time before doing their calculations
      (whereas other units follow a different code path and are
      fine).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      931e8e27
    • J
      tests: add date printing and parsing tests · 34dc6e73
      Jeff King 提交于
      Until now, there was no coverage of relative date printing
      or approxidate parsing routines (mainly because we had no
      way of faking the "now" time for relative date calculations,
      which made consistent testing impossible).
      
      This new script tries to exercise the basic features of
      show_date and approxidate. Most of the tests are just "this
      obvious thing works" to prevent future regressions, with a
      few exceptions:
      
        - We confirm the fix in 607a9e8a that relative year/month
          dates in the latter half of a year round correctly.
      
        - We confirm that the improvements in b5373e9 and 1bddb25
          work.
      
        - A few tests are marked to expect failure, which are
          regressions recently introduced by the two commits
          above.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      34dc6e73
    • J
      refactor test-date interface · 4f6552ea
      Jeff King 提交于
      The test-date program goes back to the early days of git,
      where it was presumably used to do manual sanity checks on
      changes to the date code. However, it is not actually used
      by the test suite to do any sort of automatic of systematic
      tests.
      
      This patch refactors the interface to the program to try to
      make it more suitable for use by the test suite. There
      should be no fallouts to changing the interface since it is
      not actually installed and is not internally called by any
      other programs.
      
      The changes are:
      
        - add a "mode" parameter so the caller can specify which
          operation to test
      
        - add a mode to test relative date output from show_date
      
        - allow faking a fixed time via the TEST_DATE_NOW
          environment variable, which allows consistent automated
          testing
      
        - drop the use of ctime for showing dates in favor of our
          internal iso8601 printing routines. The ctime output is
          somewhat redundant (because of the day-of-week) which
          makes writing test cases more annoying.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4f6552ea
    • A
      Add date formatting and parsing functions relative to a given time · 33012fc4
      Alex Riesen 提交于
      The main purpose is to allow predictable testing of the code.
      Signed-off-by: NAlex Riesen <raa.lkml@gmail.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      33012fc4
  2. 23 8月, 2009 2 次提交
    • L
      Further 'approxidate' improvements · 36e4986f
      Linus Torvalds 提交于
      The previous patch to improve approxidate got us to the point that a lot
      of the remaining annoyances were due to the 'strict' date handling running
      first, and deciding that it got a good enough date that the approximate
      date routines were never even invoked.
      
      For example, using a date string like
      
      	6AM, June 7, 2009
      
      the strict date logic would be perfectly happy with the "June 7, 2009"
      part, and ignore the 6AM part that it didn't understand - resulting in the
      information getting dropped on the floor:
      
      	6AM, June 7, 2009 -> Sat Jun 6 00:00:00 2009
      
      and the date being calculated as if it was midnight, and the '6AM' having
      confused the date routines into thinking about '6 June' rather than 'June
      7' at 6AM (ie notice how the _day_ was wrong due to this, not just the
      time).
      
      So this makes the strict date routines a bit stricter, and requires that
      not just the date, but also the time, has actually been parsed. With that
      fix, and trivial extension of the approxidate routines, git now properly
      parses the date as
      
      	6AM, June 7, 2009 -> Sun Jun  7 06:00:00 2009
      
      without dropping the fuzzy time ("6AM" or "noon" or any of the other
      non-strict time formats) on the floor.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      36e4986f
    • L
      Improve on 'approxidate' · 90290552
      Linus Torvalds 提交于
      This is not a new failure mode - approxidate has always been kind of
      random in the input it accepts, but some of the randomness is more
      irritating than others.
      
      For example:
      
      	Jun 6, 5AM -> Mon Jun 22 05:00:00 2009
      	5AM Jun 6 -> Sat Jun  6 05:00:00 2009
      
      Whaa? The reason for the above is that approxidate squirrells away the '6'
      from "Jun 6" to see if it's going to be a relative number, and then
      forgets about it when it sees a new number (the '5' in '5AM'). So the odd
      "June 22" date is because today is July 22nd, and if it doesn't have
      another day of the month, it will just pick todays mday - having ignored
      the '6' entirely due to getting all excited about seeing a new number (5).
      
      There are other oddnesses. This does not fix them all, but I think it
      makes for fewer _really_ perplexing cases. At least now we have
      
      	Jun 6, 5AM -> Sat Jun  6 05:00:00 2009
      	5AM, Jun 6 -> Sat Jun  6 05:00:00 2009
      
      which makes me happier. I can still point to cases that don't work as
      well, but those are separate issues.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      90290552
  3. 22 8月, 2009 13 次提交
  4. 20 8月, 2009 1 次提交
  5. 19 8月, 2009 10 次提交
  6. 17 8月, 2009 1 次提交
    • J
      docs: describe impact of repack on "clone -s" · 13354f53
      Jeff King 提交于
      The effects of repacking on a repository with alternates are a bit
      subtle. The two main things users will want are:
      
        1. Not to waste disk space by accidentally copying objects which could
           be shared.
      
        2. Copying all objects explicitly to break the dependency on the source
           repo.
      
      This patch describes both under the "clone -s" documentation. It makes
      sense to put it there rather than in git-repack.txt for both cases.
      
      For (1), we are warning the user who is using "clone -s" about what _not_
      to do, so we need to get their attention when reading about "clone -s".
      
      For (2), we are telling them how git-repack can be used to accomplish a
      task, but until they know that git-repack is the right tool, they have no
      reason to look at the repack documentation.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      13354f53
  7. 16 8月, 2009 8 次提交
    • J
      Merge branch 'lt/block-sha1' · 64d5fe0a
      Junio C Hamano 提交于
      * lt/block-sha1:
        block-sha1/sha1.c: silence compiler complaints by casting void * to char *
        block-sha1: more good unaligned memory access candidates
        block-sha1: support for architectures with memory alignment restrictions
        block-sha1: split the different "hacks" to be individually selected
        block-sha1: move code around
        block-sha1: improve code on large-register-set machines
        block-sha1: improved SHA1 hashing
        block-sha1: perform register rotation using cpp
        block-sha1: get rid of redundant 'lenW' context
        block-sha1: Use '(B&C)+(D&(B^C))' instead of '(B&C)|(D&(B|C))' in round 3
        block-sha1: macroize the rounds a bit further
        block-sha1: re-use the temporary array as we calculate the SHA1
        block-sha1: make the 'ntohl()' part of the first SHA1 loop
        block-sha1: minor fixups
        block-sha1: try to use rol/ror appropriately
        block-sha1: undo ctx->size change
        Add new optimized C 'block-sha1' routines
      64d5fe0a
    • J
      Merge branch 'bc/maint-am-email' · 2f74fb56
      Junio C Hamano 提交于
      * bc/maint-am-email:
        git-am: print fair error message when format detection fails
        am: allow individual e-mail files as input
      2f74fb56
    • J
      Merge branch 'js/maint-cover-letter-non-ascii' · 228f9c9a
      Junio C Hamano 提交于
      * js/maint-cover-letter-non-ascii:
        Correctly mark cover letters' encodings if they are not pure ASCII
        Expose the has_non_ascii() function
      228f9c9a
    • J
      Merge branch 'jc/maint-clean-nested-dir-safety' · 14683af8
      Junio C Hamano 提交于
      * jc/maint-clean-nested-dir-safety:
        clean: require double -f options to nuke nested git repository and work tree
      14683af8
    • J
      Merge branch 'jk/maint-merge-msg-fix' · b21f9e7f
      Junio C Hamano 提交于
      * jk/maint-merge-msg-fix:
        merge: indicate remote tracking branches in merge message
        merge: fix incorrect merge message for ambiguous tag/branch
        add tests for merge message headings
      b21f9e7f
    • J
      Merge git://git.kernel.org/pub/scm/gitk/gitk · 1d7d6ad5
      Junio C Hamano 提交于
      * git://git.kernel.org/pub/scm/gitk/gitk:
        gitk: Parse arbitrary commit-ish in SHA1 field
        gitk: Fix direction of symmetric difference in optimized mode
        gitk: New option to hide remote refs
        gitk: Do not hard-code "encoding" in attribute lookup functions
      1d7d6ad5
    • T
      add -p: do not attempt to coalesce mode changes · 3d792161
      Thomas Rast 提交于
      In 0392513f (add-interactive: refactor mode hunk handling, 2009-04-16),
      we merged the interaction loops for mode changes and hunk staging.
      This was fine at the time, because 0beee4c6 (git-add--interactive:
      remove hunk coalescing, 2008-07-02) removed hunk coalescing.
      
      However, in 7a26e653 (Revert "git-add--interactive: remove hunk
      coalescing", 2009-05-16), we resurrected it.  Since then, the code
      would attempt in vain to merge mode changes with diff hunks,
      corrupting both in the process.
      
      We add a check to the coalescing loop to ensure it only looks at diff
      hunks, thus skipping mode changes.
      Noticed-by: NKirill Smelkov <kirr@mns.spb.ru>
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3d792161
    • K
      git add -p: demonstrate failure when staging both mode and hunk · 87ca2eaa
      Kirill Smelkov 提交于
      When trying to stage changes to file which has also pending `chmod +x`,
      `git add -p` produces lots of 'Use of uninitialized value ...' warnings
      and fails to do the job:
      
          $ echo content >> file
          $ chmod +x file
          $ git add -p
          diff --git a/file b/file
          index e69de29..d95f3ad
          --- a/file
          +++ b/file
          old mode 100644
          new mode 100755
          Stage mode change [y,n,q,a,d,/,j,J,g,?]? y
          @@ -0,0 +1 @@
          +content
          Stage this hunk [y,n,q,a,d,/,K,g,e,?]? y
          Use of uninitialized value $o_ofs in addition (+) at .../git-add--interactive line 776.
          Use of uninitialized value $ofs in numeric le (<=) at .../git-add--interactive line 806.
          Use of uninitialized value $o0_ofs in concatenation (.) or string at .../git-add--interactive line 830.
          Use of uninitialized value $n0_ofs in concatenation (.) or string at .../git-add--interactive line 830.
          Use of uninitialized value $o_ofs in addition (+) at .../git-add--interactive line 776.
          fatal: corrupt patch at line 5
          diff --git a/file b/file
          index e69de29..d95f3ad
          --- a/file
          +++ b/file
          @@ -,0 + @@
          +content
      Signed-off-by: NKirill Smelkov <kirr@mns.spb.ru>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      87ca2eaa
  8. 15 8月, 2009 1 次提交