1. 09 May, 2017 1 commit
    • Ramsay Jones's avatar
      archive-tar: fix a sparse 'constant too large' warning · 3f789719
      Ramsay Jones authored
      Commit dddbad72 ("timestamp_t: a new data type for timestamps",
      26-04-2017) introduced a new typedef 'timestamp_t', as a synonym for an
      unsigned long, which was used at the time to represent timestamps in
      git. A later commit 28f4aee3 ("use uintmax_t for timestamps",
      26-04-2017) changed the typedef to use an 'uintmax_t' for the timestamp
      representation type.
      
      When building on a 32-bit Linux system, sparse complains that a constant
      (USTAR_MAX_MTIME) used to detect a 'far-future mtime' timestamp, is too
      large; 'warning: constant 077777777777UL is so big it is unsigned long
      long' on lines 335 and 338 of archive-tar.c. Note that both gcc and
      clang only issue a warning if this constant is used in a context that
      requires an 'unsigned long' (rather than an uintmax_t). (Since TIME_MAX
      is no longer equal to 0xFFFFFFFF, even on a 32-bit system, the macro
      USTAR_MAX_MTIME is set to 077777777777UL, which cannot be represented as
      an 'unsigned long' constant).
      
      In order to suppress the warning, change the definition of the macro
      constant USTAR_MAX_MTIME to use an 'ULL' type suffix.
      
      In a similar vein, on systems which use a 64-bit representation of the
      'unsigned long' type, the USTAR_MAX_SIZE constant macro is defined with
      the value 077777777777ULL. Although this does not cause any warning
      messages to be issued, it would be more appropriate for this constant
      to use an 'UL' type suffix rather than 'ULL'.
      Signed-off-by: default avatarRamsay Jones <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      3f789719
  2. 27 Apr, 2017 3 commits
    • Johannes Schindelin's avatar
      use uintmax_t for timestamps · 28f4aee3
      Johannes Schindelin authored
      Previously, we used `unsigned long` for timestamps. This was only a good
      choice on Linux, where we know implicitly that `unsigned long` is what is
      used for `time_t`.
      
      However, we want to use a different data type for timestamps for two
      reasons:
      
      - there is nothing that says that `unsigned long` should be the same data
        type as `time_t`, and indeed, on 64-bit Windows for example, it is not:
        `unsigned long` is 32-bit but `time_t` is 64-bit.
      
      - even on 32-bit Linux, where `unsigned long` (and thereby `time_t`) is
        32-bit, we *want* to be able to encode timestamps in Git that are
        currently absurdly far in the future, *even if* the system library is
        not able to format those timestamps into date strings.
      
      So let's just switch to the maximal integer type available, which should
      be at least 64-bit for all practical purposes these days. It certainly
      cannot be worse than `unsigned long`, so...
      Signed-off-by: Johannes Schindelin's avatarJohannes Schindelin <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      28f4aee3
    • Johannes Schindelin's avatar
      date.c: abort if the system time cannot handle one of our timestamps · 1e65a982
      Johannes Schindelin authored
      We are about to switch to a new data type for time stamps that is
      definitely not smaller or equal, but larger or equal to time_t.
      
      So before using the system functions to process or format timestamps,
      let's make extra certain that they can handle what we feed them.
      Signed-off-by: Johannes Schindelin's avatarJohannes Schindelin <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      1e65a982
    • Johannes Schindelin's avatar
      timestamp_t: a new data type for timestamps · dddbad72
      Johannes Schindelin authored
      Git's source code assumes that unsigned long is at least as precise as
      time_t. Which is incorrect, and causes a lot of problems, in particular
      where unsigned long is only 32-bit (notably on Windows, even in 64-bit
      versions).
      
      So let's just use a more appropriate data type instead. In preparation
      for this, we introduce the new `timestamp_t` data type.
      
      By necessity, this is a very, very large patch, as it has to replace all
      timestamps' data type in one go.
      
      As we will use a data type that is not necessarily identical to `time_t`,
      we need to be very careful to use `time_t` whenever we interact with the
      system functions, and `timestamp_t` everywhere else.
      Signed-off-by: Johannes Schindelin's avatarJohannes Schindelin <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      dddbad72
  3. 24 Apr, 2017 2 commits
  4. 21 Apr, 2017 3 commits
    • Johannes Schindelin's avatar
      t0006 & t5000: skip "far in the future" test when time_t is too limited · efac8ac8
      Johannes Schindelin authored
      Git's source code refers to timestamps as unsigned long, which is
      ill-defined, as there is no guarantee about the number of bits that
      data type has.
      
      In preparation of switching to another data type that is large enough
      to hold "far in the future" dates, we need to prepare the t0006-date.sh
      script for the case where we *still* cannot format those dates if the
      system library uses 32-bit time_t.
      Signed-off-by: Johannes Schindelin's avatarJohannes Schindelin <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      efac8ac8
    • Johannes Schindelin's avatar
      t0006 & t5000: prepare for 64-bit timestamps · a07fb050
      Johannes Schindelin authored
      Git's source code refers to timestamps as unsigned longs. On 32-bit
      platforms, as well as on Windows, unsigned long is not large enough to
      capture dates that are "absurdly far in the future".
      
      It is perfectly valid by the C standard, of course, for the `long` data
      type to refer to 32-bit integers. That is why the `time_t` data type
      exists: so that it can be 64-bit even if `long` is 32-bit. Git's source
      code simply uses an incorrect data type for timestamps, is all.
      
      The earlier quick fix 6b9c38e1 (t0006: skip "far in the future" test
      when unsigned long is not long enough, 2016-07-11) papered over this
      issue simply by skipping the respective test cases on platforms where
      they would fail due to the data type in use.
      
      This quick fix, however, tests for *long* to be 64-bit or not. What we
      need, though, is a test that says whether *whatever data type we use for
      timestamps* is 64-bit or not.
      
      The same quick fix was used to handle the similar problem where Git's
      source code uses `unsigned long` to represent size, instead of `size_t`,
      conflating the two issues.
      
      So let's just add another prerequisite to test specifically whether
      timestamps are represented by a 64-bit data type or not. Later, after we
      switch to a larger data type, we can flip that prerequisite to test
      `time_t` instead of `long`.
      Signed-off-by: Johannes Schindelin's avatarJohannes Schindelin <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      a07fb050
    • Johannes Schindelin's avatar
      ref-filter: avoid using `unsigned long` for catch-all data type · e467dc14
      Johannes Schindelin authored
      In its `atom_value` struct, the ref-filter source code wants to store
      different values in a field called `ul` (for `unsigned long`), e.g.
      timestamps.
      
      However, as we are about to switch the data type of timestamps away from
      `unsigned long` (because it may be 32-bit even when `time_t` is 64-bit),
      that data type is not large enough.
      
      Simply change that field to use `uintmax_t` instead.
      
      This patch is a bit larger than the mere change of the data type
      because the field's name was tied to its data type, which has been fixed
      at the same time.
      Signed-off-by: Johannes Schindelin's avatarJohannes Schindelin <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      e467dc14
  5. 20 Apr, 2017 18 commits
    • Junio C Hamano's avatar
      Git 2.13-rc0 · 6a2c2f8d
      Junio C Hamano authored
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      6a2c2f8d
    • Junio C Hamano's avatar
      Merge branch 'jh/memihash-opt' · 8377f345
      Junio C Hamano authored
      Hotfix for a topic that is already in 'master'.
      
      * jh/memihash-opt:
        p0004: make perf test executable
        t3008: skip lazy-init test on a single-core box
        test-online-cpus: helper to return cpu count
        name-hash: fix buffer overrun
      8377f345
    • Junio C Hamano's avatar
      Merge branch 'vn/revision-shorthand-for-side-branch-log' · 5feb8b84
      Junio C Hamano authored
      Doc cleanup.
      
      * vn/revision-shorthand-for-side-branch-log:
        doc/revisions: remove brackets from rev^-n shorthand
      5feb8b84
    • Junio C Hamano's avatar
      Merge branch 'sf/putty-w-args' · c96e3ce6
      Junio C Hamano authored
      * sf/putty-w-args:
        connect.c: handle errors from split_cmdline
      c96e3ce6
    • Junio C Hamano's avatar
      Merge branch 'ld/p4-current-branch-fix' · c2cbb30f
      Junio C Hamano authored
      "git p4" used "name-rev HEAD" when it wants to learn what branch is
      checked out; it should use "symbolic-ref HEAD".
      
      * ld/p4-current-branch-fix:
        git-p4: don't use name-rev to get current branch
        git-p4: add read_pipe_text() internal function
        git-p4: add failing test for name-rev rather than symbolic-ref
      c2cbb30f
    • Junio C Hamano's avatar
      Merge branch 'dt/gc-ignore-old-gc-logs' · 442136f7
      Junio C Hamano authored
      * dt/gc-ignore-old-gc-logs:
        t6500: wait for detached auto gc at the end of the test script
      442136f7
    • Junio C Hamano's avatar
      Merge branch 'bw/attr-pathspec' · 2f9dfb83
      Junio C Hamano authored
      * bw/attr-pathspec:
        pathspec: fix segfault in clear_pathspec
      2f9dfb83
    • Junio C Hamano's avatar
      Merge branch 'ab/grep-plug-pathspec-leak' · df3b1192
      Junio C Hamano authored
      Call clear_pathspec() to release resources immediately before the
      cmd_grep() function returns.
      
      * ab/grep-plug-pathspec-leak:
        grep: plug a trivial memory leak
      df3b1192
    • Junio C Hamano's avatar
      Merge branch 'jk/no-looking-at-dotgit-outside-repo' · eb3af74e
      Junio C Hamano authored
      Clean up fallouts from recent tightening of the set-up sequence,
      where Git barfs when repository information is accessed without
      first ensuring that it was started in a repository.
      
      * jk/no-looking-at-dotgit-outside-repo:
        test-read-cache: setup git dir
        has_sha1_file: don't bother if we are not in a repository
      eb3af74e
    • Junio C Hamano's avatar
      Merge branch 'nd/files-backend-git-dir' · 5ab8f226
      Junio C Hamano authored
      The "submodule" specific field in the ref_store structure is
      replaced with a more generic "gitdir" that can later be used also
      when dealing with ref_store that represents the set of refs visible
      from the other worktrees.
      
      * nd/files-backend-git-dir: (28 commits)
        refs.h: add a note about sorting order of for_each_ref_*
        t1406: new tests for submodule ref store
        t1405: some basic tests on main ref store
        t/helper: add test-ref-store to test ref-store functions
        refs: delete pack_refs() in favor of refs_pack_refs()
        files-backend: avoid ref api targeting main ref store
        refs: new transaction related ref-store api
        refs: add new ref-store api
        refs: rename get_ref_store() to get_submodule_ref_store() and make it public
        files-backend: replace submodule_allowed check in files_downcast()
        refs: move submodule code out of files-backend.c
        path.c: move some code out of strbuf_git_path_submodule()
        refs.c: make get_main_ref_store() public and use it
        refs.c: kill register_ref_store(), add register_submodule_ref_store()
        refs.c: flatten get_ref_store() a bit
        refs: rename lookup_ref_store() to lookup_submodule_ref_store()
        refs.c: introduce get_main_ref_store()
        files-backend: remove the use of git_path()
        files-backend: add and use files_ref_path()
        files-backend: add and use files_reflog_path()
        ...
      5ab8f226
    • Junio C Hamano's avatar
      Merge branch 'bw/submodule-is-active' · 52d77af4
      Junio C Hamano authored
      Error message fix.
      
      * bw/submodule-is-active:
        submodule--helper: fix typo in is_active error message
      52d77af4
    • Junio C Hamano's avatar
      Merge branch 'va/i18n-perl-scripts' · 34130cc0
      Junio C Hamano authored
      Message fix.
      
      * va/i18n-perl-scripts:
        git-add--interactive.perl: add missing dot in a message
      34130cc0
    • Junio C Hamano's avatar
      Merge branch 'sb/submodule-rm-absorb' · a06380be
      Junio C Hamano authored
      Error message fix.
      
      * sb/submodule-rm-absorb:
        submodule.c: add missing ' in error messages
      a06380be
    • Junio C Hamano's avatar
      Merge branch 'ah/diff-files-ours-theirs-doc' · 7203bafa
      Junio C Hamano authored
      The diff options "--ours", "--theirs" exist for quite some time.
      But so far they were not documented. Now they are.
      
      * ah/diff-files-ours-theirs-doc:
        diff-files: document --ours etc.
      7203bafa
    • Junio C Hamano's avatar
      Merge branch 'lt/mailinfo-in-body-header-continuation' · 74a74bee
      Junio C Hamano authored
      If a patch e-mail had its first paragraph after an in-body header
      indented (even after a blank line after the in-body header line),
      the indented line was mistook as a continuation of the in-body
      header.  This has been fixed.
      
      * lt/mailinfo-in-body-header-continuation:
        mailinfo: fix in-body header continuations
      74a74bee
    • Junio C Hamano's avatar
      Merge branch 'bw/push-options-recursively-to-submodules' · 872e2cf0
      Junio C Hamano authored
      "git push --recurse-submodules --push-option=<string>" learned to
      propagate the push option recursively down to pushes in submodules.
      
      * bw/push-options-recursively-to-submodules:
        push: propagate remote and refspec with --recurse-submodules
        submodule--helper: add push-check subcommand
        remote: expose parse_push_refspec function
        push: propagate push-options with --recurse-submodules
        push: unmark a local variable as static
      872e2cf0
    • Junio C Hamano's avatar
      Merge branch 'bc/object-id' · b1081e40
      Junio C Hamano authored
      Conversion from unsigned char [40] to struct object_id continues.
      
      * bc/object-id:
        Documentation: update and rename api-sha1-array.txt
        Rename sha1_array to oid_array
        Convert sha1_array_for_each_unique and for_each_abbrev to object_id
        Convert sha1_array_lookup to take struct object_id
        Convert remaining callers of sha1_array_lookup to object_id
        Make sha1_array_append take a struct object_id *
        sha1-array: convert internal storage for struct sha1_array to object_id
        builtin/pull: convert to struct object_id
        submodule: convert check_for_new_submodule_commits to object_id
        sha1_name: convert disambiguate_hint_fn to take object_id
        sha1_name: convert struct disambiguate_state to object_id
        test-sha1-array: convert most code to struct object_id
        parse-options-cb: convert sha1_array_append caller to struct object_id
        fsck: convert init_skiplist to struct object_id
        builtin/receive-pack: convert portions to struct object_id
        builtin/pull: convert portions to struct object_id
        builtin/diff: convert to struct object_id
        Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZ
        Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ
        Define new hash-size constants for allocating memory
      b1081e40
    • Junio C Hamano's avatar
      Merge branch 'sb/submodule-short-status' · c703555c
      Junio C Hamano authored
      The output from "git status --short" has been extended to show
      various kinds of dirtyness in submodules differently; instead of to
      "M" for modified, 'm' and '?' can be shown to signal changes only
      to the working tree of the submodule but not the commit that is
      checked out.
      
      * sb/submodule-short-status:
        submodule.c: correctly handle nested submodules in is_submodule_modified
        short status: improve reporting for submodule changes
        submodule.c: stricter checking for submodules in is_submodule_modified
        submodule.c: port is_submodule_modified to use porcelain 2
        submodule.c: convert is_submodule_modified to use strbuf_getwholeline
        submodule.c: factor out early loop termination in is_submodule_modified
        submodule.c: use argv_array in is_submodule_modified
      c703555c
  6. 19 Apr, 2017 1 commit
  7. 17 Apr, 2017 12 commits